From cd08f7a5002f81e3a1fbf2afd606dbe86c83ed42 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 28 Dec 2024 17:14:55 -0600 Subject: [PATCH 01/16] Release version 2.5. --- CHANGELOG.md | 3 +-- debian/changelog | 6 +++--- src/CMakeLists.txt | 2 +- src/SeerUtl.cpp | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2a64f6..9360627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,7 @@ # Seer Change Log -## [2.5beta] - 2024-XX-XX -* Starting the 2.5 development cycle. +## [2.5] - 2024-12-24 * Console now supports a subset of ANSI color codes. * Console can be started in these modes: - Detached diff --git a/debian/changelog b/debian/changelog index 3329eb2..c33d247 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -seergdb (2.5beta) UNRELEASED; urgency=medium +seergdb (2.5) UNRELEASED; urgency=medium - * Release Seer version 2.5beta + * Release Seer version 2.5 - -- Ernie Pasveer Mon, 18 Mar 2024 22:18:38 +0200 + -- Ernie Pasveer Sat, 28 Dec 2024 22:18:38 +0200 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a3474ce..bbd4a85 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.1.0) -project(seergdb VERSION 2.5.0 LANGUAGES CXX) +project(seergdb VERSION 2.5 LANGUAGES CXX) set(PROJECT_NAME seergdb) diff --git a/src/SeerUtl.cpp b/src/SeerUtl.cpp index 6daf5ce..a80599d 100644 --- a/src/SeerUtl.cpp +++ b/src/SeerUtl.cpp @@ -11,7 +11,7 @@ // Increment this with every release on GitHub. // See scripts/change_versionnumber // -#define SEER_VERSION "2.5.beta" +#define SEER_VERSION "2.5" namespace Seer { From 69b96880da402c5a7d928cc3d76a9cb9b4eafba7 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 28 Dec 2024 17:31:35 -0600 Subject: [PATCH 02/16] Start of version 2.6 development cycle. --- CHANGELOG.md | 3 +++ debian/changelog | 4 ++-- src/CMakeLists.txt | 2 +- src/SeerUtl.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9360627..6d581fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Seer Change Log +## [2.6beta] - 2025-XX-XX +* Starting version 2.6 development cycle. + ## [2.5] - 2024-12-24 * Console now supports a subset of ANSI color codes. * Console can be started in these modes: diff --git a/debian/changelog b/debian/changelog index c33d247..b74a73a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ -seergdb (2.5) UNRELEASED; urgency=medium +seergdb (2.6beta) UNRELEASED; urgency=medium - * Release Seer version 2.5 + * Release Seer version 2.6beta -- Ernie Pasveer Sat, 28 Dec 2024 22:18:38 +0200 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bbd4a85..9f558f7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.1.0) -project(seergdb VERSION 2.5 LANGUAGES CXX) +project(seergdb VERSION 2.6.0 LANGUAGES CXX) set(PROJECT_NAME seergdb) diff --git a/src/SeerUtl.cpp b/src/SeerUtl.cpp index a80599d..3be7892 100644 --- a/src/SeerUtl.cpp +++ b/src/SeerUtl.cpp @@ -11,7 +11,7 @@ // Increment this with every release on GitHub. // See scripts/change_versionnumber // -#define SEER_VERSION "2.5" +#define SEER_VERSION "2.6beta" namespace Seer { From dee5c2480ba68b8484253f7f3ee541bfef74ac93 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 28 Dec 2024 17:51:45 -0600 Subject: [PATCH 03/16] Update README file with a canned release announcement. --- notes/README.announce | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/notes/README.announce b/notes/README.announce index 70b655b..103e41d 100644 --- a/notes/README.announce +++ b/notes/README.announce @@ -7,3 +7,22 @@ https://www.reddit.com/r/gdb/ https://www.reddit.com/r/linux/ https://twitter.com/home + +Title: +------ + +Seergdb v2.5 released for Linux. + + +Comments: +--------- + +A new version of Seergdb (frontend to gdb) has been released for linux. + +https://github.com/epasveer/seer +https://github.com/epasveer/seer/releases/tag/v2.5 + +Give it a try. + +Thanks. + From 70f874440961aa5bb95e72b7c94dd9e563e58b31 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Wed, 1 Jan 2025 10:17:46 -0600 Subject: [PATCH 04/16] Set focus to first ui widget. --- src/SeerBreakpointCreateDialog.cpp | 2 ++ src/SeerCatchpointCreateDialog.cpp | 2 ++ src/SeerCatchpointCreateDialog.ui | 17 +++++++++++++++-- src/SeerPrintpointCreateDialog.cpp | 2 ++ src/SeerWatchpointCreateDialog.cpp | 2 ++ src/SeerWatchpointCreateDialog.ui | 6 +++--- 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/SeerBreakpointCreateDialog.cpp b/src/SeerBreakpointCreateDialog.cpp index abc7f8f..621a3cf 100644 --- a/src/SeerBreakpointCreateDialog.cpp +++ b/src/SeerBreakpointCreateDialog.cpp @@ -25,6 +25,8 @@ SeerBreakpointCreateDialog::SeerBreakpointCreateDialog (QWidget* parent) : QDial setIgnoreCountText (""); setThreadIdText (""); + filenameLineEdit->setFocus(); + // Connect things. QObject::connect(conditionalCheckBox, &QCheckBox::clicked, conditionalLineEdit, &QLineEdit::setEnabled); QObject::connect(ignoreCountCheckBox, &QCheckBox::clicked, ignoreCountLineEdit, &QLineEdit::setEnabled); diff --git a/src/SeerCatchpointCreateDialog.cpp b/src/SeerCatchpointCreateDialog.cpp index 8ab1269..2b5fa77 100644 --- a/src/SeerCatchpointCreateDialog.cpp +++ b/src/SeerCatchpointCreateDialog.cpp @@ -13,6 +13,8 @@ SeerCatchpointCreateDialog::SeerCatchpointCreateDialog (QWidget* parent) : QDial setTemporaryEnabled(false); setDisabledEnabled(false); + throwRadioButton->setFocus(); + // Connect things. } diff --git a/src/SeerCatchpointCreateDialog.ui b/src/SeerCatchpointCreateDialog.ui index fe2f9c5..9d89f9d 100644 --- a/src/SeerCatchpointCreateDialog.ui +++ b/src/SeerCatchpointCreateDialog.ui @@ -6,8 +6,8 @@ 0 0 - 537 - 297 + 538 + 302 @@ -178,6 +178,19 @@ + + throwRadioButton + loadRadioButton + adaAssertRadioButton + rethrowRadioButton + unloadRadioButton + adaExceptionRadioButton + catchRadioButton + adaHandlersRadioButton + temporaryCheckBox + disabledCheckBox + nameLineEdit + diff --git a/src/SeerPrintpointCreateDialog.cpp b/src/SeerPrintpointCreateDialog.cpp index ee73cf2..656f7ef 100644 --- a/src/SeerPrintpointCreateDialog.cpp +++ b/src/SeerPrintpointCreateDialog.cpp @@ -31,6 +31,8 @@ SeerPrintpointCreateDialog::SeerPrintpointCreateDialog (QWidget* parent) : QDial setDPrintfFunction (""); setDPrintfChannel (""); + filenameLineEdit->setFocus(); + // Connect things. QObject::connect(conditionalCheckBox, &QCheckBox::clicked, conditionalLineEdit, &QLineEdit::setEnabled); QObject::connect(ignoreCountCheckBox, &QCheckBox::clicked, ignoreCountLineEdit, &QLineEdit::setEnabled); diff --git a/src/SeerWatchpointCreateDialog.cpp b/src/SeerWatchpointCreateDialog.cpp index a54e9c7..2d5fa46 100644 --- a/src/SeerWatchpointCreateDialog.cpp +++ b/src/SeerWatchpointCreateDialog.cpp @@ -17,6 +17,8 @@ SeerWatchpointCreateDialog::SeerWatchpointCreateDialog (QWidget* parent) : QDial setReadWriteAccessEnabled(false); setWriteAccessEnabled(true); + expressionLineEdit->setFocus(); + // Connect things. } diff --git a/src/SeerWatchpointCreateDialog.ui b/src/SeerWatchpointCreateDialog.ui index d44b46d..468a171 100644 --- a/src/SeerWatchpointCreateDialog.ui +++ b/src/SeerWatchpointCreateDialog.ui @@ -6,8 +6,8 @@ 0 0 - 348 - 251 + 403 + 256 @@ -29,7 +29,7 @@ - Expression + Variable/Expression From 4a686571c3b64ac0d08b14dface3df8b1d5fef20 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 4 Jan 2025 08:53:57 -0600 Subject: [PATCH 05/16] Fixed commands with a watchpoint. --- CHANGELOG.md | 1 + src/SeerWatchpointsBrowserWidget.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d581fe..b3aac3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [2.6beta] - 2025-XX-XX * Starting version 2.6 development cycle. +* Fixed regression when adding commands to a watchpoint. ## [2.5] - 2024-12-24 * Console now supports a subset of ANSI color codes. diff --git a/src/SeerWatchpointsBrowserWidget.cpp b/src/SeerWatchpointsBrowserWidget.cpp index 33dde89..486ca4e 100644 --- a/src/SeerWatchpointsBrowserWidget.cpp +++ b/src/SeerWatchpointsBrowserWidget.cpp @@ -150,7 +150,7 @@ void SeerWatchpointsBrowserWidget::handleText (const QString& text) { QString cond_text = Seer::parseFirst(bkpt_text, "cond=", '"', '"', false); QString times_text = Seer::parseFirst(bkpt_text, "times=", '"', '"', false); QString ignore_text = Seer::parseFirst(bkpt_text, "ignore=", '"', '"', false); - QString script_text = Seer::parseFirst(bkpt_text, "script=", '{', '}', false); + QString script_text = Seer::parseFirst(bkpt_text, "script=", '[', ']', false); QString original_location_text = Seer::parseFirst(bkpt_text, "original-location=", '"', '"', false); // Only look for 'watchpoint' type break points. From a603b16e6b82d60378f3a042aaea5e4e0173ff3c Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 25 Jan 2025 10:57:39 -0600 Subject: [PATCH 06/16] Create console once per Seer session. --- src/SeerConsoleWidget.cpp | 63 ++++++++++++++++++------------ src/SeerConsoleWidget.h | 7 ++-- src/SeerGdbWidget.cpp | 42 ++++++++++---------- src/SeerMemoryVisualizerWidget.cpp | 20 ++++++---- 4 files changed, 74 insertions(+), 58 deletions(-) diff --git a/src/SeerConsoleWidget.cpp b/src/SeerConsoleWidget.cpp index a0fa6f3..28dba2b 100644 --- a/src/SeerConsoleWidget.cpp +++ b/src/SeerConsoleWidget.cpp @@ -53,9 +53,8 @@ SeerConsoleWidget::SeerConsoleWidget (QWidget* parent) : QWidget(parent) { wrapTextCheckBox->setCheckState(Qt::Unchecked); // No wrap - // Create psuedo terminal for console. + // Create psuedo terminal for console. Don't connect to it yet. createConsole(); - connectConsole(); // Connect things. QObject::connect(clearButton, &QPushButton::clicked, this, &SeerConsoleWidget::handleClearButton); @@ -71,12 +70,7 @@ SeerConsoleWidget::SeerConsoleWidget (QWidget* parent) : QWidget(parent) { } SeerConsoleWidget::~SeerConsoleWidget () { - disconnectConsole(); - deleteConsole(); -} - -const QString& SeerConsoleWidget::ttyDeviceName () const { - return _ttyDeviceName; + deleteConsole(); // Will disconnect console first befor deleting. } void SeerConsoleWidget::handleText (const char* buffer, int count) { @@ -246,10 +240,6 @@ void SeerConsoleWidget::handleStdinLineEdit () { QString str = stdinLineEdit->text(); - if (str == "") { - return; - } - stdinLineEdit->clear(); str += '\n'; @@ -353,14 +343,31 @@ void SeerConsoleWidget::createConsole () { setScrollLines(0); } -void SeerConsoleWidget::connectConsole () { +void SeerConsoleWidget::deleteConsole () { disconnectConsole(); + _ttyDeviceName = ""; + if (_ptsFD < 0) { return; } + ::close(_ptsFD); _ptsFD = -1; +} + +void SeerConsoleWidget::connectConsole () { + + if (isConsoleConnected()) { + qDebug() << "Console is already connected!"; + return; + } + + if (_ptsFD < 0) { + qDebug() << "Can't connect Console. No _ptsFD!"; + return; + } + _ptsListener = new QSocketNotifier(_ptsFD, QSocketNotifier::Read); QObject::connect(_ptsListener, &QSocketNotifier::activated, this, &SeerConsoleWidget::handleConsoleOutput); @@ -368,23 +375,27 @@ void SeerConsoleWidget::connectConsole () { void SeerConsoleWidget::disconnectConsole () { - if (_ptsListener) { - - QObject::disconnect(_ptsListener, &QSocketNotifier::activated, this, &SeerConsoleWidget::handleConsoleOutput); - - delete _ptsListener; _ptsListener = 0; - } -} - -void SeerConsoleWidget::deleteConsole () { - - if (_ptsFD < 0) { + if (isConsoleConnected() == false) { + qDebug() << "Console is already disconnected!"; return; } - _ttyDeviceName = ""; + QObject::disconnect(_ptsListener, &QSocketNotifier::activated, this, &SeerConsoleWidget::handleConsoleOutput); - ::close(_ptsFD); _ptsFD = -1; + delete _ptsListener; _ptsListener = 0; +} + +bool SeerConsoleWidget::isConsoleConnected () const { + + if (_ptsListener != nullptr) { + return true; + } + + return false; +} + +const QString& SeerConsoleWidget::ttyDeviceName () const { + return _ttyDeviceName; } void SeerConsoleWidget::setScrollLines (int count) { diff --git a/src/SeerConsoleWidget.h b/src/SeerConsoleWidget.h index e9d7a25..2e4e4ae 100644 --- a/src/SeerConsoleWidget.h +++ b/src/SeerConsoleWidget.h @@ -15,9 +15,12 @@ class SeerConsoleWidget : public QWidget, protected Ui::SeerConsoleWidgetForm { explicit SeerConsoleWidget (QWidget* parent = 0); ~SeerConsoleWidget (); - const QString& ttyDeviceName () const; + void createConsole (); + void deleteConsole (); void connectConsole (); void disconnectConsole (); + bool isConsoleConnected () const; + const QString& ttyDeviceName () const; void setScrollLines (int count); int scrollLines () const; @@ -46,8 +49,6 @@ class SeerConsoleWidget : public QWidget, protected Ui::SeerConsoleWidgetForm { protected: void handleText (const char* buffer, int count); - void createConsole (); - void deleteConsole (); void writeSettings (); void writeFontSettings (); void writeSizeSettings (); diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index a0bfba8..9cd5e1a 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -100,6 +100,9 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) { logsTabWidget->addTab(_seerOutputLog, "Seer output"); logsTabWidget->setCurrentIndex(0); + // Create the console. + createConsole(); + // Create editor options bar. QToolButton* breakpointsLoadToolButton = new QToolButton(logsTabWidget); breakpointsLoadToolButton->setIcon(QIcon(":/seer/resources/RelaxLightIcons/document-open.svg")); @@ -722,8 +725,8 @@ void SeerGdbWidget::writeLogsSettings () { QString current = logsTabWidget->tabBar()->tabText(logsTabWidget->tabBar()->currentIndex()); - //qDebug() << "Tabs" << tabs; - //qDebug() << "Current" << current; + qDebug() << "Tabs" << tabs; + qDebug() << "Current" << current; QSettings settings; @@ -916,11 +919,10 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode) { _executableBreakMode = breakMode; - // Delete the old gdb and console if there is a new executable + // Disconnect from the console and delete the old gdb if there is a new executable. if (newExecutableFlag() == true) { - killGdb(); disconnectConsole(); - deleteConsole(); + killGdb(); } // If gdb isn't running, start it. @@ -932,6 +934,9 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode) { break; } + // Connect to the console. + connectConsole(); + if (gdbAsyncMode()) { handleGdbCommand("-gdb-set mi-async on"); // Turn on async mode so the 'interrupt' can happen. } @@ -1057,14 +1062,14 @@ void SeerGdbWidget::handleGdbAttachExecutable () { } - // Delete the old gdb and console if there is a new executable + // Disconnect from the console and delete the old gdb if there is a new executable. if (newExecutableFlag() == true) { - killGdb(); disconnectConsole(); - deleteConsole(); + killGdb(); } // If gdb isn't running, start it. + // No need to connect to the console in this mode. if (isGdbRuning() == false) { bool f = startGdb(); @@ -1134,14 +1139,14 @@ void SeerGdbWidget::handleGdbConnectExecutable () { while (1) { - // Delete the old gdb and console if there is a new executable + // Disconnect from the console and delete the old gdb if there is a new executable. if (newExecutableFlag() == true) { - killGdb(); disconnectConsole(); - deleteConsole(); + killGdb(); } // If gdb isn't running, start it. + // No need to connect to the console in this mode. if (isGdbRuning() == false) { bool f = startGdb(); @@ -1228,13 +1233,10 @@ void SeerGdbWidget::handleGdbRRExecutable () { } } - // Delete the old gdb and console if there is a new executable - // Create a new console. + // Disconnect from the console and delete the old gdb, then reconnect. if (newExecutableFlag() == true) { - killGdb(); disconnectConsole(); - deleteConsole(); - createConsole(); + killGdb(); connectConsole(); } @@ -1338,14 +1340,14 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () { QApplication::setOverrideCursor(Qt::BusyCursor); - // Delete the old gdb and console if there is a new executable + // Disconnect from the console and delete the old gdb. No need to reconnect. if (newExecutableFlag() == true) { - killGdb(); disconnectConsole(); - deleteConsole(); + killGdb(); } // If gdb isn't running, start it. + // No need to connect to the console in this mode. if (isGdbRuning() == false) { bool f = startGdb(); @@ -3221,8 +3223,6 @@ void SeerGdbWidget::killGdb () { void SeerGdbWidget::createConsole () { - deleteConsole(); // Delete old console, if any. - if (_consoleWidget == 0) { _consoleWidget = new SeerConsoleWidget(0); diff --git a/src/SeerMemoryVisualizerWidget.cpp b/src/SeerMemoryVisualizerWidget.cpp index 2979849..3ccc658 100644 --- a/src/SeerMemoryVisualizerWidget.cpp +++ b/src/SeerMemoryVisualizerWidget.cpp @@ -83,16 +83,17 @@ void SeerMemoryVisualizerWidget::setVariableName (const QString& name) { variableNameLineEdit->setText(name); setVariableAddress(""); - if (variableNameLineEdit->text() == "") { - return; - } - // Clear old contents. QByteArray array; memoryHexEditor->setData(new SeerHexWidget::DataStorageArray(array)); memoryAsmEditor->setData(""); + // Do nothing if there's no variable name. + if (variableNameLineEdit->text() == "") { + return; + } + // Send signal to get variable address. emit evaluateVariableExpression(_variableId, variableNameLineEdit->text()); } @@ -165,8 +166,6 @@ void SeerMemoryVisualizerWidget::handleText (const QString& text) { QApplication::setOverrideCursor(Qt::BusyCursor); - //qDebug() << text; - if (text.contains(QRegularExpression("^([0-9]+)\\^done,value="))) { // 11^done,value="1" @@ -221,8 +220,6 @@ void SeerMemoryVisualizerWidget::handleText (const QString& text) { if (id_text.toInt() == _memoryId) { - //qDebug() << text; - QString memory_text = Seer::parseFirst(text, "memory=", '[', ']', false); QStringList range_list = Seer::parse(memory_text, "", '{', '}', false); @@ -275,9 +272,11 @@ void SeerMemoryVisualizerWidget::handleText (const QString& text) { // Display the error message. QString msg_text = Seer::parseFirst(text, "msg=", false); + /* XXX if (msg_text != "") { QMessageBox::warning(this, "Error.", Seer::filterEscapes(msg_text)); } + */ } if (id_text.toInt() == _memoryLengthId) { @@ -297,6 +296,11 @@ void SeerMemoryVisualizerWidget::handleText (const QString& text) { handleRefreshButton(); } + // End of program. Clear everything as it will be out of date. + }else if (text.startsWith("^error,msg=\"No registers.\"")) { + setVariableName(""); + setMemoryLength(""); + }else{ // Ignore anything else. } From da5ff2fde140b8593ff9bc444866535f171736ab Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 25 Jan 2025 10:58:43 -0600 Subject: [PATCH 07/16] Update CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3aac3a..73db67a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## [2.6beta] - 2025-XX-XX * Starting version 2.6 development cycle. * Fixed regression when adding commands to a watchpoint. +* Create console once per Seer session. Instead of constance create/destroy. ## [2.5] - 2024-12-24 * Console now supports a subset of ANSI color codes. From d0c056423937048f7f9a65b97d05660648d2623d Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 25 Jan 2025 11:00:09 -0600 Subject: [PATCH 08/16] Add 'hellocurses' test program. --- tests/helloucurses/.gitignore | 1 + tests/helloucurses/Makefile | 10 ++++++++++ tests/helloucurses/breakpoints.seer | 3 +++ tests/helloucurses/helloucurses.c | 25 +++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 tests/helloucurses/.gitignore create mode 100644 tests/helloucurses/Makefile create mode 100644 tests/helloucurses/breakpoints.seer create mode 100644 tests/helloucurses/helloucurses.c diff --git a/tests/helloucurses/.gitignore b/tests/helloucurses/.gitignore new file mode 100644 index 0000000..28e7b63 --- /dev/null +++ b/tests/helloucurses/.gitignore @@ -0,0 +1 @@ +helloucurses diff --git a/tests/helloucurses/Makefile b/tests/helloucurses/Makefile new file mode 100644 index 0000000..7a66435 --- /dev/null +++ b/tests/helloucurses/Makefile @@ -0,0 +1,10 @@ +.PHONY: all +all: helloucurses + +helloucurses: helloucurses.c + gcc-13 -g -o helloucurses helloucurses.c -I/usr/local/uCurses -L /usr/local/lib64 -lm -luCurses + +.PHONY: clean +clean: + rm -f helloucurses helloucurses.o + diff --git a/tests/helloucurses/breakpoints.seer b/tests/helloucurses/breakpoints.seer new file mode 100644 index 0000000..7100e33 --- /dev/null +++ b/tests/helloucurses/breakpoints.seer @@ -0,0 +1,3 @@ +break -source /nas/erniep/Development/seer/tests/helloucurses/helloucurses.c -line 23 +break -source /nas/erniep/Development/seer/tests/helloucurses/helloucurses.c -line 14 +break -function c_emit -line 107 diff --git a/tests/helloucurses/helloucurses.c b/tests/helloucurses/helloucurses.c new file mode 100644 index 0000000..a458c43 --- /dev/null +++ b/tests/helloucurses/helloucurses.c @@ -0,0 +1,25 @@ +#include +#include +#include +#include + +#include "uCurses.h" +#include "uC_terminfo.h" +#include "uC_attribs.h" + +int main (int argc, char* argv[]) { + + // not defining any windows, just used to position cursor + // on the screen + uCurses_init(); + uC_clear(); + uC_cup(5,5); + uC_terminfo_flush(); + + uC_console_reset_attrs(); + uC_clear(); + uC_cup(10, 0); + + uCurses_deInit(); +} + From afb0826ca705ad5d61f86f5ec1de42f43e67c2ff Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 25 Jan 2025 11:04:39 -0600 Subject: [PATCH 09/16] Add 'ncurses' test program. --- tests/hellocurses/.gitignore | 2 + tests/hellocurses/Makefile | 13 ++++++ tests/hellocurses/helloworld.cpp | 13 ++++++ tests/hellocurses/triangle.cpp | 72 ++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 tests/hellocurses/.gitignore create mode 100644 tests/hellocurses/Makefile create mode 100644 tests/hellocurses/helloworld.cpp create mode 100644 tests/hellocurses/triangle.cpp diff --git a/tests/hellocurses/.gitignore b/tests/hellocurses/.gitignore new file mode 100644 index 0000000..34a8fdf --- /dev/null +++ b/tests/hellocurses/.gitignore @@ -0,0 +1,2 @@ +helloworld +triangle diff --git a/tests/hellocurses/Makefile b/tests/hellocurses/Makefile new file mode 100644 index 0000000..13b1506 --- /dev/null +++ b/tests/hellocurses/Makefile @@ -0,0 +1,13 @@ +.PHONY: all +all: helloworld triangle + +helloworld: helloworld.cpp + g++ -g -o helloworld helloworld.cpp -lncurses + +triangle: triangle.cpp + g++ -g -o triangle triangle.cpp -lncurses + +.PHONY: clean +clean: + rm -f helloworld triangle + diff --git a/tests/hellocurses/helloworld.cpp b/tests/hellocurses/helloworld.cpp new file mode 100644 index 0000000..289e281 --- /dev/null +++ b/tests/hellocurses/helloworld.cpp @@ -0,0 +1,13 @@ +#include + +int main() { + + initscr(); /* Start curses mode */ + printw("Hello World !!!"); /* Print Hello World */ + refresh(); /* Print it on to the real screen */ + getch(); /* Wait for user input */ + endwin(); /* End curses mode */ + + return 0; +} + diff --git a/tests/hellocurses/triangle.cpp b/tests/hellocurses/triangle.cpp new file mode 100644 index 0000000..0a48894 --- /dev/null +++ b/tests/hellocurses/triangle.cpp @@ -0,0 +1,72 @@ +/* triangle.c */ +#include +#include +#include + +#define ITERMAX 10000 + +int main(void) { + + long iter; + int yi, xi; + int y[3], x[3]; + int index; + int maxlines, maxcols; + + /* initialize curses */ + + initscr(); + cbreak(); + noecho(); + + clear(); + + /* initialize triangle */ + + maxlines = LINES - 1; + maxcols = COLS - 1; + + y[0] = 0; + x[0] = 0; + + y[1] = maxlines; + x[1] = maxcols / 2; + + y[2] = 0; + x[2] = maxcols; + + mvaddch(y[0], x[0], '0'); + mvaddch(y[1], x[1], '1'); + mvaddch(y[2], x[2], '2'); + + /* initialize yi,xi with random values */ + + yi = std::rand() % maxlines; + xi = std::rand() % maxcols; + + mvaddch(yi, xi, '.'); + + /* iterate the triangle */ + + for (iter = 0; iter < ITERMAX; iter++) { + index = std::rand() % 3; + + yi = (yi + y[index]) / 2; + xi = (xi + x[index]) / 2; + + mvaddch(yi, xi, '*'); + refresh(); + } + + /* done */ + + mvaddstr(maxlines, 0, "Press any key to quit"); + + refresh(); + + getch(); + endwin(); + + exit(0); +} + From 02e0804d49ebf7c0119e83a3cabf7e1f4ac917fe Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Wed, 29 Jan 2025 18:57:49 -0600 Subject: [PATCH 10/16] Fixed bug with 'ignore' files from EditorManager. --- src/SeerGdbWidget.cpp | 7 +++++-- src/SeerGdbWidget.h | 2 ++ src/SeerUtl.cpp | 5 ++++- src/SeerUtl.h | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index a0bfba8..6d137b1 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -3400,12 +3400,15 @@ const QStringList& SeerGdbWidget::sourceHeaderFilePatterns () const { void SeerGdbWidget::setSourceIgnoreFilePatterns (const QStringList& filePatterns) { - sourceLibraryManagerWidget->sourceBrowserWidget()->setIgnoreFilePatterns(filePatterns); + _ignoreFilePatterns = filePatterns; + + sourceLibraryManagerWidget->sourceBrowserWidget()->setIgnoreFilePatterns(sourceIgnoreFilePatterns()); + editorManager()->setEditorIgnoreDirectories(sourceIgnoreFilePatterns()); } const QStringList& SeerGdbWidget::sourceIgnoreFilePatterns () const { - return sourceLibraryManagerWidget->sourceBrowserWidget()->ignoreFilePatterns(); + return _ignoreFilePatterns; } void SeerGdbWidget::setAssemblyShowAssemblyTabOnStartup (bool flag) { diff --git a/src/SeerGdbWidget.h b/src/SeerGdbWidget.h index b08d371..8096c0b 100644 --- a/src/SeerGdbWidget.h +++ b/src/SeerGdbWidget.h @@ -414,5 +414,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { QVector _dataExpressionId; QVector _dataExpressionName; + + QStringList _ignoreFilePatterns; }; diff --git a/src/SeerUtl.cpp b/src/SeerUtl.cpp index 3be7892..07be08b 100644 --- a/src/SeerUtl.cpp +++ b/src/SeerUtl.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -710,7 +711,9 @@ namespace Seer { return false; } - + bool hasWildcards (const QString& str) { + return (str.indexOf('*') >= 0) || (str.indexOf('?') >= 0); + } QString elideText (const QString& str, Qt::TextElideMode mode, int length) { diff --git a/src/SeerUtl.h b/src/SeerUtl.h index fe74a72..dffb28f 100644 --- a/src/SeerUtl.h +++ b/src/SeerUtl.h @@ -27,6 +27,7 @@ namespace Seer { QStringList quoteChars (const QStringList& strings, const QString& chars); QString varObjParent (const QString& str); bool matchesWildcard (const QStringList& regexpatterns, const QString& string); + bool hasWildcards (const QString& str); QString elideText (const QString& str, Qt::TextElideMode mode, int length); QStringList split (const QString& str); QString unescape (const QString& str); From bbdec6d68d0c97f709b9260ae82a50cc2645e723 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Wed, 29 Jan 2025 18:59:01 -0600 Subject: [PATCH 11/16] Update CHANGELOG. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3aac3a..a374c65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ## [2.6beta] - 2025-XX-XX * Starting version 2.6 development cycle. * Fixed regression when adding commands to a watchpoint. +* Fixed regression when ignoring files to be opened in the + EditorManager. ## [2.5] - 2024-12-24 * Console now supports a subset of ANSI color codes. From 876512ebe506f5a855e59b7b5e69ec3b89b88901 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Fri, 31 Jan 2025 19:03:07 -0600 Subject: [PATCH 12/16] Update test program. --- tests/helloucurses/helloucurses.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/helloucurses/helloucurses.c b/tests/helloucurses/helloucurses.c index a458c43..7ceb225 100644 --- a/tests/helloucurses/helloucurses.c +++ b/tests/helloucurses/helloucurses.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "uCurses.h" #include "uC_terminfo.h" @@ -16,8 +17,9 @@ int main (int argc, char* argv[]) { uC_cup(5,5); uC_terminfo_flush(); + write(1, "Hello", 5); + uC_console_reset_attrs(); - uC_clear(); uC_cup(10, 0); uCurses_deInit(); From 1ea768b11222caefc4eb9bb7a2a872628f13ef8d Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sun, 2 Feb 2025 13:48:46 -0600 Subject: [PATCH 13/16] Fixed bug with ordering of message tabs. --- src/SeerConsoleWidget.cpp | 4 ++-- src/SeerGdbWidget.cpp | 37 +++++++++++++++++++++++++++++++------ src/SeerGdbWidget.h | 5 +++++ src/SeerUtl.cpp | 13 +++++++++++++ src/SeerUtl.h | 5 +---- 5 files changed, 52 insertions(+), 12 deletions(-) diff --git a/src/SeerConsoleWidget.cpp b/src/SeerConsoleWidget.cpp index 28dba2b..c759827 100644 --- a/src/SeerConsoleWidget.cpp +++ b/src/SeerConsoleWidget.cpp @@ -359,7 +359,7 @@ void SeerConsoleWidget::deleteConsole () { void SeerConsoleWidget::connectConsole () { if (isConsoleConnected()) { - qDebug() << "Console is already connected!"; + //qDebug() << "Console is already connected!"; return; } @@ -376,7 +376,7 @@ void SeerConsoleWidget::connectConsole () { void SeerConsoleWidget::disconnectConsole () { if (isConsoleConnected() == false) { - qDebug() << "Console is already disconnected!"; + //qDebug() << "Console is already disconnected!"; return; } diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index fa50a8b..14522b4 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -70,6 +70,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) { _rememberManualCommandCount = 10; _currentFrame = -1; + setIsQuitting(false); setNewExecutableFlag(true); setupUi(this); @@ -141,6 +142,9 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) { // Restore tab ordering. readLogsSettings(); + // Handle the app's 'quit' event, in case we want to do things before exiting. + QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &SeerGdbWidget::handleAboutToQuit); + // Connect things. QObject::connect(logsTabWidget->tabBar(), &QTabBar::tabMoved, this, &SeerGdbWidget::handleLogsTabMoved); QObject::connect(logsTabWidget->tabBar(), &QTabBar::currentChanged, this, &SeerGdbWidget::handleLogsTabChanged); @@ -363,6 +367,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) { // Restore window settings. readSettings(); + } SeerGdbWidget::~SeerGdbWidget () { @@ -693,6 +698,11 @@ void SeerGdbWidget::handleLogsTabMoved (int from, int to) { Q_UNUSED(from); Q_UNUSED(to); + // Don't handle anything here if Seer is exiting. + if (isQuitting()) { + return; + } + writeLogsSettings(); } @@ -700,6 +710,11 @@ void SeerGdbWidget::handleLogsTabChanged (int index) { Q_UNUSED(index); + // Don't handle anything here if Seer is exiting. + if (isQuitting()) { + return; + } + writeLogsSettings(); } @@ -725,8 +740,8 @@ void SeerGdbWidget::writeLogsSettings () { QString current = logsTabWidget->tabBar()->tabText(logsTabWidget->tabBar()->currentIndex()); - qDebug() << "Tabs" << tabs; - qDebug() << "Current" << current; + //qDebug() << "Tabs" << tabs; + //qDebug() << "Current" << current; QSettings settings; @@ -2001,8 +2016,6 @@ void SeerGdbWidget::handleGdbBreakpointCommand (QString breakpoint, QString comm return; } - qDebug().noquote() << "XXX: " << breakpoint << command; - handleGdbCommand("-break-commands " + breakpoint + " \"" + command + "\""); handleGdbGenericpointList(); } @@ -2859,6 +2872,12 @@ void SeerGdbWidget::handleConsoleModeChanged () { } } +void SeerGdbWidget::handleAboutToQuit () { + + // Detect if we're exiting Seer. + setIsQuitting(true); +} + void SeerGdbWidget::writeSettings () { //qDebug() << "Write Settings"; @@ -3070,6 +3089,14 @@ void SeerGdbWidget::readSettings () { } settings.endGroup(); } +bool SeerGdbWidget::isQuitting () const { + return _isQuitting; +} + +void SeerGdbWidget::setIsQuitting (bool f) { + _isQuitting = f; +} + bool SeerGdbWidget::isGdbRuning () const { if (_gdbProcess->state() == QProcess::NotRunning) { @@ -3237,8 +3264,6 @@ void SeerGdbWidget::createConsole () { setConsoleMode(consoleMode()); setConsoleScrollLines(consoleScrollLines()); - - writeLogsSettings(); } } diff --git a/src/SeerGdbWidget.h b/src/SeerGdbWidget.h index 8096c0b..4bd5976 100644 --- a/src/SeerGdbWidget.h +++ b/src/SeerGdbWidget.h @@ -334,6 +334,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { void handleGdbProcessErrored (QProcess::ProcessError errorStatus); void handleConsoleModeChanged (); + void handleAboutToQuit (); signals: void stoppingPointReached (); @@ -346,6 +347,9 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { void readLogsSettings (); private: + bool isQuitting () const; + void setIsQuitting (bool f); + bool isGdbRuning () const; bool startGdb (); bool startGdbRR (); @@ -357,6 +361,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { SeerConsoleWidget* console (); void sendGdbInterrupt (int signal); + bool _isQuitting; QString _gdbProgram; QString _gdbArguments; QString _gdbProgramOverride; diff --git a/src/SeerUtl.cpp b/src/SeerUtl.cpp index 07be08b..3c2a4ed 100644 --- a/src/SeerUtl.cpp +++ b/src/SeerUtl.cpp @@ -6,6 +6,13 @@ #include #include +// Comment out for now. I don't want to include boost because +// that would impact people try to compile Seer. Qt6 offer +// a 'stacktrace' function. OpenSuse may be slow in adoption. +// For now, comment it out and use when needed. +// #include + +#include #include // @@ -1258,5 +1265,11 @@ namespace Seer { return result; } + + void printStackTrace () { + // Capture and print the stack trace using Boost.Stacktrace. + // See comments at top. + // std::cout << "Stack trace:\n" << boost::stacktrace::stacktrace() << std::endl; + } } diff --git a/src/SeerUtl.h b/src/SeerUtl.h index dffb28f..7323360 100644 --- a/src/SeerUtl.h +++ b/src/SeerUtl.h @@ -31,9 +31,7 @@ namespace Seer { QString elideText (const QString& str, Qt::TextElideMode mode, int length); QStringList split (const QString& str); QString unescape (const QString& str); - int createID (); - unsigned char ebcdicToAscii (unsigned char byte); unsigned char ucharToAscii (unsigned char byte); QString ucharToHex (const QVector& bytes, int from, int count); @@ -47,9 +45,8 @@ namespace Seer { QString ucharToLong (const QVector& bytes, int from, int count); QString ucharToFloat (const QVector& bytes, int from, int count); QString ucharToDouble (const QVector& bytes, int from, int count); - int typeBytes (const QString& type); - bool readFile (const QString& filename, QStringList& lines); + void printStackTrace (); } From e69edbf4608d8d2ee5c496f082d430cfec3fa906 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sun, 2 Feb 2025 13:50:12 -0600 Subject: [PATCH 14/16] Updateed CHANGELOG. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39f3e8c..595deeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ * Create console once per Seer session. Instead of constant create/destroy. * Fixed regression when ignoring files to be opened in the EditorManager. +* Fixed regression when order of message tabs not being preserved between + sessions. ## [2.5] - 2024-12-24 * Console now supports a subset of ANSI color codes. From d0618851193266bc112d019f4143d247f77de964 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 15 Feb 2025 08:14:23 -0600 Subject: [PATCH 15/16] Properly save message tab order to config file. --- src/SeerGdbWidget.cpp | 45 +++++++++++++++++++++++++++++++++---- src/SeerGdbWidget.h | 3 ++- src/SeerMainWindow.cpp | 5 ++++- tests/hellogdbserver/README | 18 +++++++++++++++ 4 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 tests/hellogdbserver/README diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index 14522b4..e60e9fd 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -693,11 +693,17 @@ void SeerGdbWidget::addMessage (const QString& message, QMessageBox::Icon messag _messagesBrowserWidget->addMessage(message, messageType); } -void SeerGdbWidget::handleLogsTabMoved (int from, int to) { +void SeerGdbWidget::handleLogsTabMoved (int to, int from) { Q_UNUSED(from); Q_UNUSED(to); + // Keep track of console tab if it moved. + if (_consoleIndex == from) { + qDebug() << "Console tab index changed from" << from << "to" << to; + _consoleIndex = to; + } + // Don't handle anything here if Seer is exiting. if (isQuitting()) { return; @@ -789,6 +795,19 @@ void SeerGdbWidget::readLogsSettings () { } } + // Find the console tab index. + _consoleIndex = -1; + for (int i=0; itabBar()->count(); i++) { + if (logsTabWidget->tabBar()->tabText(i) == "Console output") { + _consoleIndex = i; + break; + } + } + + if (_consoleIndex < 0) { + qDebug() << "The console tab index is not in the settings."; + } + // Make a tab current. if (current != "") { for (int i=0; itabBar()->count(); i++) { @@ -1100,9 +1119,10 @@ void SeerGdbWidget::handleGdbAttachExecutable () { handleGdbSourceScripts(); } - // No console for 'attach' mode. + // No console for 'attach' mode but make sure it's reattached. setExecutableLaunchMode("attach"); setGdbRecordMode(""); + reattachConsole(); // Load ithe executable, if needed. if (newExecutableFlag() == true) { @@ -1173,10 +1193,11 @@ void SeerGdbWidget::handleGdbConnectExecutable () { handleGdbSourceScripts(); } - // No console for 'connect' mode. + // No console for 'connect' mode but make sure it's reattached. setExecutableLaunchMode("connect"); setGdbRecordMode(""); setExecutablePid(0); + reattachConsole(); // Connect to the remote gdbserver. handleGdbCommand(QString("-target-select extended-remote %1").arg(executableConnectHostPort())); @@ -1378,10 +1399,11 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () { handleGdbSourceScripts(); } - // No console for 'core' mode. + // No console for 'core' mode but make sure it's reattached. setExecutableLaunchMode("corefile"); setGdbRecordMode(""); setExecutablePid(0); + reattachConsole(); if (newExecutableFlag() == true) { handleGdbExecutablePreCommands(); // Run any 'pre' commands before program is loaded. @@ -3300,6 +3322,21 @@ void SeerGdbWidget::disconnectConsole () { } } +void SeerGdbWidget::reattachConsole () { + + if (_consoleIndex < 0) { + return; + } + + if (_consoleWidget == nullptr) { + return; + } + + _consoleMode = "attached"; + + logsTabWidget->reattachTab(_consoleIndex); +} + void SeerGdbWidget::setConsoleMode (const QString& mode) { _consoleMode = mode; diff --git a/src/SeerGdbWidget.h b/src/SeerGdbWidget.h index 4bd5976..92df8d5 100644 --- a/src/SeerGdbWidget.h +++ b/src/SeerGdbWidget.h @@ -194,7 +194,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { void readSettings (); public slots: - void handleLogsTabMoved (int from, int to); + void handleLogsTabMoved (int to, int from); void handleLogsTabChanged (int index); void handleRaiseMessageTab (); @@ -358,6 +358,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { void deleteConsole (); void connectConsole (); void disconnectConsole (); + void reattachConsole (); SeerConsoleWidget* console (); void sendGdbInterrupt (int signal); diff --git a/src/SeerMainWindow.cpp b/src/SeerMainWindow.cpp index 6bf33ae..5ab0e24 100644 --- a/src/SeerMainWindow.cpp +++ b/src/SeerMainWindow.cpp @@ -1005,11 +1005,14 @@ void SeerMainWindow::handleText (const QString& text) { return; + }else if (text == "^connected") { + //^connected + return; + }else if (text.startsWith("^connected,frame=")) { //^connected,frame={level=\"0\",addr=\"0x00007f48351f80c1\",func=\"read\",args=[],from=\"/lib64/libc.so.6\",arch=\"i386:x86-64\"}" return; - }else if (text.startsWith("*stopped")) { QString reason_text = Seer::parseFirst(text, "reason=", '"', '"', false); diff --git a/tests/hellogdbserver/README b/tests/hellogdbserver/README new file mode 100644 index 0000000..e78cc59 --- /dev/null +++ b/tests/hellogdbserver/README @@ -0,0 +1,18 @@ +Notes for debugging hellogdbserver with Seer. + +In one terminal, start gdbserver. + + $ gdbserver :1234 hellogdbserver + +In another terminal, start Seer with the project file. + + $ /usr/local/bin/seergdb -xxx -s --project project.seer + + +When exiting Seer, make sure to enter this command into the +gdb command field. Otherwise, the gdbserver process will hang +and you will need to 'kill -9' the gdbserver process. + + (gdb) monitor exit + + From ec6077c4a0f6509be6985729d2836681d7b026e8 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 8 Mar 2025 11:17:01 -0600 Subject: [PATCH 16/16] Add remote target type to connect method (remote or extended-remote). --- CHANGELOG.md | 2 + src/SeerConfigDialog.cpp | 10 ++ src/SeerConfigDialog.h | 3 + src/SeerDebugDialog.cpp | 13 ++ src/SeerDebugDialog.h | 3 + src/SeerDebugDialog.ui | 201 +++++++++++++++---------- src/SeerGdbConfigPage.cpp | 10 ++ src/SeerGdbConfigPage.h | 3 + src/SeerGdbConfigPage.ui | 77 +++++++--- src/SeerGdbWidget.cpp | 23 ++- src/SeerGdbWidget.h | 4 + src/SeerMainWindow.cpp | 14 ++ src/SeerMainWindow.h | 158 +++++++++---------- src/resources/help/ConnectDebugMode.md | 3 + tests/hellogdbserver/project.seer | 3 +- 15 files changed, 346 insertions(+), 181 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 595deeb..be4f7e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ EditorManager. * Fixed regression when order of message tabs not being preserved between sessions. +* Connect mode to a gdb server now supports 'remote' and 'extended-remote'. +* Connect mode's 'pre' commands are executed before the 'target connect'. ## [2.5] - 2024-12-24 * Console now supports a subset of ANSI color codes. diff --git a/src/SeerConfigDialog.cpp b/src/SeerConfigDialog.cpp index a20adf8..8850b83 100644 --- a/src/SeerConfigDialog.cpp +++ b/src/SeerConfigDialog.cpp @@ -230,6 +230,16 @@ bool SeerConfigDialog::gdbEnablePrettyPrinting () const { return _gdbConfigPage->gdbEnablePrettyPrinting(); } +void SeerConfigDialog::setGdbRemoteTargetType (const QString& type) { + + _gdbConfigPage->setGdbRemoteTargetType(type); +} + +QString SeerConfigDialog::gdbRemoteTargetType () const { + + return _gdbConfigPage->gdbRemoteTargetType(); +} + void SeerConfigDialog::setEditorFont (const QFont& font) { _editorConfigPage->setEditorFont(font); diff --git a/src/SeerConfigDialog.h b/src/SeerConfigDialog.h index 75911de..46000e8 100644 --- a/src/SeerConfigDialog.h +++ b/src/SeerConfigDialog.h @@ -61,6 +61,9 @@ class SeerConfigDialog : public QDialog, protected Ui::SeerConfigDialogForm { void setGdbEnablePrettyPrinting (bool flag); bool gdbEnablePrettyPrinting () const; + void setGdbRemoteTargetType (const QString& type); + QString gdbRemoteTargetType () const; + // Editor settings. void setEditorFont (const QFont& font); const QFont& editorFont () const; diff --git a/src/SeerDebugDialog.cpp b/src/SeerDebugDialog.cpp index a0fb154..0642df3 100644 --- a/src/SeerDebugDialog.cpp +++ b/src/SeerDebugDialog.cpp @@ -279,6 +279,14 @@ QString SeerDebugDialog::connectHostPort () const { return connectProgramHostPortLineEdit->text(); } +void SeerDebugDialog::setConnectRemoteTargetType (const QString& type) { + connectRemoteTargetTypeCombo->setCurrentText(type); +} + +QString SeerDebugDialog::connectRemoteTargetType () const { + return connectRemoteTargetTypeCombo->currentText(); +} + void SeerDebugDialog::setRRTraceDirectory (const QString& rrTraceDirectory) { rrTraceDirectoryLineEdit->setText(rrTraceDirectory); } @@ -611,6 +619,10 @@ void SeerDebugDialog::loadProject (const QString& filename, bool notify) { connectProgramHostPortLineEdit->setText(connectModeJson["gdbserver"].toString()); + if (connectModeJson.contains("targettype")) { + connectRemoteTargetTypeCombo->setCurrentText(connectModeJson["targettype"].toString()); + } + setLaunchMode("connect"); } @@ -723,6 +735,7 @@ void SeerDebugDialog::handleSaveProjectToolButton () { QJsonObject modeJson; modeJson["gdbserver"] = connectProgramHostPortLineEdit->text(); + modeJson["targettype"] = connectRemoteTargetTypeCombo->currentText(); seerProjectJson["connectmode"] = modeJson; } diff --git a/src/SeerDebugDialog.h b/src/SeerDebugDialog.h index 6c1fe59..54efaaf 100644 --- a/src/SeerDebugDialog.h +++ b/src/SeerDebugDialog.h @@ -54,6 +54,9 @@ class SeerDebugDialog : public QDialog, protected Ui::SeerDebugDialogForm { // Connectect to a GDB server. "connect". void setConnectHostPort (const QString& connectHostPort); QString connectHostPort () const; + void setConnectRemoteTargetType (const QString& type); + QString connectRemoteTargetType () const; + // Connectect to a RR server. "rr". void setRRTraceDirectory (const QString& rrTraceDirectory); diff --git a/src/SeerDebugDialog.ui b/src/SeerDebugDialog.ui index a749105..08308d5 100644 --- a/src/SeerDebugDialog.ui +++ b/src/SeerDebugDialog.ui @@ -6,8 +6,8 @@ 0 0 - 806 - 1040 + 619 + 845 @@ -593,95 +593,137 @@ Connect - - - - - - - - - Connect to a gdbserver (or similar) session. - - - - - - - Qt::Horizontal - - - - 248 - 20 - - - - - - - - Help for Connect launch method. - - - ... - - - - :/seer/resources/RelaxLightIcons/help-about.svg:/seer/resources/RelaxLightIcons/help-about.svg - - - - + + + + + + + Connect to a gdbserver (or similar) session. + + - - + + - Qt::Vertical + Qt::Horizontal - 20 - 40 + 248 + 20 - - - - - - Gdbserver - - - - - - - - 100 - 0 - - - - How to access the gdbserver. - - - - - - host:port or /dev/serialport - - - true - - - - + + + + Help for Connect launch method. + + + ... + + + + :/seer/resources/RelaxLightIcons/help-about.svg:/seer/resources/RelaxLightIcons/help-about.svg + + + + + + + + Gdbserver + + + + + + + + 100 + 0 + + + + How to access the gdbserver. + + + + + + host:port or /dev/serialport + + + true + + + + + + + Remote target type + + + + + + + + 0 + 0 + + + + Select the type of remote target connection. + + + + remote + + + + + extended-remote + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 468 + 17 + + + + + + + + + + Qt::Vertical + + + + 20 + 151 + + + + @@ -977,7 +1019,6 @@ attachProgramPidLineEdit attachProgramPidToolButton helpConnectToolButton - connectProgramHostPortLineEdit helpRRToolButton rrTraceDirectoryLineEdit rrLoadTraceDirectoryToolButton diff --git a/src/SeerGdbConfigPage.cpp b/src/SeerGdbConfigPage.cpp index 23ee5b1..6800b47 100644 --- a/src/SeerGdbConfigPage.cpp +++ b/src/SeerGdbConfigPage.cpp @@ -53,6 +53,11 @@ bool SeerGdbConfigPage::gdbEnablePrettyPrinting () const { return gdbEnablePrettyPrintingCheckBox->isChecked(); } +QString SeerGdbConfigPage::gdbRemoteTargetType () const { + + return gdbRemoteTargetTypeCombo->currentText(); +} + void SeerGdbConfigPage::setGdbProgram (const QString& program) { gdbProgramLineEdit->setText(program); @@ -88,6 +93,11 @@ void SeerGdbConfigPage::setGdbEnablePrettyPrinting (bool flag) { gdbEnablePrettyPrintingCheckBox->setChecked(flag); } +void SeerGdbConfigPage::setGdbRemoteTargetType (const QString& type) { + + gdbRemoteTargetTypeCombo->setCurrentText(type); +} + void SeerGdbConfigPage::reset () { setGdbProgram("/usr/bin/gdb"); diff --git a/src/SeerGdbConfigPage.h b/src/SeerGdbConfigPage.h index fdc0f56..e187089 100644 --- a/src/SeerGdbConfigPage.h +++ b/src/SeerGdbConfigPage.h @@ -19,6 +19,8 @@ class SeerGdbConfigPage : public QWidget, protected Ui::SeerGdbConfigPage { bool gdbHandleTerminatingException () const; bool gdbRandomizeStartAddress () const; bool gdbEnablePrettyPrinting () const; + QString gdbRemoteTargetType () const; + void setGdbProgram (const QString& program); void setGdbArguments (const QString& arguments); @@ -27,6 +29,7 @@ class SeerGdbConfigPage : public QWidget, protected Ui::SeerGdbConfigPage { void setGdbHandleTerminatingException (bool flag); void setGdbRandomizeStartAddress (bool flag); void setGdbEnablePrettyPrinting (bool flag); + void setGdbRemoteTargetType (const QString& type); void reset (); diff --git a/src/SeerGdbConfigPage.ui b/src/SeerGdbConfigPage.ui index e22df45..6ffc223 100644 --- a/src/SeerGdbConfigPage.ui +++ b/src/SeerGdbConfigPage.ui @@ -6,26 +6,20 @@ 0 0 - 603 - 470 + 788 + 714 SeerGdbConfigPage - - - 0 - - - 0 - - + + Gdb Settings - + @@ -33,7 +27,7 @@ - + Specify the path and name of the gdb debugger. @@ -43,7 +37,7 @@ - + Open a file dialog to locate the gdb debugger. @@ -64,7 +58,7 @@ - + Arguments to pass to the gdb debugger. @@ -74,7 +68,7 @@ - + @@ -128,10 +122,51 @@ + + + + + + Remote target type + + + + + + + Select the type of remote target connection. + + + + remote + + + + + extended-remote + + + + + + + + + + Qt::Horizontal + + + + 385 + 20 + + + + - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -158,13 +193,19 @@ li.checked::marker { content: "\2612"; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace'; color:#24292f; background-color:transparent;"> unwind-on-terminating-exception on|off</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Enabling pretty-printing allows gdb to present certain variables (like std::string) in a pleasing way. Otherwise, the contents of the variables are presented in their full description. (See gdb 'pretty-printing'). Once enabled, it can not be turned off for the Seer session.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When connecting to a gdbserver (or the like), you can set gdb's remote target type to:</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">* remote</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">* extended-remote</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Extended remote is generally suggested but may not be supported by all gdbserver programs. If you experience a slowness starting Seer, try &quot;remote&quot;.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> - gdbGroupBox - textBrowser diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index e60e9fd..d6d8633 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -64,6 +64,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) { _gdbHandleTerminatingException = true; _gdbRandomizeStartAddress = false; _gdbEnablePrettyPrinting = true; + _gdbRemoteTargetType = "extended-remote"; _gdbRecordMode = ""; _gdbRecordDirection = ""; _consoleScrollLines = 1000; @@ -646,6 +647,16 @@ bool SeerGdbWidget::gdbEnablePrettyPrinting () const { return _gdbEnablePrettyPrinting; } +void SeerGdbWidget::setGdbRemoteTargetType (const QString& type) { + + _gdbRemoteTargetType = type; +} + +QString SeerGdbWidget::gdbRemoteTargetType () const { + + return _gdbRemoteTargetType; +} + void SeerGdbWidget::setGdbRecordMode(const QString& mode) { _gdbRecordMode = mode; @@ -1199,12 +1210,16 @@ void SeerGdbWidget::handleGdbConnectExecutable () { setExecutablePid(0); reattachConsole(); - // Connect to the remote gdbserver. - handleGdbCommand(QString("-target-select extended-remote %1").arg(executableConnectHostPort())); - - // Load ithe executable, if needed. + // Load any 'pre' commands. if (newExecutableFlag() == true) { handleGdbExecutablePreCommands(); // Run any 'pre' commands before program is loaded. + } + + // Connect to the remote gdbserver using the proper remote type. + handleGdbCommand(QString("-target-select %1 %2").arg(gdbRemoteTargetType()).arg(executableConnectHostPort())); + + // Load the executable, if needed. + if (newExecutableFlag() == true) { handleGdbExecutableName(); // Load the program into the gdb process. handleGdbExecutableSources(); // Load the program source files. handleGdbExecutableLoadBreakpoints(); // Set the program's breakpoints (if any) before running. diff --git a/src/SeerGdbWidget.h b/src/SeerGdbWidget.h index 92df8d5..186ba03 100644 --- a/src/SeerGdbWidget.h +++ b/src/SeerGdbWidget.h @@ -101,6 +101,9 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { void setGdbEnablePrettyPrinting (bool flag); bool gdbEnablePrettyPrinting () const; + void setGdbRemoteTargetType (const QString& type); + QString gdbRemoteTargetType () const; + void setGdbRecordMode (const QString& mode); QString gdbRecordMode () const; @@ -377,6 +380,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { bool _gdbEnablePrettyPrinting; QString _gdbRecordMode; QString _gdbRecordDirection; + QString _gdbRemoteTargetType; bool _assemblyShowAssemblyTabOnStartup; QString _assemblyDisassemblyFlavor; QString _assemblySymbolDemangling; diff --git a/src/SeerMainWindow.cpp b/src/SeerMainWindow.cpp index 5ab0e24..982f3c2 100644 --- a/src/SeerMainWindow.cpp +++ b/src/SeerMainWindow.cpp @@ -342,6 +342,14 @@ const QString& SeerMainWindow::executableConnectHostPort () const { return gdbWidget->executableConnectHostPort(); } +void SeerMainWindow::setExecutableConnectRemoteTargetType (const QString& type) { + gdbWidget->setGdbRemoteTargetType(type); +} + +QString SeerMainWindow::executableConnectRemoteTargetType () const { + return gdbWidget->gdbRemoteTargetType(); +} + void SeerMainWindow::setExecutableRRTraceDirectory (const QString& executableRRTraceDirectory) { gdbWidget->setExecutableRRTraceDirectory(executableRRTraceDirectory); } @@ -525,6 +533,7 @@ void SeerMainWindow::handleFileDebug () { dlg.setNonStopMode(executableNonStopMode()); dlg.setAttachPid(executablePid()); dlg.setConnectHostPort(executableConnectHostPort()); + dlg.setConnectRemoteTargetType(executableConnectRemoteTargetType()); dlg.setRRTraceDirectory(executableRRTraceDirectory()); dlg.setCoreFilename(executableCoreFilename()); dlg.setPreGdbCommands(executablePreGdbCommands()); @@ -558,6 +567,7 @@ void SeerMainWindow::handleFileDebug () { setExecutableNonStopMode(dlg.nonStopMode()); setExecutablePid(dlg.attachPid()); setExecutableConnectHostPort(dlg.connectHostPort()); + setExecutableConnectRemoteTargetType(dlg.connectRemoteTargetType()); setExecutableRRTraceDirectory(dlg.rrTraceDirectory()); setExecutableCoreFilename(dlg.coreFilename()); setExecutablePreGdbCommands(dlg.preGdbCommands()); @@ -668,6 +678,7 @@ void SeerMainWindow::handleSettingsConfiguration () { dlg.setGdbHandleTerminatingException(gdbWidget->gdbHandleTerminatingException()); dlg.setGdbRandomizeStartAddress(gdbWidget->gdbRandomizeStartAddress()); dlg.setGdbEnablePrettyPrinting(gdbWidget->gdbEnablePrettyPrinting()); + dlg.setGdbRemoteTargetType(gdbWidget->gdbRemoteTargetType()); dlg.setEditorFont(gdbWidget->editorManager()->editorFont()); dlg.setEditorTabSize(gdbWidget->editorManager()->editorTabSize()); dlg.setEditorHighlighterSettings(gdbWidget->editorManager()->editorHighlighterSettings()); @@ -711,6 +722,7 @@ void SeerMainWindow::handleSettingsConfiguration () { gdbWidget->setGdbHandleTerminatingException(dlg.gdbHandleTerminatingException()); gdbWidget->setGdbRandomizeStartAddress(dlg.gdbRandomizeStartAddress()); gdbWidget->setGdbEnablePrettyPrinting(dlg.gdbEnablePrettyPrinting()); + gdbWidget->setGdbRemoteTargetType(dlg.gdbRemoteTargetType()); gdbWidget->editorManager()->setEditorFont(dlg.editorFont()); gdbWidget->editorManager()->setEditorTabSize(dlg.editorTabSize()); gdbWidget->editorManager()->setEditorHighlighterSettings(dlg.editorHighlighterSettings()); @@ -1290,6 +1302,7 @@ void SeerMainWindow::writeConfigSettings () { settings.setValue("handleterminatingexception", gdbWidget->gdbHandleTerminatingException()); settings.setValue("randomizestartaddress", gdbWidget->gdbRandomizeStartAddress()); settings.setValue("enableprettyprinting", gdbWidget->gdbEnablePrettyPrinting()); + settings.setValue("remotetargettype", gdbWidget->gdbRemoteTargetType()); } settings.endGroup(); settings.beginGroup("rr"); { @@ -1366,6 +1379,7 @@ void SeerMainWindow::readConfigSettings () { gdbWidget->setGdbHandleTerminatingException(settings.value("handleterminatingexception", true).toBool()); gdbWidget->setGdbRandomizeStartAddress(settings.value("randomizestartaddress", false).toBool()); gdbWidget->setGdbEnablePrettyPrinting(settings.value("enableprettyprinting", true).toBool()); + gdbWidget->setGdbRemoteTargetType(settings.value("remotetargettype", "extended-remote").toString()); } settings.endGroup(); settings.beginGroup("rr"); { diff --git a/src/SeerMainWindow.h b/src/SeerMainWindow.h index 7ba98a4..4c55b85 100644 --- a/src/SeerMainWindow.h +++ b/src/SeerMainWindow.h @@ -20,90 +20,92 @@ class SeerMainWindow : public QMainWindow, protected Ui::SeerMainWindowForm { SeerMainWindow (QWidget* parent = 0); ~SeerMainWindow (); - void setExecutableName (const QString& executableName); - const QString& executableName () const; - void setExecutableSymbolName (const QString& executableSymbolName); - const QString& executableSymbolName () const; - void setExecutableArguments (const QString& executableArguments); - void setExecutableArguments (const QStringList& executableArguments); - const QString& executableArguments () const; - void setExecutableWorkingDirectory (const QString& executableWorkingDirectory); - const QString& executableWorkingDirectory () const; - void setExecutableBreakpointsFilename (const QString& breakpointsFilename); - const QString& executableBreakpointsFilename () const; - void setExecutableBreakpointFunctionName (const QString& nameoraddress); - const QString& executableBreakpointFunctionName () const; - void setExecutableBreakpointSourceName (const QString& sourceFilenameAndLineno); - const QString& executableBreakpointSourceName () const; - void setExecutableShowAssemblyTab (bool flag); - bool executableShowAssemblyTab () const; - void setExecutableRandomizeStartAddress (bool flag); - bool executableRandomizeStartAddress () const; - void setExecutableNonStopMode (bool flag); - bool executableNonStopMode () const; - void setExecutablePid (int pid); - int executablePid () const; - void setExecutableConnectHostPort (const QString& executableConnectHostPort); - const QString& executableConnectHostPort () const; - void setExecutableRRTraceDirectory (const QString& executableRRTraceDirectory); - const QString& executableRRTraceDirectory () const; - void setExecutableCoreFilename (const QString& executableCoreFilename); - const QString& executableCoreFilename () const; - void setExecutablePreGdbCommands (const QStringList& preGdbCommands); - const QStringList& executablePreGdbCommands () const; - void setExecutablePostGdbCommands (const QStringList& postGdbCommands); - const QStringList& executablePostGdbCommands () const; - void setProjectFilename (const QString& projectFilename); - const QString& projectFilename () const; - void setGdbProgramOverride (const QString& gdbProgram); - QString gdbProgramOverride () const; - void setGdbArgumentsOverride (const QString& gdbProgram); - QString gdbArgumentsOverride () const; + void setExecutableName (const QString& executableName); + const QString& executableName () const; + void setExecutableSymbolName (const QString& executableSymbolName); + const QString& executableSymbolName () const; + void setExecutableArguments (const QString& executableArguments); + void setExecutableArguments (const QStringList& executableArguments); + const QString& executableArguments () const; + void setExecutableWorkingDirectory (const QString& executableWorkingDirectory); + const QString& executableWorkingDirectory () const; + void setExecutableBreakpointsFilename (const QString& breakpointsFilename); + const QString& executableBreakpointsFilename () const; + void setExecutableBreakpointFunctionName (const QString& nameoraddress); + const QString& executableBreakpointFunctionName () const; + void setExecutableBreakpointSourceName (const QString& sourceFilenameAndLineno); + const QString& executableBreakpointSourceName () const; + void setExecutableShowAssemblyTab (bool flag); + bool executableShowAssemblyTab () const; + void setExecutableRandomizeStartAddress (bool flag); + bool executableRandomizeStartAddress () const; + void setExecutableNonStopMode (bool flag); + bool executableNonStopMode () const; + void setExecutablePid (int pid); + int executablePid () const; + void setExecutableConnectHostPort (const QString& executableConnectHostPort); + const QString& executableConnectHostPort () const; + void setExecutableConnectRemoteTargetType (const QString& type); + QString executableConnectRemoteTargetType () const; + void setExecutableRRTraceDirectory (const QString& executableRRTraceDirectory); + const QString& executableRRTraceDirectory () const; + void setExecutableCoreFilename (const QString& executableCoreFilename); + const QString& executableCoreFilename () const; + void setExecutablePreGdbCommands (const QStringList& preGdbCommands); + const QStringList& executablePreGdbCommands () const; + void setExecutablePostGdbCommands (const QStringList& postGdbCommands); + const QStringList& executablePostGdbCommands () const; + void setProjectFilename (const QString& projectFilename); + const QString& projectFilename () const; + void setGdbProgramOverride (const QString& gdbProgram); + QString gdbProgramOverride () const; + void setGdbArgumentsOverride (const QString& gdbProgram); + QString gdbArgumentsOverride () const; - void launchExecutable (const QString& launchMode, const QString& breakMode); - const QString& executableLaunchMode () const; - const QString& executableBreakMode () const; + void launchExecutable (const QString& launchMode, const QString& breakMode); + const QString& executableLaunchMode () const; + const QString& executableBreakMode () const; - void setStyleName (const QString& name); - const QString& styleName (); + void setStyleName (const QString& name); + const QString& styleName (); private slots: - void handleFileDebug (); - void handleFileArguments (); - void handleFileQuit (); - void handleViewMemoryVisualizer (); - void handleViewArrayVisualizer (); - void handleViewStructVisualizer (); - void handleViewVarVisualizer (); - void handleViewImageVisualizer (); - void handleViewAssembly (); - void handleViewAssemblyShown (bool shown); - void handleViewConsoleAttached (); - void handleViewConsoleDetached (); - void handleViewConsoleDetachedMinimized (); - void handleSettingsConfiguration (); - void handleSettingsSaveConfiguration (); - void handleHelpAbout (); - void handleText (const QString& text); - void handleRunStatusChanged (SeerRunStatusIndicator::RunStatus status); - void handleRecordSettingsChanged (); - void handleChangeWindowTitle (QString title); - void handleHelpToolButtonClicked (); - void handleRunExecutable (); - void handleStartExecutable (); - void handleStyleMenuChanged (); - void handleShowMessage (QString message, int time); + void handleFileDebug (); + void handleFileArguments (); + void handleFileQuit (); + void handleViewMemoryVisualizer (); + void handleViewArrayVisualizer (); + void handleViewStructVisualizer (); + void handleViewVarVisualizer (); + void handleViewImageVisualizer (); + void handleViewAssembly (); + void handleViewAssemblyShown (bool shown); + void handleViewConsoleAttached (); + void handleViewConsoleDetached (); + void handleViewConsoleDetachedMinimized (); + void handleSettingsConfiguration (); + void handleSettingsSaveConfiguration (); + void handleHelpAbout (); + void handleText (const QString& text); + void handleRunStatusChanged (SeerRunStatusIndicator::RunStatus status); + void handleRecordSettingsChanged (); + void handleChangeWindowTitle (QString title); + void handleHelpToolButtonClicked (); + void handleRunExecutable (); + void handleStartExecutable (); + void handleStyleMenuChanged (); + void handleShowMessage (QString message, int time); protected: - void writeSettings (); - void readSettings (); - void writeConfigSettings (); - void readConfigSettings (); - void resizeEvent (QResizeEvent* event); - void closeEvent (QCloseEvent* event); - void setKeySettings (const SeerKeySettings& settings); - const SeerKeySettings keySettings () const; - void refreshShortCuts (); + void writeSettings (); + void readSettings (); + void writeConfigSettings (); + void readConfigSettings (); + void resizeEvent (QResizeEvent* event); + void closeEvent (QCloseEvent* event); + void setKeySettings (const SeerKeySettings& settings); + const SeerKeySettings keySettings () const; + void refreshShortCuts (); private: QActionGroup* _styleMenuActionGroup; diff --git a/src/resources/help/ConnectDebugMode.md b/src/resources/help/ConnectDebugMode.md index 33eb6de..504bf17 100644 --- a/src/resources/help/ConnectDebugMode.md +++ b/src/resources/help/ConnectDebugMode.md @@ -13,6 +13,9 @@ In this mode, Seer needs: * Optional executable file if the remote gdbserver/gdbstub hasn't loaded one * Optional symbol file if the executable doesn't have debug information * How to look for the gdbserver (machine and port) +* Remote target type when connecting to the gdbserver. + * 'extended-remote' (default) + * 'remote' (sometimes required if gdbserver doesn't support all commands) * Optional gdb commands to execute before and after Seer connects to the gdbserver ### What can you do? diff --git a/tests/hellogdbserver/project.seer b/tests/hellogdbserver/project.seer index f171f10..c4171a9 100644 --- a/tests/hellogdbserver/project.seer +++ b/tests/hellogdbserver/project.seer @@ -1,7 +1,8 @@ { "seerproject": { "connectmode": { - "gdbserver": ":1234" + "gdbserver": ":1234", + "targettype": "extended-remote" }, "executable": "/nas/erniep/Development/seer/tests/hellogdbserver/hellogdbserver", "postgdbcommands": [