From 841cca2952bb17aeb8f63c18326c82d8bda8da05 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Tue, 28 Jul 2026 16:01:03 -0500 Subject: [PATCH] Cleaned up UI for OpenOCD debug tab. --- src/SeerDebugDialog.cpp | 12 +- src/SeerDebugDialog.h | 34 +- src/SeerDebugDialog.ui | 868 +++++++++++++++++----------------------- src/SeerGdbWidget.cpp | 12 +- src/SeerGdbWidget.h | 44 +- src/SeerMainWindow.cpp | 13 +- src/SeerMainWindow.h | 4 +- 7 files changed, 418 insertions(+), 569 deletions(-) diff --git a/src/SeerDebugDialog.cpp b/src/SeerDebugDialog.cpp index 5e990d2..46bc326 100644 --- a/src/SeerDebugDialog.cpp +++ b/src/SeerDebugDialog.cpp @@ -695,7 +695,7 @@ QJsonDocument SeerDebugDialog::makeJsonDoc() const { QJsonObject modeJson; // Main Tab modeJson["openocdExe"] = executableOpenOCDPathLineEdit->text(); - modeJson["openocdCommand"] = openOCDCommandLineEdit->toPlainText(); + modeJson["openocdOptions"] = openOCDOptionsLineEdit->toPlainText(); // Symbol File Tab modeJson["symbolFile"] = symbolFileLineEdit->text(); @@ -894,7 +894,7 @@ bool SeerDebugDialog::loadJsonDoc (const QJsonDocument& jsonDoc, const QString& if (openocdModeJson.isEmpty() == false) { // Main Tab executableOpenOCDPathLineEdit ->setText(openocdModeJson["openocdExe"].toString()); - openOCDCommandLineEdit ->setPlainText(openocdModeJson["openocdCommand"].toString()); + openOCDOptionsLineEdit ->setPlainText(openocdModeJson["openocdOptions"].toString()); // Symbol file Tab symbolFileLineEdit ->setText(openocdModeJson["symbolFile"].toString()); @@ -927,16 +927,16 @@ void SeerDebugDialog::setOpenocdExe(const QString& path) executableOpenOCDPathLineEdit->setText(path); } -const QString SeerDebugDialog::openocdCommand() +const QString SeerDebugDialog::openocdOptions() { - QString tmp = openOCDCommandLineEdit->toPlainText(); + QString tmp = openOCDOptionsLineEdit->toPlainText(); tmp.replace("\n", " "); return tmp; } -void SeerDebugDialog::setOpenocdCommand(const QString& command) +void SeerDebugDialog::setOpenocdOptions(const QString& options) { - openOCDCommandLineEdit->setPlainText(command); + openOCDOptionsLineEdit->setPlainText(options); } // ::Symbol Files diff --git a/src/SeerDebugDialog.h b/src/SeerDebugDialog.h index 07a33c5..dcbb82e 100644 --- a/src/SeerDebugDialog.h +++ b/src/SeerDebugDialog.h @@ -95,25 +95,25 @@ class SeerDebugDialog : public QDialog, protected Ui::SeerDebugDialogForm { // openocd get and set functions // ::Main - const QString openocdExe (); - void setOpenocdExe (const QString& path); - const QString openocdCommand (); - void setOpenocdCommand (const QString& command); + const QString openocdExe (); + void setOpenocdExe (const QString& path); + const QString openocdOptions (); + void setOpenocdOptions (const QString& options); // ::GDB Multiarch - const QString openocdGdbExe (); - void setOpenocdGdbExe (const QString& path); - const QString openocdGdbPort (); - void setOpenocdGdbPort (const QString& port); - const QString openocdGdbCommand (); - void setOpenocdGdbCommand (const QString& command); + const QString openocdGdbExe (); + void setOpenocdGdbExe (const QString& path); + const QString openocdGdbPort (); + void setOpenocdGdbPort (const QString& port); + const QString openocdGdbOptions (); + void setOpenocdGdbOptions (const QString& options); // ::Symbol Files - const QString symbolFile (); - void setSymbolFile (const QString& path); - const QString workingDirectory (); - void setWorkingDirectory (const QString& path); - bool hasLoadAddress (); - const QString loadAddress (); - void setLoadAddress (const QString& address); + const QString symbolFile (); + void setSymbolFile (const QString& path); + const QString workingDirectory (); + void setWorkingDirectory (const QString& path); + bool hasLoadAddress (); + const QString loadAddress (); + void setLoadAddress (const QString& address); protected slots: void handleExecutableNameToolButton (); diff --git a/src/SeerDebugDialog.ui b/src/SeerDebugDialog.ui index dfd4a97..85daf98 100644 --- a/src/SeerDebugDialog.ui +++ b/src/SeerDebugDialog.ui @@ -6,71 +6,15 @@ 0 0 - 758 + 940 1086 Select Executable to Debug - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset - - - - - - - - - - Working Directory - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - The working directory path to tell GDB. Default current directory. - - - The working directory path to tell GDB. Default current directory. - - - true - - - - - - - Open a dialog to select a path. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - - - - - - - - + + Executable Name @@ -128,7 +72,7 @@ - + Symbol File Name @@ -186,7 +130,53 @@ - + + + + + + + Working Directory + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + The working directory path to tell GDB. Default current directory. + + + The working directory path to tell GDB. Default current directory. + + + true + + + + + + + Open a dialog to select a path. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + + + + + @@ -197,8 +187,8 @@ Launch Method - - + + @@ -207,7 +197,7 @@ - 0 + 5 @@ -1065,7 +1055,7 @@ OpenOCD - + 0 @@ -1076,7 +1066,7 @@ - + @@ -1097,6 +1087,26 @@ + + + + + 0 + 0 + + + + Reset to default settings. + + + + + + + :/seer/resources/RelaxLightIcons/view-refresh.svg:/seer/resources/RelaxLightIcons/view-refresh.svg + + + @@ -1114,200 +1124,129 @@ - + - - - true + + + OpenOCD Executable path + + + + - + 0 0 - + - 16777215 - 45 + 24 + 23 20 - 0 + 30 - - + + + 30 + 30 + + + + OpenOCD path. + + + false + + + OpenOCD path. (eg: /usr/local/bin/openocd) + + + true + + + + + + + + 0 + 0 + + + + + 24 + 23 + + + + + 24 + 23 + + + + Open a dialog to select an executable. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + + + + 150 + 16777215 + + + + OpenOCD options Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - false - - - - - - OpenOCD Executable path - - - - - - - - 0 - 0 - - - - - 24 - 23 - - - - - 20 - 30 - - - - - 30 - 30 - - - - Specify OpenOCD. Eg: /usr/local/bin/openocd - - - false - - - Specify OpenOCD. Eg: /usr/local/bin/openocd - - - true - - - - - - - - 0 - 0 - - - - - 24 - 23 - - - - - 24 - 23 - - - - Open a dialog to select an executable. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - - - - - - - - 0 - 25 - + + + + + 0 + 0 + - - Default Setting + + OpenOCD adtional options + + + OpenOCD additional options. (eg: -f <path to>/jlink.cfg -f <path to>/bluepill.cfg) - - - - true - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - - - - - 150 - 16777215 - - - - OpenOCD command - - - - - - - OpenOCD commands - - - OpenOCD additional command. Eg: -f <path to>/jlink.cfg -f <path to>/bluepill.cfg - - - - - - - - - - Qt::Vertical - - - - 20 - 100 - - - - - + Symbol FIle - + @@ -1334,328 +1273,220 @@ - - - - - true + + + + + Symbol File Name - - - 0 - 0 - - - - - 16777215 - 45 - - - - - 20 - 0 - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - - - - Symbol File Name - - - - - - - - 0 - 0 - - - - - 24 - 23 - - - - - 20 - 30 - - - - - 30 - 30 - - - - Symbol File - - - false - - - false - - - Symbol File - - - true - - - - - - - - 0 - 0 - - - - - 24 - 23 - - - - - 24 - 23 - - - - Open a dialog to select an executable. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - - - - - - - true - + + - + 0 0 - + - 16777215 - 45 + 24 + 23 20 - 0 + 30 - - + + + 30 + 30 + - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + Symbol File - + false - - - - - Working Directory - - - - - - - - 0 - 0 - - - - - 24 - 23 - - - - - 20 - 30 - - - - - 30 - 30 - - - - Working Directory - - - false - - - Working Directory - - - true - - - - - - - - 0 - 0 - - - - - 24 - 23 - - - - - 24 - 23 - - - - Open a dialog to select an executable. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - - - + + false + + + Symbol File + + + true + - - - - true - + + - + 0 0 + + + 24 + 23 + + - 16777215 - 45 + 24 + 23 + + + + Open a dialog to select an executable. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + + + Working Directory + + + + + + + + 0 + 0 + + + + + 24 + 23 20 - 0 + 30 - - + + + 30 + 30 + - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + Working Directory - + false - - - - - - - - - - - - Load Address - - - - - - - - 0 - 0 - - - - - 24 - 23 - - - - - 20 - 30 - - - - - 30 - 30 - - - - Load Address - - - false - - - Load Address - - - true - - - - + + Working Directory + + + true + + + + + + + + 0 + 0 + + + + + 24 + 23 + + + + + 24 + 23 + + + + Open a dialog to select an executable. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + + + + + + + + + + Load Address + + + + + + + + 0 + 0 + + + + + 24 + 23 + + + + + 20 + 30 + + + + + 30 + 30 + + + + Load Address + + + false + + + Load Address + + + true + @@ -1668,7 +1499,7 @@ 20 - 40 + 126 @@ -1677,11 +1508,18 @@ + + + + Connect to an OpenOCD session. + + + - + @@ -1714,6 +1552,16 @@ + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset + + + executableNameGroupBox buttonBox diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index 853acfe..c68b1dd 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -3992,14 +3992,14 @@ void SeerGdbWidget::setOpenocdExe (const QString& path) _openocdExe = path; } -const QString& SeerGdbWidget::openocdCommand () +const QString& SeerGdbWidget::openocdOptions () { - return _openocdCommands; + return _openocdOptions; } -void SeerGdbWidget::setOpenocdCommand (const QString& command) +void SeerGdbWidget::setOpenocdOptions (const QString& options) { - _openocdCommands = command; + _openocdOptions = options; } // ::GDB Multiarch @@ -4099,11 +4099,11 @@ void SeerGdbWidget::handleGdbMultiarchOpenOCDExecutable () _openocdWidget->createOpenOCDConsole(commandLogsWidget->logsTabWidgetInstance()); // Start OpenOCD with the given path and command - bool foo = _openocdWidget->startOpenOCD(openocdExe(), openocdCommand()); + bool foo = _openocdWidget->startOpenOCD(openocdExe(), openocdOptions()); if (foo == false) { QMessageBox::warning(this, "Seer", QString("Unable to launch the OpenOCD program.\n\n") + - QString("'%1 %2'").arg(SeerGdbWidget::openocdExe()).arg(SeerGdbWidget::openocdCommand()) + "\n\n" + + QString("'%1 %2'").arg(SeerGdbWidget::openocdExe()).arg(SeerGdbWidget::openocdOptions()) + "\n\n" + QString("Please check your OpenOCD configuration."), QMessageBox::Ok); _openocdWidget->terminate(); diff --git a/src/SeerGdbWidget.h b/src/SeerGdbWidget.h index 6640df7..6193595 100644 --- a/src/SeerGdbWidget.h +++ b/src/SeerGdbWidget.h @@ -216,31 +216,31 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { // OpenOCD // ::Main - const QString& openocdExe (); - void setOpenocdExe (const QString& path); - const QString& openocdCommand (); - void setOpenocdCommand (const QString& command); + const QString& openocdExe (); + void setOpenocdExe (const QString& path); + const QString& openocdOptions (); + void setOpenocdOptions (const QString& options); // ::GDB Multiarch - const QString& openocdGdbExe (); - void setOpenocdGdbExe (const QString& path); - const QString& openocdGdbPort (); - void setOpenocdGdbPort (const QString& port); - const QString& openocdTelnetPort (); - void setOpenocdTelnetPort (const QString& port); - const QString& openocdGdbCommand (); - void setOpenocdGdbCommand (const QString& command); + const QString& openocdGdbExe (); + void setOpenocdGdbExe (const QString& path); + const QString& openocdGdbPort (); + void setOpenocdGdbPort (const QString& port); + const QString& openocdTelnetPort (); + void setOpenocdTelnetPort (const QString& port); + const QString& openocdGdbCommand (); + void setOpenocdGdbCommand (const QString& command); // ::Symbol Files - void setSymbolFile (const QString& file); - const QString& symbolFile (void); - void setLoadAddressEnabled (bool flag); - bool loadAddressEnabled (void); - void setLoadAddress (const QString& address); - const QString& loadAddress (void); - void setSourcePath (const QString& path); - const QString& sourcePath (void); + void setSymbolFile (const QString& file); + const QString& symbolFile (void); + void setLoadAddressEnabled (bool flag); + bool loadAddressEnabled (void); + void setLoadAddress (const QString& address); + const QString& loadAddress (void); + void setSourcePath (const QString& path); + const QString& sourcePath (void); - void handleGdbMultiarchOpenOCDExecutable (); + void handleGdbMultiarchOpenOCDExecutable (); public slots: void handleText (const QString& text); @@ -484,7 +484,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { QString _openocdRunningState; // OpenOCD QString _openocdExe; - QString _openocdCommands; + QString _openocdOptions; // GDB Multiarch QString _openocdGdbExe; QString _openocdGdbPort; diff --git a/src/SeerMainWindow.cpp b/src/SeerMainWindow.cpp index 1faa14c..6d78d62 100644 --- a/src/SeerMainWindow.cpp +++ b/src/SeerMainWindow.cpp @@ -661,9 +661,10 @@ void SeerMainWindow::handleFileDebug (bool loadDefaultProject) { dlg.setCoreFilename(executableCoreFilename()); dlg.setPreGdbCommands(executablePreGdbCommands()); dlg.setPostGdbCommands(executablePostGdbCommands()); + // OpenOCD dlg.setOpenocdExe(openocdExe()); - dlg.setOpenocdCommand(openocdCommand()); + dlg.setOpenocdOptions(openocdOptions()); dlg.setSymbolFile(symbolFile()); // If there's a project, use it. @@ -713,7 +714,7 @@ void SeerMainWindow::handleFileDebug (bool loadDefaultProject) { // read openocd variables setOpenocdExe(dlg.openocdExe()); - setOpenocdCommand(dlg.openocdCommand()); + setOpenocdOptions(dlg.openocdOptions()); setSymbolFile(dlg.symbolFile()); launchExecutable(launchMode, breakMode); @@ -2264,12 +2265,12 @@ void SeerMainWindow::setOpenocdExe (const QString& path) { gdbWidget->setOpenocdExe(path); } -const QString& SeerMainWindow::openocdCommand() { - return gdbWidget->openocdCommand(); +const QString& SeerMainWindow::openocdOptions() { + return gdbWidget->openocdOptions(); } -void SeerMainWindow::setOpenocdCommand (const QString& command){ - gdbWidget->setOpenocdCommand(command); +void SeerMainWindow::setOpenocdOptions (const QString& options){ + gdbWidget->setOpenocdOptions(options); } // ::GDB Multiarch diff --git a/src/SeerMainWindow.h b/src/SeerMainWindow.h index e8f3b74..2d89094 100644 --- a/src/SeerMainWindow.h +++ b/src/SeerMainWindow.h @@ -83,8 +83,8 @@ class SeerMainWindow : public QMainWindow, protected Ui::SeerMainWindowForm { // ::Main const QString& openocdExe (); void setOpenocdExe (const QString& path); - const QString& openocdCommand (); - void setOpenocdCommand (const QString& command); + const QString& openocdOptions (); + void setOpenocdOptions (const QString& options); // ::GDB Multiarch const QString& openocdGdbExe (); void setOpenocdGdbExe (const QString& path);