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.
sendCommand("-exec-arguments " + q->m_processArgs.join(" "));
#ifndef Q_OS_MAC
sendCommand("set auto-solib-add off");
sendCommand("-exec-arguments " + q->m_processArgs.join(" "));
#ifndef Q_OS_MAC
sendCommand("set auto-solib-add off");
sendCommand("info target", GdbStart);
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"
}
// set all to "pending"
void GdbEngine::handleStart(const GdbResultRecord &response)
{
void GdbEngine::handleStart(const GdbResultRecord &response)
{
- if (response.resultClass == GdbResultDone) {
- 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");
- }
+ if (response.resultClass == GdbResultDone) {
// [some leading stdout here]
// stdout:&" Entry point: 0x80831f0 0x08048134 - 0x08048147 is .interp\n"
// [some trailing stdout here]
// [some leading stdout here]
// stdout:&" Entry point: 0x80831f0 0x08048134 - 0x08048147 is .interp\n"
// [some trailing stdout here]
} else {
debugMessage("PARSING START ADDRESS FAILED: " + msg);
}
} else {
debugMessage("PARSING START ADDRESS FAILED: " + msg);
}
} else if (response.resultClass == GdbResultError) {
debugMessage("FETCHING START ADDRESS FAILED: " + response.toString());
}
} else if (response.resultClass == GdbResultError) {
debugMessage("FETCHING START ADDRESS FAILED: " + response.toString());
}
}
void GdbEngine::handleAttach()
}
void GdbEngine::handleAttach()