GDB: Ignore initial SIGTRAP when debugging mingw32 with gdb64

Task-number: QTCREATORBUG-26208
Change-Id: I97e37b6aaca19f20081750de003b012c9853a80c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Orgad Shaneh
2021-09-05 10:26:54 +03:00
committed by Orgad Shaneh
parent 9032c7741a
commit 7e362326fe
2 changed files with 11 additions and 6 deletions

View File

@@ -365,8 +365,11 @@ void GdbEngine::handleResponse(const QString &buff)
QString data = parser.readCString();
// On Windows, the contents seem to depend on the debugger
// version and/or OS version used.
if (data.startsWith("warning:"))
if (data.startsWith("warning:")) {
showMessage(data.mid(9), AppStuff); // Cut "warning: "
if (data.contains("is not compatible with target architecture"))
m_ignoreNextTrap = true;
}
m_pendingLogStreamOutput += data;
@@ -1266,11 +1269,12 @@ void GdbEngine::handleStop1(const GdbMi &data)
// The bandaid here has the problem that it breaks for 'next' over a
// statement that indirectly loads shared libraries
// 6.1.2010: Breaks interrupting inferiors, disabled:
// if (reason == "signal-received"
// && data.findChild("signal-name").data() == "SIGTRAP") {
// continueInferiorInternal();
// return;
// }
if (m_ignoreNextTrap && reason == "signal-received"
&& data["signal-name"].data() == "SIGTRAP") {
m_ignoreNextTrap = false;
continueInferiorInternal();
return;
}
// Jump over well-known frames.
static int stepCounter = 0;

View File

@@ -154,6 +154,7 @@ private: ////////// General Interface //////////
int m_nonDiscardableCount = 0;
bool m_rerunPending = false;
bool m_ignoreNextTrap = false;
////////// Gdb Output, State & Capability Handling //////////