mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Initial work on a GDB monitor widget.
This commit is contained in:
@@ -111,6 +111,7 @@ set(HEADER_FILES
|
||||
SeerStructVisualizerWidget.h
|
||||
SeerVarVisualizerWidget.h
|
||||
SeerImageVisualizerWidget.h
|
||||
SeerMonitorVisualizerWidget.h
|
||||
SeerRegisterValuesBrowserWidget.h
|
||||
SeerRegisterEditValueDialog.h
|
||||
SeerRegisterProfileDialog.h
|
||||
@@ -224,6 +225,7 @@ set(SOURCE_FILES
|
||||
SeerStructVisualizerWidget.cpp
|
||||
SeerVarVisualizerWidget.cpp
|
||||
SeerImageVisualizerWidget.cpp
|
||||
SeerMonitorVisualizerWidget.cpp
|
||||
SeerRegisterValuesBrowserWidget.cpp
|
||||
SeerRegisterEditValueDialog.cpp
|
||||
SeerRegisterProfileDialog.cpp
|
||||
|
||||
+29
-29
@@ -34,50 +34,50 @@ class QHistoryLineEdit : public QLineEdit {
|
||||
QHistoryLineEdit(const QString& contents, QWidget* parent = 0);
|
||||
QHistoryLineEdit(QWidget* parent = 0);
|
||||
|
||||
void enableReturnPressedOnClear ();
|
||||
void enableReturnPressedOnClear ();
|
||||
|
||||
int lineCount () const;
|
||||
int lineCount () const;
|
||||
|
||||
void setHistory (const QStringList& history);
|
||||
QStringList history() const;
|
||||
void setHistory (const QStringList& history);
|
||||
QStringList history () const;
|
||||
|
||||
void setWordCompleter (QCompleter* completer);
|
||||
void setWordCompleterPrefix (const QString& prefix);
|
||||
void setWordCompleterMinChars (int minChars);
|
||||
void setWordCompleterMaxSuggestions (int max);
|
||||
void setWordCompleter (QCompleter* completer);
|
||||
void setWordCompleterPrefix (const QString& prefix);
|
||||
void setWordCompleterMinChars (int minChars);
|
||||
void setWordCompleterMaxSuggestions (int max);
|
||||
|
||||
public slots:
|
||||
void execute ();
|
||||
void execute ();
|
||||
|
||||
signals:
|
||||
void lineExecuted (QString text);
|
||||
void lostFocus ();
|
||||
void gainedFocus ();
|
||||
void escapePressed ();
|
||||
void lineExecuted (QString text);
|
||||
void lostFocus ();
|
||||
void gainedFocus ();
|
||||
void escapePressed ();
|
||||
|
||||
protected:
|
||||
void keyPressEvent (QKeyEvent* event) Q_DECL_OVERRIDE;
|
||||
void wheelEvent (QWheelEvent* event) Q_DECL_OVERRIDE;
|
||||
void focusOutEvent (QFocusEvent* event) Q_DECL_OVERRIDE;
|
||||
void focusInEvent (QFocusEvent* event) Q_DECL_OVERRIDE;
|
||||
void keyPressEvent (QKeyEvent* event) Q_DECL_OVERRIDE;
|
||||
void wheelEvent (QWheelEvent* event) Q_DECL_OVERRIDE;
|
||||
void focusOutEvent (QFocusEvent* event) Q_DECL_OVERRIDE;
|
||||
void focusInEvent (QFocusEvent* event) Q_DECL_OVERRIDE;
|
||||
|
||||
void previousLine ();
|
||||
void nextLine ();
|
||||
void previousLine ();
|
||||
void nextLine ();
|
||||
|
||||
QString current_word () const;
|
||||
QString current_word () const;
|
||||
|
||||
private slots:
|
||||
void autoComplete (const QString& completion);
|
||||
void autoComplete (const QString& completion);
|
||||
|
||||
private:
|
||||
int _wordStart () const;
|
||||
int _wordStart () const;
|
||||
|
||||
int _currentLine;
|
||||
QStringList _lines;
|
||||
QString _unfinished;
|
||||
QCompleter* _completer;
|
||||
QString _completionPrefix;
|
||||
int _completionMinchars;
|
||||
int _completionMax;
|
||||
int _currentLine;
|
||||
QStringList _lines;
|
||||
QString _unfinished;
|
||||
QCompleter* _completer;
|
||||
QString _completionPrefix;
|
||||
int _completionMinchars;
|
||||
int _completionMax;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "SeerStructVisualizerWidget.h"
|
||||
#include "SeerVarVisualizerWidget.h"
|
||||
#include "SeerImageVisualizerWidget.h"
|
||||
#include "SeerMonitorVisualizerWidget.h"
|
||||
#include "SeerHelpPageDialog.h"
|
||||
#include "SeerUtl.h"
|
||||
#include "QHContainerWidget.h"
|
||||
@@ -864,6 +865,10 @@ void SeerGdbWidget::handleGdbCommands (const QStringList& commands) {
|
||||
}
|
||||
}
|
||||
|
||||
void SeerGdbWidget::handleGdbMonitorCommand (int id, const QString& command) {
|
||||
handleGdbCommand(QString::number(id)+"-monitor-exec " + command);
|
||||
}
|
||||
|
||||
void SeerGdbWidget::handleGdbExit () {
|
||||
|
||||
handleGdbCommand("-gdb-exit");
|
||||
@@ -3051,6 +3056,21 @@ void SeerGdbWidget::handleGdbImageVisualizer () {
|
||||
handleGdbImageAddExpression("");
|
||||
}
|
||||
|
||||
void SeerGdbWidget::handleGdbMonitorVisualizer () {
|
||||
|
||||
if (executableLaunchMode() == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
SeerMonitorVisualizerWidget* w = new SeerMonitorVisualizerWidget(0);
|
||||
w->show();
|
||||
|
||||
// Connect things.
|
||||
QObject::connect(_gdbMonitor, &GdbMonitor::astrixTextOutput, w, &SeerMonitorVisualizerWidget::handleText);
|
||||
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, w, &SeerMonitorVisualizerWidget::handleText);
|
||||
QObject::connect(w, &SeerMonitorVisualizerWidget::executeGdbMonitorCommand, this, &SeerGdbWidget::handleGdbMonitorCommand);
|
||||
}
|
||||
|
||||
void SeerGdbWidget::handleSplitterMoved (int pos, int index) {
|
||||
|
||||
Q_UNUSED(pos);
|
||||
|
||||
@@ -216,6 +216,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
||||
void handleManualCommandExecute (QString command);
|
||||
void handleGdbCommand (const QString& command, bool ignoreErrors=false);
|
||||
void handleGdbCommands (const QStringList& commands);
|
||||
void handleGdbMonitorCommand (int id, const QString& command);
|
||||
void handleGdbExit ();
|
||||
void handleGdbRunExecutable (const QString& breakMode, bool loadSessionBreakpoints);
|
||||
void handleGdbAttachExecutable (bool loadSessionBreakpoints);
|
||||
@@ -356,6 +357,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
||||
void handleGdbStructVisualizer ();
|
||||
void handleGdbVarVisualizer ();
|
||||
void handleGdbImageVisualizer ();
|
||||
void handleGdbMonitorVisualizer ();
|
||||
void handleSplitterMoved (int pos, int index);
|
||||
void handleGdbAssemblyDisassemblyFlavor ();
|
||||
void handleGdbAssemblySymbolDemangling ();
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="textEditor">
|
||||
<property name="placeholderText">
|
||||
<string>Insert gdb commands on multiple lines</string>
|
||||
<string>Insert commands on multiple lines</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -28,27 +28,31 @@ SeerMacroToolButton::SeerMacroToolButton(QWidget* parent) : QToolButton(parent)
|
||||
connect(_holdTimer, &QTimer::timeout, this, &SeerMacroToolButton::handleHoldTriggered);
|
||||
}
|
||||
|
||||
void SeerMacroToolButton::setMacroName (const QString& name) {
|
||||
void SeerMacroToolButton::setMacroName (const QString& name, const QString& context) {
|
||||
|
||||
// Set the macro name. If it's "", nullify our state.
|
||||
_macroName = name;
|
||||
_macroName = name;
|
||||
_macroContext = context;
|
||||
|
||||
if (_macroName == "") {
|
||||
_macroContext = "";
|
||||
_macroFileName = "";
|
||||
return;
|
||||
}
|
||||
|
||||
// Add combination shortcut for re-open closed file (Ctrl + Shift + T)
|
||||
QShortcut* shortcut = new QShortcut(QKeySequence(QString("Ctrl+Shift+")+_macroName[1]), this);
|
||||
if (macroContext() == "") {
|
||||
QShortcut* shortcut = new QShortcut(QKeySequence(QString("Ctrl+Shift+")+_macroName[1]), this);
|
||||
|
||||
QObject::connect(shortcut, &QShortcut::activated, this, &QToolButton::click);
|
||||
QObject::connect(shortcut, &QShortcut::activated, this, &QToolButton::click);
|
||||
}
|
||||
|
||||
// Create the macro filename where the macro is to be written.
|
||||
QSettings settings;
|
||||
|
||||
QFileInfo fileInfo(settings.fileName());
|
||||
|
||||
_macroFileName = fileInfo.absolutePath() + "/macros/" + _macroName + ".macro";
|
||||
_macroFileName = fileInfo.absolutePath() + "/macros/" + macroContext() + "/" + _macroName + ".macro";
|
||||
|
||||
// Read settings now we have a proper macro name.
|
||||
readMacro();
|
||||
@@ -59,6 +63,11 @@ const QString& SeerMacroToolButton::macroName () const {
|
||||
return _macroName;
|
||||
}
|
||||
|
||||
const QString& SeerMacroToolButton::macroContext () const {
|
||||
|
||||
return _macroContext;
|
||||
}
|
||||
|
||||
const QString& SeerMacroToolButton::macroFileName () const {
|
||||
|
||||
return _macroFileName;
|
||||
|
||||
@@ -15,8 +15,9 @@ class SeerMacroToolButton : public QToolButton {
|
||||
public:
|
||||
explicit SeerMacroToolButton(QWidget* parent = nullptr);
|
||||
|
||||
void setMacroName (const QString& name);
|
||||
void setMacroName (const QString& name, const QString& context = "");
|
||||
const QString& macroName () const;
|
||||
const QString& macroContext () const;
|
||||
const QString& macroFileName () const;
|
||||
|
||||
void setCommands (const QStringList& commands);
|
||||
@@ -39,6 +40,7 @@ class SeerMacroToolButton : public QToolButton {
|
||||
QTimer* _holdTimer;
|
||||
QMenu* _menu;
|
||||
QPoint _pressPos;
|
||||
QString _macroContext;
|
||||
QString _macroName;
|
||||
QString _macroFileName;
|
||||
QStringList _commands;
|
||||
|
||||
+14
-6
@@ -104,13 +104,14 @@ SeerMainWindow::SeerMainWindow(QWidget* parent) : QMainWindow(parent) {
|
||||
|
||||
// Set up Visualizer menu.
|
||||
QMenu* menuVisualizer = new QMenu(this);
|
||||
QAction* visualizerMemoryAction = menuVisualizer->addAction("Memory");
|
||||
QAction* visualizerMemoryAction = menuVisualizer->addAction("Memory");
|
||||
menuVisualizer->addSeparator();
|
||||
QAction* visualizerArrayAction = menuVisualizer->addAction("Array");
|
||||
QAction* visualizerMatrixAction = menuVisualizer->addAction("Matrix");
|
||||
QAction* visualizerVarAction = menuVisualizer->addAction("Struct");
|
||||
QAction* visualizerStructAction = menuVisualizer->addAction("Basic Struct");
|
||||
QAction* visualizerImageAction = menuVisualizer->addAction("Image");
|
||||
QAction* visualizerArrayAction = menuVisualizer->addAction("Array");
|
||||
QAction* visualizerMatrixAction = menuVisualizer->addAction("Matrix");
|
||||
QAction* visualizerVarAction = menuVisualizer->addAction("Struct");
|
||||
QAction* visualizerStructAction = menuVisualizer->addAction("Basic Struct");
|
||||
QAction* visualizerImageAction = menuVisualizer->addAction("Image");
|
||||
QAction* visualizerGdbMonitorAction = menuVisualizer->addAction("GDB Monitor");
|
||||
|
||||
actionVisualizers->setMenu(menuVisualizer);
|
||||
|
||||
@@ -138,6 +139,7 @@ SeerMainWindow::SeerMainWindow(QWidget* parent) : QMainWindow(parent) {
|
||||
QObject::connect(actionViewStructVisualizer, &QAction::triggered, this, &SeerMainWindow::handleViewVarVisualizer);
|
||||
QObject::connect(actionViewBasicStructVisualizer, &QAction::triggered, this, &SeerMainWindow::handleViewStructVisualizer);
|
||||
QObject::connect(actionViewImageVisualizer, &QAction::triggered, this, &SeerMainWindow::handleViewImageVisualizer);
|
||||
QObject::connect(actionViewGdbMonitorVisualizer, &QAction::triggered, this, &SeerMainWindow::handleViewGdbMonitorVisualizer);
|
||||
QObject::connect(actionViewAssembly, &QAction::triggered, this, &SeerMainWindow::handleViewAssembly);
|
||||
QObject::connect(actionConsoleAttached, &QAction::triggered, this, &SeerMainWindow::handleViewConsoleAttached);
|
||||
QObject::connect(actionConsoleDetached, &QAction::triggered, this, &SeerMainWindow::handleViewConsoleDetached);
|
||||
@@ -197,6 +199,7 @@ SeerMainWindow::SeerMainWindow(QWidget* parent) : QMainWindow(parent) {
|
||||
QObject::connect(visualizerVarAction, &QAction::triggered, gdbWidget, &SeerGdbWidget::handleGdbVarVisualizer);
|
||||
QObject::connect(visualizerStructAction, &QAction::triggered, gdbWidget, &SeerGdbWidget::handleGdbStructVisualizer);
|
||||
QObject::connect(visualizerImageAction, &QAction::triggered, gdbWidget, &SeerGdbWidget::handleGdbImageVisualizer);
|
||||
QObject::connect(visualizerGdbMonitorAction, &QAction::triggered, gdbWidget, &SeerGdbWidget::handleGdbMonitorVisualizer);
|
||||
|
||||
QObject::connect(gdbWidget->gdbMonitor(), &GdbMonitor::astrixTextOutput, runStatus, &SeerRunStatusIndicator::handleText);
|
||||
QObject::connect(gdbWidget->gdbMonitor(), &GdbMonitor::equalTextOutput, runStatus, &SeerRunStatusIndicator::handleText);
|
||||
@@ -707,6 +710,11 @@ void SeerMainWindow::handleViewImageVisualizer () {
|
||||
gdbWidget->handleGdbImageVisualizer();
|
||||
}
|
||||
|
||||
void SeerMainWindow::handleViewGdbMonitorVisualizer () {
|
||||
|
||||
gdbWidget->handleGdbMonitorVisualizer();
|
||||
}
|
||||
|
||||
void SeerMainWindow::handleViewAssembly () {
|
||||
|
||||
gdbWidget->editorManager()->showAssembly();
|
||||
|
||||
@@ -89,6 +89,7 @@ class SeerMainWindow : public QMainWindow, protected Ui::SeerMainWindowForm {
|
||||
void handleViewStructVisualizer ();
|
||||
void handleViewVarVisualizer ();
|
||||
void handleViewImageVisualizer ();
|
||||
void handleViewGdbMonitorVisualizer ();
|
||||
void handleViewAssembly ();
|
||||
void handleViewAssemblyShown (bool shown);
|
||||
void handleViewConsoleAttached ();
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<addaction name="actionViewStructVisualizer"/>
|
||||
<addaction name="actionViewBasicStructVisualizer"/>
|
||||
<addaction name="actionViewImageVisualizer"/>
|
||||
<addaction name="actionViewGdbMonitorVisualizer"/>
|
||||
<addaction name="actionViewAssembly"/>
|
||||
<addaction name="menuConsole"/>
|
||||
<addaction name="menuStyles"/>
|
||||
@@ -813,6 +814,15 @@
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewGdbMonitorVisualizer">
|
||||
<property name="icon">
|
||||
<iconset resource="resource.qrc">
|
||||
<normaloff>:/seer/resources/thenounproject/memory.svg</normaloff>:/seer/resources/thenounproject/memory.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>GDB Monitor Visualizer</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
// SPDX-FileCopyrightText: 2026 Ernie Pasveer <epasveer@att.net>
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "SeerMonitorVisualizerWidget.h"
|
||||
#include "SeerHelpPageDialog.h"
|
||||
#include "SeerUtl.h"
|
||||
#include <QtPrintSupport/QPrinter>
|
||||
#include <QtPrintSupport/QPrintDialog>
|
||||
#include <QtGui/QFont>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
SeerMonitorVisualizerWidget::SeerMonitorVisualizerWidget (QWidget* parent) : QWidget(parent) {
|
||||
|
||||
// Init variables.
|
||||
_monitorId = Seer::createID(); // Create id for gdb monitor messages.
|
||||
|
||||
// Set up UI.
|
||||
setupUi(this);
|
||||
|
||||
// Setup the widgets
|
||||
setWindowIcon(QIcon(":/seer/resources/icons/hicolor/64x64/seergdb.png"));
|
||||
setWindowTitle("Seer - GDB Monitor Visualizer");
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
m1ToolButton->setMacroName("M1", "gdbmonitor");
|
||||
m2ToolButton->setMacroName("M2", "gdbmonitor");
|
||||
m3ToolButton->setMacroName("M3", "gdbmonitor");
|
||||
m4ToolButton->setMacroName("M4", "gdbmonitor");
|
||||
m5ToolButton->setMacroName("M5", "gdbmonitor");
|
||||
m6ToolButton->setMacroName("M6", "gdbmonitor");
|
||||
m7ToolButton->setMacroName("M7", "gdbmonitor");
|
||||
m8ToolButton->setMacroName("M8", "gdbmonitor");
|
||||
m9ToolButton->setMacroName("M9", "gdbmonitor");
|
||||
m0ToolButton->setMacroName("M0", "gdbmonitor");
|
||||
|
||||
// Default font.
|
||||
QFont font;
|
||||
font.setFamily("monospace");
|
||||
font.setStyleHint(QFont::Monospace);
|
||||
font.setFixedPitch(true);
|
||||
|
||||
// Set the widget's font.
|
||||
QTextCharFormat format = textEdit->currentCharFormat();
|
||||
format.setFont(font);
|
||||
textEdit->setCurrentCharFormat(format);
|
||||
textEdit->setFont(font);
|
||||
|
||||
// Connect things.
|
||||
QObject::connect(monitorCommandLineEdit, &QLineEdit::returnPressed, this, &SeerMonitorVisualizerWidget::handleCommandLineEdit);
|
||||
QObject::connect(clearToolButton, &QToolButton::clicked, this, &SeerMonitorVisualizerWidget::handleClearButton);
|
||||
QObject::connect(printToolButton, &QToolButton::clicked, this, &SeerMonitorVisualizerWidget::handlePrintButton);
|
||||
QObject::connect(helpToolButton, &QToolButton::clicked, this, &SeerMonitorVisualizerWidget::handleHelpButton);
|
||||
QObject::connect(macroButtonGroup, &QButtonGroup::buttonClicked, this, &SeerMonitorVisualizerWidget::handleMacroToolButtonClicked);
|
||||
|
||||
// Restore window settings.
|
||||
readSettings();
|
||||
}
|
||||
|
||||
SeerMonitorVisualizerWidget::~SeerMonitorVisualizerWidget () {
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::handleText (const QString& text) {
|
||||
qDebug() << text;
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::handleCommandLineEdit () {
|
||||
|
||||
QString command = monitorCommandLineEdit->text();
|
||||
|
||||
monitorCommandLineEdit->clear();
|
||||
|
||||
emit executeGdbMonitorCommand(_monitorId, command);
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::handleClearButton () {
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::handlePrintButton () {
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::handleHelpButton () {
|
||||
|
||||
SeerHelpPageDialog* help = new SeerHelpPageDialog;
|
||||
help->loadFile(":/seer/resources/help/ArrayVisualizer.md");
|
||||
help->show();
|
||||
help->raise();
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::handleMacroToolButtonClicked (QAbstractButton* button) {
|
||||
|
||||
if (button == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
SeerMacroToolButton* tb = qobject_cast<SeerMacroToolButton*>(button);
|
||||
|
||||
for (auto& command : tb->commands()) {
|
||||
if (command == "") {
|
||||
continue;
|
||||
}
|
||||
|
||||
emit executeGdbMonitorCommand(_monitorId, command);
|
||||
}
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::writeSettings() {
|
||||
|
||||
QSettings settings;
|
||||
|
||||
settings.beginGroup("gdbmonitorvisualizerwindow"); {
|
||||
settings.setValue("size", size());
|
||||
} settings.endGroup();
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::readSettings() {
|
||||
|
||||
QSettings settings;
|
||||
|
||||
settings.beginGroup("gdbmonitorvisualizerwindow"); {
|
||||
resize(settings.value("size", QSize(800, 400)).toSize());
|
||||
} settings.endGroup();
|
||||
}
|
||||
|
||||
void SeerMonitorVisualizerWidget::resizeEvent (QResizeEvent* event) {
|
||||
|
||||
writeSettings();
|
||||
|
||||
QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// SPDX-FileCopyrightText: 2026 Ernie Pasveer <epasveer@att.net>
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
#include "ui_SeerMonitorVisualizerWidget.h"
|
||||
|
||||
class SeerMonitorVisualizerWidget : public QWidget, protected Ui::SeerMonitorVisualizerWidgetForm {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SeerMonitorVisualizerWidget (QWidget* parent = 0);
|
||||
~SeerMonitorVisualizerWidget ();
|
||||
|
||||
signals:
|
||||
void executeGdbMonitorCommand (int monitorid, QString command);
|
||||
|
||||
public slots:
|
||||
void handleText (const QString& text);
|
||||
|
||||
protected slots:
|
||||
void handleCommandLineEdit ();
|
||||
void handleClearButton ();
|
||||
void handlePrintButton ();
|
||||
void handleHelpButton ();
|
||||
void handleMacroToolButtonClicked (QAbstractButton* button);
|
||||
|
||||
protected:
|
||||
void writeSettings ();
|
||||
void readSettings ();
|
||||
void resizeEvent (QResizeEvent* event);
|
||||
|
||||
private:
|
||||
int _monitorId;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SeerMonitorVisualizerWidgetForm</class>
|
||||
<widget class="QWidget" name="SeerMonitorVisualizerWidgetForm">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>823</width>
|
||||
<height>634</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Seer - Gdb Monitor</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="textEdit">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>[output from gdb monitor]</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m1ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M1 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M1</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m2ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M2 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M2</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m3ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M3 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M3</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m4ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M4 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M4</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m5ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M5 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M5</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m6ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M6 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M6</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m7ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M7 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M7</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m8ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M8 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M8</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m9ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M9 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M9</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="SeerMacroToolButton" name="m0ToolButton">
|
||||
<property name="toolTip">
|
||||
<string>M0 macro. Click to execute. Hold down to edit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>M0</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">macroButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="monitorCommandLabel">
|
||||
<property name="text">
|
||||
<string>Monitor Command:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QHistoryLineEdit" name="monitorCommandLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>100</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Enter a GDB monitor command.</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="clearToolButton">
|
||||
<property name="toolTip">
|
||||
<string>Clear monitor output.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resource.qrc">
|
||||
<normaloff>:/seer/resources/RelaxLightIcons/edit-delete.svg</normaloff>:/seer/resources/RelaxLightIcons/edit-delete.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="printToolButton">
|
||||
<property name="toolTip">
|
||||
<string>Print the monitor contents.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resource.qrc">
|
||||
<normaloff>:/seer/resources/RelaxLightIcons/document-print.svg</normaloff>:/seer/resources/RelaxLightIcons/document-print.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="helpToolButton">
|
||||
<property name="toolTip">
|
||||
<string>Help for the GDB monitor.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resource.qrc">
|
||||
<normaloff>:/seer/resources/RelaxLightIcons/help-about.svg</normaloff>:/seer/resources/RelaxLightIcons/help-about.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>SeerMacroToolButton</class>
|
||||
<extends>QToolButton</extends>
|
||||
<header>SeerMacroToolButton.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QHistoryLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>QHistoryLineEdit.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>monitorCommandLineEdit</tabstop>
|
||||
<tabstop>m1ToolButton</tabstop>
|
||||
<tabstop>m2ToolButton</tabstop>
|
||||
<tabstop>m3ToolButton</tabstop>
|
||||
<tabstop>m4ToolButton</tabstop>
|
||||
<tabstop>m5ToolButton</tabstop>
|
||||
<tabstop>m6ToolButton</tabstop>
|
||||
<tabstop>m7ToolButton</tabstop>
|
||||
<tabstop>m8ToolButton</tabstop>
|
||||
<tabstop>m9ToolButton</tabstop>
|
||||
<tabstop>m0ToolButton</tabstop>
|
||||
<tabstop>clearToolButton</tabstop>
|
||||
<tabstop>printToolButton</tabstop>
|
||||
<tabstop>helpToolButton</tabstop>
|
||||
<tabstop>textEdit</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="macroButtonGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
@@ -92,6 +92,7 @@
|
||||
<file>resources/mi-python/MIObjectiveC.py</file>
|
||||
<file>resources/mi-python/MISignals.py</file>
|
||||
<file>resources/mi-python/MIStart.py</file>
|
||||
<file>resources/mi-python/MIMonitor.py</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# SPDX-FileCopyrightText: 2026 Ernie Pasveer <epasveer@att.net>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import re
|
||||
|
||||
#
|
||||
# Python MI command to support gdb's "start" commands.
|
||||
#
|
||||
|
||||
class MIMonitor(gdb.MICommand):
|
||||
"""
|
||||
Send a command to gdb's monitor.
|
||||
|
||||
-monitor-exec Rin a command in gdb's monitor.
|
||||
|
||||
See:
|
||||
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Server.html
|
||||
"""
|
||||
|
||||
def __init__(self, name, mode):
|
||||
self._mode = mode
|
||||
super(MIMonitor, self).__init__(name)
|
||||
|
||||
def invoke(self, argv):
|
||||
if self._mode == "exec":
|
||||
gdb.execute ("monitor " + " ".join(argv), to_string=True)
|
||||
return None
|
||||
else:
|
||||
raise gdb.GdbError("monitor: Invalid parameter: %s" % self._mode)
|
||||
|
||||
MIMonitor("-monitor-exec", "exec")
|
||||
|
||||
Reference in New Issue
Block a user