Add Help for Variable/Register browser.

This commit is contained in:
Ernie Pasveer
2022-09-25 11:32:08 -05:00
parent 51d1c686bc
commit a0734f9f88
7 changed files with 105 additions and 4 deletions
+1
View File
@@ -18,6 +18,7 @@
- (see gdb's schedule-multiple mode)
* Add Help to Thread/Process browser.
* Add Help to Stack Frame browser.
* Add Help to Variable/Register browser.
* Add Help to Struct Visualizer.
* Add RMB menu to progress indicator to select indicator type.
+2 -2
View File
@@ -27,7 +27,7 @@ SeerStackFramesBrowserWidget::SeerStackFramesBrowserWidget (QWidget* parent) : Q
stackTreeWidget->clear();
// Connect things.
QObject::connect(stackTreeWidget, &QTreeWidget::itemDoubleClicked, this, &SeerStackFramesBrowserWidget::handleItemDoubleClicked);
QObject::connect(stackTreeWidget, &QTreeWidget::itemClicked, this, &SeerStackFramesBrowserWidget::handleItemClicked);
QObject::connect(stackTreeWidget, &QTreeWidget::itemEntered, this, &SeerStackFramesBrowserWidget::handleItemEntered);
}
@@ -168,7 +168,7 @@ void SeerStackFramesBrowserWidget::refresh () {
emit refreshStackFrames();
}
void SeerStackFramesBrowserWidget::handleItemDoubleClicked (QTreeWidgetItem* item, int column) {
void SeerStackFramesBrowserWidget::handleItemClicked (QTreeWidgetItem* item, int column) {
Q_UNUSED(column);
+1 -1
View File
@@ -18,7 +18,7 @@ class SeerStackFramesBrowserWidget : public QWidget, protected Ui::SeerStackFram
void refresh ();
protected slots:
void handleItemDoubleClicked (QTreeWidgetItem* item, int column);
void handleItemClicked (QTreeWidgetItem* item, int column);
void handleItemEntered (QTreeWidgetItem* item, int column);
signals:
+21 -1
View File
@@ -1,4 +1,6 @@
#include "SeerVariableManagerWidget.h"
#include "SeerHelpPageWidget.h"
#include "QHContainerWidget.h"
#include <QtWidgets/QToolButton>
#include <QtGui/QIcon>
#include <QtCore/QDebug>
@@ -25,10 +27,21 @@ SeerVariableManagerWidget::SeerVariableManagerWidget (QWidget* parent) : QWidget
QToolButton* refreshToolButton = new QToolButton(tabWidget);
refreshToolButton->setIcon(QIcon(":/seer/resources/RelaxLightIcons/view-refresh.svg"));
refreshToolButton->setToolTip("Refresh the variable/register information.");
tabWidget->setCornerWidget(refreshToolButton, Qt::TopRightCorner);
QToolButton* helpToolButton = new QToolButton(tabWidget);
helpToolButton->setIcon(QIcon(":/seer/resources/RelaxLightIcons/help-about.svg"));
helpToolButton->setToolTip("Help on variable/register information.");
QHContainerWidget* hcontainer = new QHContainerWidget(this);
hcontainer->setSpacing(3);
hcontainer->addWidget(refreshToolButton);
hcontainer->addWidget(helpToolButton);
tabWidget->setCornerWidget(hcontainer, Qt::TopRightCorner);
// Connect things.
QObject::connect(refreshToolButton, &QToolButton::clicked, this, &SeerVariableManagerWidget::handleRefreshToolButtonClicked);
QObject::connect(helpToolButton, &QToolButton::clicked, this, &SeerVariableManagerWidget::handleHelpToolButtonClicked);
}
SeerVariableManagerWidget::~SeerVariableManagerWidget () {
@@ -52,3 +65,10 @@ void SeerVariableManagerWidget::handleRefreshToolButtonClicked () {
registerValuesBrowserWidget()->refresh();
}
void SeerVariableManagerWidget::handleHelpToolButtonClicked () {
SeerHelpPageWidget* help = new SeerHelpPageWidget;
help->loadFile(":/seer/resources/help/VariableRegisterInfoBrowser.md");
help->show();
}
+1
View File
@@ -24,6 +24,7 @@ class SeerVariableManagerWidget : public QWidget, protected Ui::SeerVariableMana
public slots:
private slots:
void handleRefreshToolButtonClicked ();
void handleHelpToolButtonClicked ();
private:
SeerVariableTrackerBrowserWidget* _variableTrackerBrowserWidget;
+1
View File
@@ -53,6 +53,7 @@
<file>resources/help/ThreadProcessInfoBrowser.md</file>
<file>resources/help/StructVisualizer.md</file>
<file>resources/help/StackInfoBrowser.md</file>
<file>resources/help/VariableRegisterInfoBrowser.md</file>
</qresource>
</RCC>
@@ -0,0 +1,78 @@
## Variable/Register Info Browser
### Introduction
The Variable/Register Info browser is a simple, but quick, method of viewing the values of the program's variables.
Seer presents this information in three tabs:
* Logger
* Tracker
* Registers
### Logger
The logger is a simple method for printing the value of a variable. There is an entry field to manually enter the name of the variable. The variable must be part of the active stack frame, as selected by the Stack Info browser.
This information is shown for each variable.
```
Column Description
--------------- ----------------------------------------------
Timestamp When the variable was logged.
Name The name of the variable.
Value The value of the variable.
```
The easiest method for logging a variable is to double-click the variable text in the code editor. When doing this, a key modifier (shift and/or ctrl) can be used to prepend a '*' and/or '&' to the variable. This will better handle pointers and references.
```
Double-Click
Modifier Description Example
------------ ------------------------------------ -----------------------
None No modifier is prepended to variable 'argc'
Shift Key Prepend '&' to variable '&argc'
Ctrl Key Prepend '*' to variable '*argc'
Ctrl+Shift Prepend '*&' to variable '*&argc'
```
There are buttons to clear some or all entries in the logger.
### Tracker
The tracker is a method to watch several variables at a time. Manually enter a list of variable names. Their values will be updated in the Logger display at each stopping point (after a 'step' or 'next' or a breakpoint) is reached.
The variable must be part of the active stack frame, as selected by the Stack Info browser.
There are buttons to clear some or all variables in the tracker.
### Registers
Registers is a view of the program's register values. The register values are updated at each stopping point (after a 'step' or 'next' or a breakpoint) is reached.
This information is shown for each register.
```
Column Description
--------------- ----------------------------------------------
Name The name of the register.
Value The value of the register.
```
The register value can be printed in multiple formats.
```
Format Description
--------------- ------------------------------------------------------------
Natural Print using a format that's best for the register's purpose.
Hex Print in hex.
Octal Print in octal.
Binary Print in binary.
Decimal Print in decimal.
Raw Print in the raw form.
```
Register values can be modified. Double-click on a Value column for a register will allow the value to be edited and changed. Using a RMB on a register will bring up a menu to change the register value as well. This second method can better handle resisters that have 'union' like properties (eg: xmm0 with xmm0.v8_bfloat16, xmm0.v4_float, etc...) where the register name needs to be modified slightly to include the 'union' field name.
### References
Consult these gdb references
1. [Link](https://sourceware.org/gdb/onlinedocs/gdb/Registers.html) Viewing/setting register values.