From 184b079557025159930b9fdc9db7f5f561501221 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 25 May 2011 08:58:25 +0200 Subject: [PATCH] Debugger: don't auto-continue on SIGTRAP if the user ordered a stop Task-number: QTCREATORBUG-4968 Change-Id: I48d49c3098be3392c9ef7e6b0112149c7def22f9 Reviewed-on: http://codereview.qt.nokia.com/97 Reviewed-by: hjk --- src/plugins/debugger/gdb/gdbengine.cpp | 8 +++++--- src/plugins/debugger/gdb/gdbengine.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8cfe9711d41..18472b67630 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -216,6 +216,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters, m_preparedForQmlBreak = false; m_disassembleUsesComma = false; m_qFatalBreakpointNumber = 0; + m_actingOnExpectedStop = false; invalidateSourcesList(); @@ -1201,6 +1202,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data) { // This is gdb 7+'s initial *stopped in response to attach. // For consistency, we just discard it. + m_actingOnExpectedStop = false; if (state() == InferiorSetupRequested) return; @@ -1271,6 +1273,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data) if (!m_commandsToRunOnTemporaryBreak.isEmpty()) { QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state()) + m_actingOnExpectedStop = true; notifyInferiorStopOk(); flushQueuedCommands(); if (state() == InferiorStopOk) { @@ -1299,6 +1302,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data) // That's expected. } else { QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state()); + m_actingOnExpectedStop = true; notifyInferiorStopOk(); } @@ -1497,9 +1501,7 @@ void GdbEngine::handleStop1(const GdbMi &data) && reason == "signal-received" && data.findChild("signal-name").data() == "SIGTRAP") { - const GdbMi frame = data.findChild("frame"); - const QByteArray func = frame.findChild("func").data(); - if (func != "ntdll!DbgUiConnectToDbg" && func != "ntdll|DbgBreakPoint") { + if (!m_actingOnExpectedStop) { // Ignore signals from command line start up traps. showMessage(_("INTERNAL CONTINUE"), LogMisc); continueInferiorInternal(); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index adfb16845e3..05dc3bf9fb8 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -723,6 +723,7 @@ private: ////////// View & Data Stuff ////////// QByteArray m_currentThread; QString m_lastWinException; int m_qFatalBreakpointNumber; + bool m_actingOnExpectedStop; }; } // namespace Internal