Commit 82422c46 authored by hjk's avatar hjk
Browse files

debugger: don't retrieve the stack if we know we will continue stepping

parent 16b5d20a
...@@ -191,6 +191,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters) ...@@ -191,6 +191,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
m_pendingWatchRequests = 0; m_pendingWatchRequests = 0;
m_pendingBreakpointRequests = 0; m_pendingBreakpointRequests = 0;
m_commandsDoneCallback = 0; m_commandsDoneCallback = 0;
m_stackNeeded = false;
invalidateSourcesList(); invalidateSourcesList();
m_gdbAdapter = createAdapter(); m_gdbAdapter = createAdapter();
...@@ -1432,24 +1433,33 @@ void GdbEngine::handleStop1(const GdbMi &data) ...@@ -1432,24 +1433,33 @@ void GdbEngine::handleStop1(const GdbMi &data)
showStatusMessage(reasontr); showStatusMessage(reasontr);
} }
// // Let the event loop run before deciding whether to update the stack.
// Stack m_stackNeeded = true; // setTokenBarrier() might reset this.
// m_currentThreadId = data.findChild("thread-id").data().toInt();
QTimer::singleShot(0, this, SLOT(handleStop2()));
}
void GdbEngine::handleStop2()
{
// We are already continuing.
if (!m_stackNeeded)
return;
reloadStack(false); // Will trigger register reload. reloadStack(false); // Will trigger register reload.
if (supportsThreads()) { if (supportsThreads()) {
int currentId = data.findChild("thread-id").data().toInt();
if (m_gdbAdapter->isTrkAdapter()) { if (m_gdbAdapter->isTrkAdapter()) {
m_gdbAdapter->trkReloadThreads(); m_gdbAdapter->trkReloadThreads();
} else if (m_isMacGdb) { } else if (m_isMacGdb) {
postCommand("-thread-list-ids", Discardable, postCommand("-thread-list-ids", Discardable,
CB(handleThreadListIds), currentId); CB(handleThreadListIds), m_currentThreadId);
} else { } else {
// This is only available in gdb 7.1+. // This is only available in gdb 7.1+.
postCommand("-thread-info", Discardable, postCommand("-thread-info", Discardable,
CB(handleThreadInfo), currentId); CB(handleThreadInfo), m_currentThreadId);
} }
} }
} }
void GdbEngine::handleInfoProc(const GdbResponse &response) void GdbEngine::handleInfoProc(const GdbResponse &response)
...@@ -2012,6 +2022,7 @@ void GdbEngine::setTokenBarrier() ...@@ -2012,6 +2022,7 @@ void GdbEngine::setTokenBarrier()
if (debuggerCore()->boolSetting(LogTimeStamps)) if (debuggerCore()->boolSetting(LogTimeStamps))
showMessage(LogWindow::logTimeStamp(), LogMiscInput); showMessage(LogWindow::logTimeStamp(), LogMiscInput);
m_oldestAcceptableToken = currentToken(); m_oldestAcceptableToken = currentToken();
m_stackNeeded = false;
} }
......
...@@ -284,6 +284,7 @@ private: ////////// Gdb Output, State & Capability Handling ////////// ...@@ -284,6 +284,7 @@ private: ////////// Gdb Output, State & Capability Handling //////////
void handleStop0(const GdbMi &data); void handleStop0(const GdbMi &data);
void handleStop1(const GdbResponse &response); void handleStop1(const GdbResponse &response);
void handleStop1(const GdbMi &data); void handleStop1(const GdbMi &data);
Q_SLOT void handleStop2();
StackFrame parseStackFrame(const GdbMi &mi, int level); StackFrame parseStackFrame(const GdbMi &mi, int level);
void resetCommandQueue(); void resetCommandQueue();
...@@ -537,6 +538,10 @@ private: ////////// View & Data Stuff ////////// ...@@ -537,6 +538,10 @@ private: ////////// View & Data Stuff //////////
QString m_toolTipExpression; QString m_toolTipExpression;
QPoint m_toolTipPos; QPoint m_toolTipPos;
// For short-circuiting stack and thread list evaluation.
bool m_stackNeeded;
int m_currentThreadId;
// HACK: // HACK:
StackFrame m_targetFrame; StackFrame m_targetFrame;
}; };
......
Supports Markdown
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