work save

This commit is contained in:
Roy Qu 2024-03-10 12:57:50 +08:00
parent b359004f95
commit b83c45782b
4 changed files with 24 additions and 4 deletions

View File

@ -692,6 +692,12 @@ void Debugger::evalExpression(const QString &expression)
mClient->evalExpression(expression); mClient->evalExpression(expression);
} }
void Debugger::selectFrame(PTrace trace)
{
if (mClient)
mClient->selectFrame(trace);
}
void Debugger::refreshFrame() void Debugger::refreshFrame()
{ {
if (mClient) { if (mClient) {
@ -699,6 +705,12 @@ void Debugger::refreshFrame()
} }
} }
void Debugger::refreshStackVariables()
{
if (mClient)
mClient->refreshStackVariables();
}
void Debugger::refreshRegisters() void Debugger::refreshRegisters()
{ {
if (mClient) if (mClient)

View File

@ -349,11 +349,13 @@ public:
void sendAllWatchVarsToDebugger(); void sendAllWatchVarsToDebugger();
PWatchVar findWatchVar(const QString& expression); PWatchVar findWatchVar(const QString& expression);
PWatchVar watchVarAt(const QModelIndex& index); PWatchVar watchVarAt(const QModelIndex& index);
void refreshVars(); void refreshWatchVars();
void readMemory(const QString& startAddress, int rows, int cols); void readMemory(const QString& startAddress, int rows, int cols);
void evalExpression(const QString& expression); void evalExpression(const QString& expression);
void selectFrame(PTrace trace);
void refreshFrame(); void refreshFrame();
void refreshStackVariables();
void refreshRegisters(); void refreshRegisters();
void disassembleCurrentFrame(bool blendMode); void disassembleCurrentFrame(bool blendMode);
void setDisassemblyLanguage(bool isIntel); void setDisassemblyLanguage(bool isIntel);
@ -412,7 +414,6 @@ private slots:
void cleanUpReader(); void cleanUpReader();
void updateRegisterNames(const QStringList& registerNames); void updateRegisterNames(const QStringList& registerNames);
void updateRegisterValues(const QHash<int,QString>& values); void updateRegisterValues(const QHash<int,QString>& values);
void refreshWatchVars();
void fetchVarChildren(const QString& varName); void fetchVarChildren(const QString& varName);
private: private:
bool mExecuting; bool mExecuting;
@ -535,6 +536,7 @@ public:
virtual void evalExpression(const QString& expression) = 0; virtual void evalExpression(const QString& expression) = 0;
virtual void selectFrame(PTrace trace) = 0;
virtual void refreshFrame() = 0; virtual void refreshFrame() = 0;
virtual void refreshRegisters() = 0; virtual void refreshRegisters() = 0;
virtual void disassembleCurrentFrame(bool blendMode) = 0; virtual void disassembleCurrentFrame(bool blendMode) = 0;

View File

@ -1025,6 +1025,12 @@ void GDBMIDebuggerClient::evalExpression(const QString &expression)
postCommand("-data-evaluate-expression", expression); postCommand("-data-evaluate-expression", expression);
} }
void GDBMIDebuggerClient::selectFrame(PTrace trace)
{
if (trace)
postCommand("-stack-select-frame", QString("%1").arg(trace->level));
}
void GDBMIDebuggerClient::refreshFrame() void GDBMIDebuggerClient::refreshFrame()
{ {
postCommand("-stack-info-frame", ""); postCommand("-stack-info-frame", "");

View File

@ -8771,8 +8771,8 @@ void MainWindow::switchCurrentStackTrace(int idx)
e->setCaretPositionAndActivate(trace->line,1); e->setCaretPositionAndActivate(trace->line,1);
} }
mDebugger->sendCommand("-stack-select-frame", QString("%1").arg(trace->level)); mDebugger->sendCommand("-stack-select-frame", QString("%1").arg(trace->level));
mDebugger->sendCommand("-stack-list-variables", "--all-values"); mDebugger->refreshStackVariables();
mDebugger->sendCommand("-var-update", "--all-values *"); mDebugger->refreshWatchVars();
if (this->mCPUDialog) { if (this->mCPUDialog) {
this->mCPUDialog->updateInfo(); this->mCPUDialog->updateInfo();
} }