Skip to content

Commit

Permalink
Merge pull request #250 from epasveer/249-add-stack-viewer
Browse files Browse the repository at this point in the history
249 add stack viewer
  • Loading branch information
epasveer authored Oct 5, 2024
2 parents 860b2d4 + 1b2df9e commit d4ce14b
Show file tree
Hide file tree
Showing 15 changed files with 1,372 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Improved handling of \n \t and other escaped characters in gdb log window.
* Show breakpoint info as a tooltip if the breakpoint icon is clicked with
LMB and held down.
* Show stack as a hex dump, with options to view as short, int, long, ascii, ...

## [2.4] - 2024-03-18
* Changed main icon to a more license friendly one.
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ set(HEADER_FILES
SeerStackArgumentsBrowserWidget.h
SeerStackFramesBrowserWidget.h
SeerStackLocalsBrowserWidget.h
SeerStackDumpBrowserWidget.h
SeerStackDumpSettingsDialog.h
SeerStackManagerWidget.h
SeerThreadFramesBrowserWidget.h
SeerThreadIdsBrowserWidget.h
Expand Down Expand Up @@ -197,6 +199,8 @@ set(SOURCE_FILES
SeerStackArgumentsBrowserWidget.cpp
SeerStackFramesBrowserWidget.cpp
SeerStackLocalsBrowserWidget.cpp
SeerStackDumpBrowserWidget.cpp
SeerStackDumpSettingsDialog.cpp
SeerStackManagerWidget.cpp
SeerThreadFramesBrowserWidget.cpp
SeerThreadIdsBrowserWidget.cpp
Expand Down
18 changes: 16 additions & 2 deletions src/SeerGdbWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, stackManagerWidget->stackFramesBrowserWidget(), &SeerStackFramesBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, stackManagerWidget->stackLocalsBrowserWidget(), &SeerStackLocalsBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, stackManagerWidget->stackArgumentsBrowserWidget(), &SeerStackArgumentsBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, stackManagerWidget->stackDumpBrowserWidget(), &SeerStackDumpBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, stackManagerWidget, &SeerStackManagerWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, _breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, _watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::handleText);
Expand Down Expand Up @@ -235,6 +236,9 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
QObject::connect(stackManagerWidget->stackLocalsBrowserWidget(), &SeerStackLocalsBrowserWidget::addArrayVisualize, this, &SeerGdbWidget::handleGdbArrayAddExpression);
QObject::connect(stackManagerWidget->stackLocalsBrowserWidget(), &SeerStackLocalsBrowserWidget::addStructVisualize, this, &SeerGdbWidget::handleGdbVarAddExpression);
QObject::connect(stackManagerWidget->stackLocalsBrowserWidget(), &SeerStackLocalsBrowserWidget::refreshVariableTrackerValues, this, &SeerGdbWidget::handleGdbDataListExpressions);
QObject::connect(stackManagerWidget->stackDumpBrowserWidget(), &SeerStackDumpBrowserWidget::refreshStackPointer, this, &SeerGdbWidget::handleGdbDataEvaluateExpression);
QObject::connect(stackManagerWidget->stackDumpBrowserWidget(), &SeerStackDumpBrowserWidget::refreshStackDump, this, QOverload<int,QString,int,int>::of(&SeerGdbWidget::handleGdbMemoryEvaluateExpression));
QObject::connect(stackManagerWidget->stackDumpBrowserWidget(), &SeerStackDumpBrowserWidget::addMemoryVisualize, this, &SeerGdbWidget::handleGdbMemoryAddExpression);
QObject::connect(stackManagerWidget, &SeerStackManagerWidget::refreshThreadFrames, this, &SeerGdbWidget::handleGdbThreadListFrames);

QObject::connect(variableManagerWidget->variableTrackerBrowserWidget(), &SeerVariableTrackerBrowserWidget::refreshVariableTrackerValues, this, &SeerGdbWidget::handleGdbDataListExpressions);
Expand Down Expand Up @@ -324,6 +328,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget->stackFramesBrowserWidget(), &SeerStackFramesBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget->stackLocalsBrowserWidget(), &SeerStackLocalsBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget->stackArgumentsBrowserWidget(), &SeerStackArgumentsBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget->stackDumpBrowserWidget(), &SeerStackDumpBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, threadManagerWidget->threadIdsBrowserWidget(), &SeerThreadIdsBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, threadManagerWidget->adaTasksBrowserWidget(), &SeerAdaTasksBrowserWidget::handleStoppingPointReached);
Expand Down Expand Up @@ -2494,7 +2499,7 @@ void SeerGdbWidget::handleGdbMemoryAddExpression (QString expression) {
QObject::connect(_gdbMonitor, &GdbMonitor::astrixTextOutput, w, &SeerMemoryVisualizerWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, w, &SeerMemoryVisualizerWidget::handleText);
QObject::connect(w, &SeerMemoryVisualizerWidget::evaluateVariableExpression, this, &SeerGdbWidget::handleGdbDataEvaluateExpression);
QObject::connect(w, &SeerMemoryVisualizerWidget::evaluateMemoryExpression, this, &SeerGdbWidget::handleGdbMemoryEvaluateExpression);
QObject::connect(w, &SeerMemoryVisualizerWidget::evaluateMemoryExpression, this, QOverload<int,QString,int>::of(&SeerGdbWidget::handleGdbMemoryEvaluateExpression));
QObject::connect(w, &SeerMemoryVisualizerWidget::evaluateAsmExpression, this, &SeerGdbWidget::handleGdbAsmEvaluateExpression);

// Tell the visualizer what variable to use.
Expand Down Expand Up @@ -2580,7 +2585,7 @@ void SeerGdbWidget::handleGdbImageAddExpression (QString expression) {
QObject::connect(_gdbMonitor, &GdbMonitor::astrixTextOutput, w, &SeerImageVisualizerWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, w, &SeerImageVisualizerWidget::handleText);
QObject::connect(w, &SeerImageVisualizerWidget::evaluateVariableExpression, this, &SeerGdbWidget::handleGdbDataEvaluateExpression);
QObject::connect(w, &SeerImageVisualizerWidget::evaluateMemoryExpression, this, &SeerGdbWidget::handleGdbMemoryEvaluateExpression);
QObject::connect(w, &SeerImageVisualizerWidget::evaluateMemoryExpression, this, QOverload<int,QString,int>::of(&SeerGdbWidget::handleGdbMemoryEvaluateExpression));

// Tell the visualizer what variable to use.
w->setVariableName(expression);
Expand All @@ -2595,6 +2600,15 @@ void SeerGdbWidget::handleGdbMemoryEvaluateExpression (int expressionid, QString
handleGdbCommand(QString::number(expressionid) + "-data-read-memory-bytes " + address + " " + QString::number(count));
}

void SeerGdbWidget::handleGdbMemoryEvaluateExpression (int expressionid, QString address, int offset, int count) {

if (executableLaunchMode() == "") {
return;
}

handleGdbCommand(QString::number(expressionid) + "-data-read-memory-bytes -o " + QString::number(offset) + " " + address + " " + QString::number(count));
}

void SeerGdbWidget::handleGdbAsmEvaluateExpression (int expressionid, QString address, int count, int mode) {

// -data-disassemble -s $pc -e "$pc + 96" -- 2
Expand Down
1 change: 1 addition & 0 deletions src/SeerGdbWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
void handleGdbVarAddExpression (QString expression);
void handleGdbImageAddExpression (QString expression);
void handleGdbMemoryEvaluateExpression (int expressionid, QString address, int count);
void handleGdbMemoryEvaluateExpression (int expressionid, QString address, int offset, int count);
void handleGdbAsmEvaluateExpression (int expressionid, QString address, int count, int mode);
void handleGdbArrayEvaluateExpression (int expressionid, QString address, int count);
void handleGdbGetAssembly (QString address);
Expand Down
Loading

0 comments on commit d4ce14b

Please sign in to comment.