Commit 5a73440b authored by hjk's avatar hjk
Browse files

debugger: fix gotoLocation() on Mac

Mac's "stopped" message does not come with location data.
parent 7e005752
......@@ -2296,12 +2296,21 @@ void GdbEngine::handleStackListFrames(const GdbResponse &response)
theDebuggerAction(ExpandStack)->setEnabled(canExpand);
manager()->stackHandler()->setFrames(stackFrames, canExpand);
if (topFrame != -1 && topFrame != 0
&& !theDebuggerBoolSetting(OperateByInstruction)) {
// For topFrame == -1 there is no frame at all, for topFrame == 0
// we already issued a 'gotoLocation' when reading the *stopped
// message. Also, when OperateByInstruction we always want to
// use frame #0.
#ifdef Q_OS_MAC
// Mac gdb does not add the location to the "stopped" message,
// so the early gotoLocation() was not triggered. Force it here.
bool jump = topFrame != -1
&& !theDebuggerBoolSetting(OperateByInstruction);
#else
// For topFrame == -1 there is no frame at all, for topFrame == 0
// we already issued a 'gotoLocation' when reading the *stopped
// message. Also, when OperateByInstruction we always want to
// use frame #0.
bool jump = topFrame != -1 && topFrame != 0
&& !theDebuggerBoolSetting(OperateByInstruction);
#endif
if (jump) {
const StackFrame &frame = manager()->stackHandler()->currentFrame();
qDebug() << "GOTO, 2nd try" << frame.toString() << topFrame;
gotoLocation(frame, true);
......
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