diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 0007d9db9e38f079dddbd371cf6109f57b9a35b2..7ad671eddaef32f399ed66aecd0dffe8a61105d0 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1110,8 +1110,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data) } if (isStoppedReason(reason) || reason.isEmpty()) { - QVariant var = QVariant::fromValue<GdbMi>(data); - // Don't load helpers on stops triggered by signals unless it's // an intentional trap. bool initHelpers = m_debuggingHelperState == DebuggingHelperUninitialized; @@ -1121,11 +1119,10 @@ void GdbEngine::handleStopResponse(const GdbMi &data) if (initHelpers) { tryLoadDebuggingHelpers(); + QVariant var = QVariant::fromValue<GdbMi>(data); postCommand(_("p 4"), CB(handleStop1), var); // dummy } else { - GdbResponse response; - response.cookie = var; - handleStop1(response); + handleStop1(data); } return; } @@ -1153,7 +1150,11 @@ void GdbEngine::handleStopResponse(const GdbMi &data) void GdbEngine::handleStop1(const GdbResponse &response) { - GdbMi data = response.cookie.value<GdbMi>(); + handleStop1(response.cookie.value<GdbMi>()); +} + +void GdbEngine::handleStop1(const GdbMi &data) +{ QByteArray reason = data.findChild("reason").data(); if (m_modulesListOutdated) { reloadModules(); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index a0b74f199e430e83ea69ab8c06c4ca60d4e402cb..eb16b9fd8c4cbc41ba42de48b6a84f40dd820f04 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -259,6 +259,7 @@ private: void handleStart(const GdbResponse &response); void handleStopResponse(const GdbMi &data); void handleStop1(const GdbResponse &response); + void handleStop1(const GdbMi &data); void handleStop2(const GdbResponse &response); void handleStop2(const GdbMi &data); void handleResultRecord(const GdbResponse &response);