forked from qt-creator/qt-creator
debugger: implement basic support for gdb's 'return' command
Returning a value is not yet supported.
This commit is contained in:
@@ -1711,7 +1711,8 @@ unsigned GdbEngine::debuggerCapabilities() const
|
||||
| AutoDerefPointersCapability | DisassemblerCapability
|
||||
| RegisterCapability | ShowMemoryCapability
|
||||
| JumpToLineCapability | ReloadModuleCapability
|
||||
| ReloadModuleSymbolsCapability | BreakOnThrowAndCatchCapability;
|
||||
| ReloadModuleSymbolsCapability | BreakOnThrowAndCatchCapability
|
||||
| ReturnFromFunctionCapability;
|
||||
}
|
||||
|
||||
void GdbEngine::continueInferiorInternal()
|
||||
@@ -1902,6 +1903,21 @@ void GdbEngine::jumpToLineExec(const QString &fileName, int lineNumber)
|
||||
#endif
|
||||
}
|
||||
|
||||
void GdbEngine::returnExec()
|
||||
{
|
||||
QTC_ASSERT(state() == InferiorStopped, qDebug() << state());
|
||||
setTokenBarrier();
|
||||
setState(InferiorRunningRequested);
|
||||
showStatusMessage(tr("Immediate return from function requested..."), 5000);
|
||||
postCommand("-exec-finish", RunRequest, CB(handleExecReturn));
|
||||
}
|
||||
|
||||
void GdbEngine::handleExecReturn(const GdbResponse &response)
|
||||
{
|
||||
if (response.resultClass == GdbResultDone) {
|
||||
updateAll();
|
||||
}
|
||||
}
|
||||
/*!
|
||||
\fn void GdbEngine::setTokenBarrier()
|
||||
\brief Discard the results of all pending watch-updating commands.
|
||||
|
||||
@@ -296,10 +296,12 @@ private: ////////// Inferior Management //////////
|
||||
virtual void runToFunctionExec(const QString &functionName);
|
||||
// void handleExecRunToFunction(const GdbResponse &response);
|
||||
virtual void jumpToLineExec(const QString &fileName, int lineNumber);
|
||||
virtual void returnExec();
|
||||
|
||||
void handleExecContinue(const GdbResponse &response);
|
||||
void handleExecStep(const GdbResponse &response);
|
||||
void handleExecNext(const GdbResponse &response);
|
||||
void handleExecReturn(const GdbResponse &response);
|
||||
|
||||
qint64 inferiorPid() const { return m_manager->inferiorPid(); }
|
||||
void handleInferiorPidChanged(qint64 pid) { manager()->notifyInferiorPidChanged(pid); }
|
||||
|
||||
Reference in New Issue
Block a user