Commit 5bd5fa63 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

be more lenient when matching the stops at _start

archer reports stops at tbreaks properly, so checking for an empty stop
reason is no particularly good idea. instead, we simply skip *all* stops
at the entry point, assuming the user will not really set a breakpoint
there anyway.

Reviewed-by: hjk
parent e4b1a25d
...@@ -1184,23 +1184,20 @@ void GdbEngine::handleStopResponse(const GdbMi &data) ...@@ -1184,23 +1184,20 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
if (!m_entryPoint.isEmpty()) { if (!m_entryPoint.isEmpty()) {
GdbMi frameData = data.findChild("frame"); GdbMi frameData = data.findChild("frame");
if (frameData.findChild("addr").data() == m_entryPoint) { if (frameData.findChild("addr").data() == m_entryPoint) {
if (reason == "signal-received" // There are two expected reasons for getting here:
&& data.findChild("signal-name").data() == "SIGSTOP") { // 1) For some reason, attaching to a stopped process causes *two* SIGSTOPs
// For some reason, attaching to a stopped process causes *two* stops // when trying to continue (kernel i386 2.6.24-23-ubuntu, gdb 6.8).
// when trying to continue (kernel i386 2.6.24-23-ubuntu, gdb 6.8). // Interestingly enough, on MacOSX no signal is delivered at all.
// Interestingly enough, on MacOSX no signal is delivered at all. // 2) The explicit tbreak at the entry point we set to query the PID.
continueInferiorInternal(); // Gdb <= 6.8 reports a frame but no reason, 6.8.50+ reports everything.
return; // The case of the user really setting a breakpoint at _start is simply
} // unsupported.
if (reason.isEmpty()) { // tbreak does that if (!inferiorPid()) // For programs without -pthread under gdb <= 6.8.
// For programs without -pthread under gdb <= 6.8. postCommand(_("info proc"), CB(handleInfoProc));
if (!inferiorPid()) continueInferiorInternal();
postCommand(_("info proc"), CB(handleInfoProc)); return;
continueInferiorInternal();
return;
}
} }
// We are past the initial stops. No need to waste time on further checks. // We are past the initial stop(s). No need to waste time on further checks.
m_entryPoint.clear(); m_entryPoint.clear();
} }
#endif #endif
......
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