summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-02-24 17:06:02 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-02-24 17:06:02 +0100
commit6cf8628cae5744168eda089f38bdee23f4a7add6 (patch)
treee1af2bb426f5dd64d5a128e0770947f0952d2fd6
parent0e25fb6ec5b2f74918753009f801d14a69e81a32 (diff)
downloadqt-creator-6cf8628cae5744168eda089f38bdee23f4a7add6.tar.gz
unbreak mac debugging again
setting the initial breakpoint at the entry point wreaks havoc, so set it at main() instead. this will miss any breakpoints in global ctors and (currently) makes it impossible to set an actual breakpoint at main.
-rw-r--r--src/plugins/debugger/gdbengine.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp
index d6396563ae..25879e6a0e 100644
--- a/src/plugins/debugger/gdbengine.cpp
+++ b/src/plugins/debugger/gdbengine.cpp
@@ -1664,8 +1664,14 @@ bool GdbEngine::startDebugger()
sendCommand("-exec-arguments " + q->m_processArgs.join(" "));
#ifndef Q_OS_MAC
sendCommand("set auto-solib-add off");
- #endif
sendCommand("info target", GdbStart);
+ #else
+ // On MacOS, breaking in at the entry point wreaks havoc.
+ sendCommand("tbreak main");
+ m_waitingForFirstBreakpointToBeHit = true;
+ qq->notifyInferiorRunningRequested();
+ sendCommand("-exec-run");
+ #endif
}
// set all to "pending"
@@ -1687,18 +1693,10 @@ void GdbEngine::continueInferior()
void GdbEngine::handleStart(const GdbResultRecord &response)
{
- if (response.resultClass == GdbResultDone) {
#ifdef Q_OS_MAC
- QString addr = response.data.findChild("section-info").findChild("entry-point").data();
- if (!addr.isEmpty()) {
- sendCommand("tbreak *" + addr);
- m_waitingForFirstBreakpointToBeHit = true;
- qq->notifyInferiorRunningRequested();
- sendCommand("-exec-run");
- } else {
- debugMessage("CANNOT OBTAIN START ADDRESS");
- }
+ Q_UNUSED(response);
#else
+ if (response.resultClass == GdbResultDone) {
// [some leading stdout here]
// stdout:&" Entry point: 0x80831f0 0x08048134 - 0x08048147 is .interp\n"
// [some trailing stdout here]
@@ -1713,10 +1711,10 @@ void GdbEngine::handleStart(const GdbResultRecord &response)
} else {
debugMessage("PARSING START ADDRESS FAILED: " + msg);
}
-#endif
} else if (response.resultClass == GdbResultError) {
debugMessage("FETCHING START ADDRESS FAILED: " + response.toString());
}
+#endif
}
void GdbEngine::handleAttach()