debugger: fix message on debugger exit

This commit is contained in:
hjk
2009-04-16 15:06:31 +02:00
parent 544aea1a2e
commit 39bf47f7ae
2 changed files with 22 additions and 10 deletions

View File

@@ -103,6 +103,7 @@ enum GdbCommandType
GdbQuerySources, GdbQuerySources,
GdbAsyncOutput2, GdbAsyncOutput2,
GdbStart, GdbStart,
GdbExit,
GdbAttached, GdbAttached,
GdbStubAttached, GdbStubAttached,
GdbExecRun, GdbExecRun,
@@ -755,6 +756,9 @@ void GdbEngine::handleResult(const GdbResultRecord & record, int type,
case GdbInfoThreads: case GdbInfoThreads:
handleInfoThreads(record); handleInfoThreads(record);
break; break;
case GdbExit:
handleExit(record);
break;
case GdbShowVersion: case GdbShowVersion:
handleShowVersion(record); handleShowVersion(record);
@@ -1167,7 +1171,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
+ data.findChild("signal-name").toString(); + data.findChild("signal-name").toString();
} }
q->showStatusMessage(msg); q->showStatusMessage(msg);
sendCommand("-gdb-exit"); sendCommand("-gdb-exit", GdbExit);
return; return;
} }
@@ -1525,7 +1529,7 @@ void GdbEngine::exitDebugger()
sendCommand("detach"); sendCommand("detach");
else else
sendCommand("kill"); sendCommand("kill");
sendCommand("-gdb-exit"); sendCommand("-gdb-exit", GdbExit);
// 20s can easily happen when loading webkit debug information // 20s can easily happen when loading webkit debug information
m_gdbProc.waitForFinished(20000); m_gdbProc.waitForFinished(20000);
if (m_gdbProc.state() != QProcess::Running) { if (m_gdbProc.state() != QProcess::Running) {
@@ -1797,6 +1801,12 @@ void GdbEngine::handleAttach()
qq->reloadRegisters(); qq->reloadRegisters();
} }
void GdbEngine::handleExit(const GdbResultRecord &response)
{
Q_UNUSED(response);
q->showStatusMessage(tr("Debugger exited."));
}
void GdbEngine::stepExec() void GdbEngine::stepExec()
{ {
setTokenBarrier(); setTokenBarrier();
@@ -3409,14 +3419,15 @@ void GdbEngine::handleQueryDebuggingHelper(const GdbResultRecord &record)
m_availableSimpleDebuggingHelpers.append(item.data()); m_availableSimpleDebuggingHelpers.append(item.data());
if (m_availableSimpleDebuggingHelpers.isEmpty()) { if (m_availableSimpleDebuggingHelpers.isEmpty()) {
m_debuggingHelperState = DebuggingHelperUnavailable; m_debuggingHelperState = DebuggingHelperUnavailable;
QMessageBox::warning(q->mainWindow(), q->showStatusMessage(tr("Debugging helpers not found."));
tr("Cannot find special data dumpers"), //QMessageBox::warning(q->mainWindow(),
tr("The debugged binary does not contain information needed for " // tr("Cannot find special data dumpers"),
"nice display of Qt data types.\n\n" // tr("The debugged binary does not contain information needed for "
"You might want to try including the file\n\n" // "nice display of Qt data types.\n\n"
".../share/qtcreator/gdbmacros/gdbmacros.cpp\n\n" // "You might want to try including the file\n\n"
"into your project directly.") // ".../share/qtcreator/gdbmacros/gdbmacros.cpp\n\n"
); // "into your project directly.")
// );
} else { } else {
m_debuggingHelperState = DebuggingHelperAvailable; m_debuggingHelperState = DebuggingHelperAvailable;
q->showStatusMessage(tr("%1 custom dumpers found.") q->showStatusMessage(tr("%1 custom dumpers found.")

View File

@@ -199,6 +199,7 @@ private:
void handleQueryPwd(const GdbResultRecord &response); void handleQueryPwd(const GdbResultRecord &response);
void handleQuerySources(const GdbResultRecord &response); void handleQuerySources(const GdbResultRecord &response);
void handleTargetCore(const GdbResultRecord &response); void handleTargetCore(const GdbResultRecord &response);
void handleExit(const GdbResultRecord &response);
void debugMessage(const QString &msg); void debugMessage(const QString &msg);
QString dumperLibraryName() const; QString dumperLibraryName() const;