Commit 184b0795 authored by hjk's avatar hjk Committed by hjk

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/97Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 96cde1e9
......@@ -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();
......
......@@ -723,6 +723,7 @@ private: ////////// View & Data Stuff //////////
QByteArray m_currentThread;
QString m_lastWinException;
int m_qFatalBreakpointNumber;
bool m_actingOnExpectedStop;
};
} // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment