From 64c99f4d59c2d797e75a17a215a94acdff371375 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Thu, 18 Dec 2025 12:52:05 -0600 Subject: [PATCH] First work on showing assembly tab when there's no source file. --- CHANGELOG.md | 1 + src/SeerAssemblyConfigPage.cpp | 10 +- src/SeerAssemblyConfigPage.h | 4 +- src/SeerAssemblyConfigPage.ui | 77 +++- src/SeerConfigDialog.cpp | 8 +- src/SeerConfigDialog.h | 4 +- src/SeerDebugDialog.cpp | 18 +- src/SeerDebugDialog.h | 4 +- src/SeerDebugDialog.ui | 469 ++++++++++--------- src/SeerEditorManagerWidget.cpp | 12 +- src/SeerGdbWidget.cpp | 135 +++--- src/SeerGdbWidget.h | 620 +++++++++++++------------- src/SeerMainWindow.cpp | 16 +- src/SeerMainWindow.h | 4 +- src/SeerStackFramesBrowserWidget.cpp | 35 +- src/SeerThreadFramesBrowserWidget.cpp | 12 +- src/SeerThreadFramesBrowserWidget.h | 1 + src/build/README.cmake | 2 +- src/resources/help/seergdb.hlp | 2 +- src/seergdb.cpp | 8 +- 20 files changed, 792 insertions(+), 650 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cda6d59..d8f9337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * GDB: Add Seer config to set gdb architecture. * GDB: Add an optional 'launcher' program to start gdb. eg: flatpak-spawn. * Build: Add flatpak generation to github actions. +* Assemby: An option to show assembly tab when there is no source file. ## [2.6] - 2025-10-07 * Watchpoints: Fixed regression when adding commands to a watchpoint. diff --git a/src/SeerAssemblyConfigPage.cpp b/src/SeerAssemblyConfigPage.cpp index 0ce3944..a0de79d 100644 --- a/src/SeerAssemblyConfigPage.cpp +++ b/src/SeerAssemblyConfigPage.cpp @@ -20,9 +20,9 @@ SeerAssemblyConfigPage::SeerAssemblyConfigPage(QWidget* parent) : QWidget(parent SeerAssemblyConfigPage::~SeerAssemblyConfigPage() { } -bool SeerAssemblyConfigPage::showAssemblyTabOnStartup () const { +QString SeerAssemblyConfigPage::showAssemblyTabOnStartupMode () const { - return assemblyTabOnStartupCheckBox->isChecked(); + return showAssemblyTabComboBox->currentText(); } bool SeerAssemblyConfigPage::keepAssemblyTabOnTop () const { @@ -93,9 +93,9 @@ int SeerAssemblyConfigPage::disassemblyBytes () const { return pcLengthSpinBox->value(); } -void SeerAssemblyConfigPage::setShowAssemblyTabOnStartup (bool flag) { +void SeerAssemblyConfigPage::setShowAssemblyTabOnStartupMode (const QString& mode) { - assemblyTabOnStartupCheckBox->setChecked(flag); + showAssemblyTabComboBox->setCurrentText(mode); } void SeerAssemblyConfigPage::setKeepAssemblyTabOnTop (bool flag) { @@ -163,7 +163,7 @@ void SeerAssemblyConfigPage::setDisassemblyMode (const QString& mode, int bytes) void SeerAssemblyConfigPage::reset () { - setShowAssemblyTabOnStartup(false); + setShowAssemblyTabOnStartupMode("never"); setKeepAssemblyTabOnTop(true); setDisassemblyFlavor("att"); setSymbolDemagling("on"); diff --git a/src/SeerAssemblyConfigPage.h b/src/SeerAssemblyConfigPage.h index ffc4ed5..be52c10 100644 --- a/src/SeerAssemblyConfigPage.h +++ b/src/SeerAssemblyConfigPage.h @@ -16,7 +16,7 @@ class SeerAssemblyConfigPage : public QWidget, protected Ui::SeerAssemblyConfigP explicit SeerAssemblyConfigPage (QWidget* parent = 0); ~SeerAssemblyConfigPage (); - bool showAssemblyTabOnStartup () const; + QString showAssemblyTabOnStartupMode () const; bool keepAssemblyTabOnTop () const; QString disassemblyFlavor () const; QString symbolDemagling () const; @@ -28,7 +28,7 @@ class SeerAssemblyConfigPage : public QWidget, protected Ui::SeerAssemblyConfigP QString disassemblyMode () const; int disassemblyBytes () const; - void setShowAssemblyTabOnStartup (bool flag); + void setShowAssemblyTabOnStartupMode (const QString& mode); void setKeepAssemblyTabOnTop (bool flag); void setDisassemblyFlavor (const QString& flavor); void setSymbolDemagling (const QString& onoff); diff --git a/src/SeerAssemblyConfigPage.ui b/src/SeerAssemblyConfigPage.ui index 2a66760..8254057 100644 --- a/src/SeerAssemblyConfigPage.ui +++ b/src/SeerAssemblyConfigPage.ui @@ -20,14 +20,49 @@ Assembly Settings - - + + - Show Assembly tab on Seer startup + Show Assembly tab on startup - + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 27 + 20 + + + + + + + + + never + + + + + always + + + + + auto + + + + + Qt::Horizontal @@ -47,7 +82,7 @@ - + Qt::Horizontal @@ -119,7 +154,7 @@ - + Qt::Horizontal @@ -178,7 +213,7 @@ - + Qt::Horizontal @@ -299,7 +334,7 @@ - + Qt::Horizontal @@ -377,7 +412,7 @@ - + Qt::Horizontal @@ -400,12 +435,20 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css"> p, li { white-space: pre-wrap; } +hr { height: 1px; border-width: 0; } +li.unchecked::marker { content: "\2610"; } +li.checked::marker { content: "\2612"; } </style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Set various Assembly and Register settings.</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;"><span style=" background-color:transparent;">Seer can show the program's assembly as a tab in the Code Manager. The Assembly tab can be shown automatically when Seer starts, or it can always be shown with:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:transparent;">Seer can show the program's assembly as a tab in the Code Manager. The Assembly tab can be shown automatically when Seer starts. There are these start up modes.</span></p> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"> +<li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Never. Seer won't show the assembly tab at start up.</li> +<li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Always. Seer will always show the assembly tab.</li> +<li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Auto. Seer will show the the assembly tab if there is no source file to show.</li></ul> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:transparent;">The assembly tab can always be shown with:</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;"><span style=" font-family:'Monospace';"> View-&gt;Assembly View</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; font-family:'Monospace';"><br /></p> @@ -421,15 +464,18 @@ p, li { white-space: pre-wrap; } <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; font-family:'Monospace';"><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; font-family:'Monospace';"><br /></p> <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:'Monospace';">The Assembly Editor can show different columns along side the assembly. These can be quickly changed in the Assembly Editor using ^F.</span></p> -<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Address</li> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"> +<li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Address</li> <li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Offset</li> <li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Opcode</li> <li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Source</li></ul> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The Assembly Editor does its best to show relevant assembly. This means setting the 'start' and 'end' address of the disassembly. There are two modes.</p> -<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Function - The start and end address is defined by the function the current $PC is in. Needs debug information. Otherwise, a blank editor is shown.</li> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"> +<li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Function - The start and end address is defined by the function the current $PC is in. Needs debug information. Otherwise, a blank editor is shown.</li> <li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Length - A number of bytes after the current $PC is shown.</li></ul> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:transparent;">In the Register browser, register values can be shown in various formats:</span></p> -<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style="" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:transparent;">Natural (A predefined format, based on the register name)</span></li> +<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"> +<li style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:transparent;">Natural (A predefined format, based on the register name)</span></li> <li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hex</li> <li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Octal</li> <li style=" background-color:transparent;" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Binary</li> @@ -443,7 +489,6 @@ p, li { white-space: pre-wrap; } printPointGroupBox - assemblyTabOnStartupCheckBox assemblyTabOnTopCheckBox attFlavorRadioButton intelFlavorRadioButton @@ -461,7 +506,7 @@ p, li { white-space: pre-wrap; } - + diff --git a/src/SeerConfigDialog.cpp b/src/SeerConfigDialog.cpp index 8909a2c..a5a82d0 100644 --- a/src/SeerConfigDialog.cpp +++ b/src/SeerConfigDialog.cpp @@ -364,14 +364,14 @@ QStringList SeerConfigDialog::sourceHeaderFilePatterns () const { return _sourceConfigPage->headerFilePatterns(); } -void SeerConfigDialog::setAssemblyShowAssemblyTabOnStartup (bool flag) { +void SeerConfigDialog::setAssemblyShowAssemblyTabOnStartupMode (const QString& mode) { - _assemblyConfigPage->setShowAssemblyTabOnStartup(flag); + _assemblyConfigPage->setShowAssemblyTabOnStartupMode(mode); } -bool SeerConfigDialog::assemblyShowAssemblyTabOnStartup () const { +QString SeerConfigDialog::assemblyShowAssemblyTabOnStartupMode () const { - return _assemblyConfigPage->showAssemblyTabOnStartup(); + return _assemblyConfigPage->showAssemblyTabOnStartupMode(); } void SeerConfigDialog::setAssemblyKeepAssemblyTabOnTop (bool flag) { diff --git a/src/SeerConfigDialog.h b/src/SeerConfigDialog.h index 37b8680..2fa9e1f 100644 --- a/src/SeerConfigDialog.h +++ b/src/SeerConfigDialog.h @@ -108,8 +108,8 @@ class SeerConfigDialog : public QDialog, protected Ui::SeerConfigDialogForm { QStringList sourceHeaderFilePatterns () const; // Assembly settings. - void setAssemblyShowAssemblyTabOnStartup (bool flag); - bool assemblyShowAssemblyTabOnStartup () const; + void setAssemblyShowAssemblyTabOnStartupMode (const QString& mode); + QString assemblyShowAssemblyTabOnStartupMode () const; void setAssemblyKeepAssemblyTabOnTop (bool flag); bool assemblyKeepAssemblyTabOnTop () const; diff --git a/src/SeerDebugDialog.cpp b/src/SeerDebugDialog.cpp index 39b4beb..aea429f 100644 --- a/src/SeerDebugDialog.cpp +++ b/src/SeerDebugDialog.cpp @@ -103,7 +103,7 @@ void SeerDebugDialog::reset () { setBreakpointFunctionName(""); setBreakpointSourceName(""); setBreakpointMode("inmain"); - setShowAssemblyTab(false); + setShowAssemblyTabMode("never"); setRandomizeStartAddress(false); setNonStopMode(false); setPreGdbCommands(QStringList()); @@ -237,12 +237,12 @@ QString SeerDebugDialog::breakpointSourceName () const { return breakpointAtSourceLineEdit->text(); } -void SeerDebugDialog::setShowAssemblyTab (bool flag) { - showAsseblyTabCheckBox->setChecked(flag); +void SeerDebugDialog::setShowAssemblyTabMode (const QString& mode) { + showAssemblyTabComboBox->setCurrentText(mode); } -bool SeerDebugDialog::showAssemblyTab () const { - return showAsseblyTabCheckBox->isChecked(); +QString SeerDebugDialog::showAssemblyTabMode () const { + return showAssemblyTabComboBox->currentText(); } void SeerDebugDialog::setRandomizeStartAddress (bool flag) { @@ -585,7 +585,7 @@ QJsonDocument SeerDebugDialog::makeJsonDoc() const { modeJson["breakinmain"] = breakpointInMainRadioButton->isChecked(); modeJson["breakinfunction"] = breakpointInFunctionRadioButton->isChecked(); modeJson["breakinfunctionname"] = breakpointInFunctionLineEdit->text(); - modeJson["showassemblytab"] = showAsseblyTabCheckBox->isChecked(); + modeJson["showassemblytabmode"] = showAssemblyTabComboBox->currentText(); modeJson["nonstopmode"] = nonStopModeCheckBox->isChecked(); modeJson["randomizestartaddress"] = randomizeStartAddressCheckBox->isChecked(); @@ -603,7 +603,7 @@ QJsonDocument SeerDebugDialog::makeJsonDoc() const { modeJson["breakinmain"] = breakpointInMainRadioButton->isChecked(); modeJson["breakinfunction"] = breakpointInFunctionRadioButton->isChecked(); modeJson["breakinfunctionname"] = breakpointInFunctionLineEdit->text(); - modeJson["showassemblytab"] = showAsseblyTabCheckBox->isChecked(); + modeJson["showassemblytabmode"] = showAssemblyTabComboBox->currentText(); modeJson["nonstopmode"] = nonStopModeCheckBox->isChecked(); modeJson["randomizestartaddress"] = randomizeStartAddressCheckBox->isChecked(); @@ -749,7 +749,7 @@ bool SeerDebugDialog::loadJsonDoc (const QJsonDocument& jsonDoc, const QString& } breakpointInFunctionLineEdit->setText(runModeJson["breakinfunctionname"].toString()); - showAsseblyTabCheckBox->setChecked(runModeJson["showassemblytab"].toBool()); + showAssemblyTabComboBox->setCurrentText(runModeJson["showassemblytabmode"].toString()); nonStopModeCheckBox->setChecked(runModeJson["nonstopmode"].toBool()); randomizeStartAddressCheckBox->setChecked(runModeJson["randomizestartaddress"].toBool()); @@ -774,7 +774,7 @@ bool SeerDebugDialog::loadJsonDoc (const QJsonDocument& jsonDoc, const QString& } breakpointInFunctionLineEdit->setText(startModeJson["breakinfunctionname"].toString()); - showAsseblyTabCheckBox->setChecked(startModeJson["showassemblytab"].toBool()); + showAssemblyTabComboBox->setCurrentText(startModeJson["showassemblytabmode"].toString()); nonStopModeCheckBox->setChecked(startModeJson["nonstopmode"].toBool()); randomizeStartAddressCheckBox->setChecked(startModeJson["randomizestartaddress"].toBool()); diff --git a/src/SeerDebugDialog.h b/src/SeerDebugDialog.h index 956a2af..d480369 100644 --- a/src/SeerDebugDialog.h +++ b/src/SeerDebugDialog.h @@ -44,8 +44,8 @@ class SeerDebugDialog : public QDialog, protected Ui::SeerDebugDialogForm { QString breakpointFunctionName () const; void setBreakpointSourceName (const QString& sourceFilenameAndLineno); QString breakpointSourceName () const; - void setShowAssemblyTab (bool flag); - bool showAssemblyTab () const; + void setShowAssemblyTabMode (const QString& mode); + QString showAssemblyTabMode () const; void setRandomizeStartAddress (bool flag); bool randomizeStartAddress () const; void setNonStopMode (bool flag); diff --git a/src/SeerDebugDialog.ui b/src/SeerDebugDialog.ui index f075ad2..1d24860 100644 --- a/src/SeerDebugDialog.ui +++ b/src/SeerDebugDialog.ui @@ -6,177 +6,15 @@ 0 0 - 619 - 856 + 758 + 849 Select Executable to Debug - - - - - Executable Name - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - - - - - - - 0 - 0 - - - - The path and name of an executable to debug. - - - The path and name of an executable to debug. - - - true - - - - - - - - 0 - 0 - - - - Open a dialog to select an executable. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - - - - - - - - - - - Symbol File Name - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - false - - - - - - - - - 0 - 0 - - - - Optional path and name of a symbol file for the executable. - - - Optional path and name of a symbol file for the executable. - - - true - - - - - - - - 0 - 0 - - - - Open a dialog to select the symbol file for the executable. - - - - - - - :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg - - - - - - - - - - - - - - - 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 - - - - - - - - - + + @@ -187,38 +25,8 @@ Launch Method - - - - - - - - 0 - 40 - - - - - - - - - - - - 0 - 40 - - - - - - - - - - + + @@ -227,7 +35,7 @@ - 4 + 0 @@ -441,16 +249,6 @@ - - - - Show Assembly tab at startup. - - - Show Assembly tab - - - @@ -486,6 +284,64 @@ + + + + + + + 0 + 0 + + + + Show Assembly tab on startup + + + + + + + + 0 + 0 + + + + + never + + + + + always + + + + + auto + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 385 + 23 + + + + + + @@ -1001,10 +857,144 @@ + + + + + + + 0 + 40 + + + + + + + + + + + + 0 + 40 + + + + + + + + + - + + + + + + + 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 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + false + + + + + + + + + 0 + 0 + + + + The path and name of an executable to debug. + + + The path and name of an executable to debug. + + + true + + + + + + + + 0 + 0 + + + + Open a dialog to select an executable. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + + + + + Qt::Horizontal @@ -1014,6 +1004,64 @@ + + + + Symbol File Name + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + false + + + + + + + + + 0 + 0 + + + + Optional path and name of a symbol file for the executable. + + + Optional path and name of a symbol file for the executable. + + + true + + + + + + + + 0 + 0 + + + + Open a dialog to select the symbol file for the executable. + + + + + + + :/seer/resources/RelaxLightIcons/document-open.svg:/seer/resources/RelaxLightIcons/document-open.svg + + + + + + + + executableNameGroupBox buttonBox @@ -1039,7 +1087,6 @@ breakpointAtSourceRadioButton breakpointAtSourceLineEdit noBreakpointRadioButton - showAsseblyTabCheckBox nonStopModeCheckBox randomizeStartAddressCheckBox preCommandsPlainTextEdit diff --git a/src/SeerEditorManagerWidget.cpp b/src/SeerEditorManagerWidget.cpp index ba1d62e..16c7b0c 100644 --- a/src/SeerEditorManagerWidget.cpp +++ b/src/SeerEditorManagerWidget.cpp @@ -835,16 +835,24 @@ void SeerEditorManagerWidget::handleOpenAddress (const QString& address) { return; } + qDebug() << address; + // Get the AssemblyWidget so the address can be loaded. Return if there is no widget. SeerEditorWidgetAssembly* assemblyWidget = assemblyWidgetTab(); + // Create assembly widget, if allowed. + if (assemblyWidget == 0) { + assemblyWidget = createAssemblyWidgetTab(); + } + + // No assembly widget, return. if (assemblyWidget == 0) { return; } - //qDebug() << address; - + // Update assembly widget. assemblyWidget->assemblyArea()->setAddress(address); + assemblyWidget->reloadRegisters(); } SeerEditorWidgetSource* SeerEditorManagerWidget::currentEditorWidgetTab () { diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index c02b499..e8a026b 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -42,53 +42,53 @@ static QLoggingCategory LC("seer.gdbwidget"); SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) { - _executableName = ""; - _executableArguments = ""; - _executableWorkingDirectory = ""; - _executableBreakpointsFilename = ""; - _executableBreakpointFunctionName = ""; - _executableConnectHostPort = ""; - _executableRRTraceDirectory = ""; - _executableCoreFilename = ""; - _executablePid = 0; + _executableName = ""; + _executableArguments = ""; + _executableWorkingDirectory = ""; + _executableBreakpointsFilename = ""; + _executableBreakpointFunctionName = ""; + _executableConnectHostPort = ""; + _executableRRTraceDirectory = ""; + _executableCoreFilename = ""; + _executablePid = 0; - _gdbMonitor = 0; - _gdbProcess = 0; - _consoleWidget = 0; - _consoleIndex = -1; - _breakpointsBrowserWidget = 0; - _watchpointsBrowserWidget = 0; - _catchpointsBrowserWidget = 0; - _gdbOutputLog = 0; - _seerOutputLog = 0; + _gdbMonitor = 0; + _gdbProcess = 0; + _consoleWidget = 0; + _consoleIndex = -1; + _breakpointsBrowserWidget = 0; + _watchpointsBrowserWidget = 0; + _catchpointsBrowserWidget = 0; + _gdbOutputLog = 0; + _seerOutputLog = 0; #ifdef SEER_GDB_NAME - _gdbProgram = STRINGIFY(SEER_GDB_NAME); + _gdbProgram = STRINGIFY(SEER_GDB_NAME); #else - _gdbProgram = "/usr/bin/gdb"; + _gdbProgram = "/usr/bin/gdb"; #endif #ifdef SEER_GDB_LAUNCHER - _gdbLauncher = STRINGIFY(SEER_GDB_LAUNCHER); + _gdbLauncher = STRINGIFY(SEER_GDB_LAUNCHER); #else - _gdbLauncher = ""; + _gdbLauncher = ""; #endif - _gdbArguments = "--interpreter=mi"; - _gdbASyncMode = true; - _gdbNonStopMode = false; - _gdbServerDebug = false; - _assemblyShowAssemblyTabOnStartup = false; - _assemblyDisassemblyFlavor = "att"; - _gdbHandleTerminatingException = true; - _gdbRandomizeStartAddress = false; - _gdbEnablePrettyPrinting = true; - _gdbRemoteTargetType = "extended-remote"; - _gdbRecordMode = ""; - _gdbRecordDirection = ""; - _consoleScrollLines = 1000; - _rememberManualCommandCount = 10; - _currentFrame = -1; + _gdbArguments = "--interpreter=mi"; + _gdbASyncMode = true; + _gdbNonStopMode = false; + _gdbServerDebug = false; + _assemblyShowAssemblyTabOnStartupMode = "never"; + _assemblyDisassemblyFlavor = "att"; + _gdbHandleTerminatingException = true; + _gdbRandomizeStartAddress = false; + _gdbEnablePrettyPrinting = true; + _gdbRemoteTargetType = "extended-remote"; + _gdbRecordMode = ""; + _gdbRecordDirection = ""; + _consoleScrollLines = 1000; + _rememberManualCommandCount = 10; + _currentFrame = -1; setIsQuitting(false); setNewExecutableFlag(true); @@ -305,6 +305,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) { QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::refreshThreadIds, this, &SeerGdbWidget::handleGdbThreadListIds); QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::refreshThreadFrames, this, &SeerGdbWidget::handleGdbThreadListFrames); QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::selectedFile, editorManagerWidget, &SeerEditorManagerWidget::handleOpenFile); + QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::selectedAddress, editorManagerWidget, &SeerEditorManagerWidget::handleOpenAddress); QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::selectedThread, this, &SeerGdbWidget::handleGdbThreadSelectId); QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::nextThreadId, this, &SeerGdbWidget::handleGdbNextThreadId); QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::stepThreadId, this, &SeerGdbWidget::handleGdbStepThreadId); @@ -1167,7 +1168,7 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode, bool loadS handleGdbAssemblyDisassemblyFlavor(); // Set the disassembly flavor to use. handleGdbAssemblySymbolDemangling(); // Set the symbol demangling. - if (assemblyShowAssemblyTabOnStartup()) { + if (assemblyShowAssemblyTabOnStartupMode() == "always") { editorManager()->showAssembly(); } @@ -1311,7 +1312,7 @@ void SeerGdbWidget::handleGdbAttachExecutable (bool loadSessionBreakpoints) { handleGdbAssemblyDisassemblyFlavor(); // Set the disassembly flavor to use. handleGdbAssemblySymbolDemangling(); // Set the symbol demangling. - if (assemblyShowAssemblyTabOnStartup()) { + if (assemblyShowAssemblyTabOnStartupMode() == "always") { editorManager()->showAssembly(); } @@ -1429,7 +1430,7 @@ void SeerGdbWidget::handleGdbConnectExecutable (bool loadSessionBreakpoints) { handleGdbAssemblyDisassemblyFlavor(); // Set the disassembly flavor to use. handleGdbAssemblySymbolDemangling(); // Set the symbol demangling. - if (assemblyShowAssemblyTabOnStartup()) { + if (assemblyShowAssemblyTabOnStartupMode() == "always") { editorManager()->showAssembly(); } @@ -1540,7 +1541,7 @@ void SeerGdbWidget::handleGdbRRExecutable (bool loadSessionBreakpoints) { handleGdbAssemblyDisassemblyFlavor(); // Set the disassembly flavor to use. handleGdbAssemblySymbolDemangling(); // Set the symbol demangling. - if (assemblyShowAssemblyTabOnStartup()) { + if (assemblyShowAssemblyTabOnStartupMode() == "always") { editorManager()->showAssembly(); } @@ -1649,7 +1650,7 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () { handleGdbAssemblyDisassemblyFlavor(); // Set the disassembly flavor to use. handleGdbAssemblySymbolDemangling(); // Set the symbol demangling. - if (assemblyShowAssemblyTabOnStartup()) { + if (assemblyShowAssemblyTabOnStartupMode() == "always") { editorManager()->showAssembly(); } } @@ -3493,17 +3494,17 @@ void SeerGdbWidget::writeSettings () { } settings.endArray(); settings.beginGroup("assembly"); { - settings.setValue("showassemblytabonstartup", assemblyShowAssemblyTabOnStartup()); - settings.setValue("keepassemblytabontop", assemblyKeepAssemblyTabOnTop()); - settings.setValue("assemblydisassemblyflavor", assemblyDisassemblyFlavor()); - settings.setValue("assemblysymboldemagling", assemblySymbolDemagling()); - settings.setValue("assemblyregisterformat", assemblyRegisterFormat()); - settings.setValue("assemblyshowaddresscolumn", assemblyShowAddressColumn()); - settings.setValue("assemblyshowoffsetcolumn", assemblyShowOffsetColumn()); - settings.setValue("assemblyshowopcodecolumn", assemblyShowOpcodeColumn()); - settings.setValue("assemblyshowsourcelines", assemblyShowSourceLines()); - settings.setValue("assemblydisassemblymode", assemblyDisassemblyMode()); - settings.setValue("assemblydisassemblybytes", assemblyDisassemblyBytes()); + settings.setValue("showassemblytabonstartupmode", assemblyShowAssemblyTabOnStartupMode()); + settings.setValue("keepassemblytabontop", assemblyKeepAssemblyTabOnTop()); + settings.setValue("assemblydisassemblyflavor", assemblyDisassemblyFlavor()); + settings.setValue("assemblysymboldemagling", assemblySymbolDemagling()); + settings.setValue("assemblyregisterformat", assemblyRegisterFormat()); + settings.setValue("assemblyshowaddresscolumn", assemblyShowAddressColumn()); + settings.setValue("assemblyshowoffsetcolumn", assemblyShowOffsetColumn()); + settings.setValue("assemblyshowopcodecolumn", assemblyShowOpcodeColumn()); + settings.setValue("assemblyshowsourcelines", assemblyShowSourceLines()); + settings.setValue("assemblydisassemblymode", assemblyDisassemblyMode()); + settings.setValue("assemblydisassemblybytes", assemblyDisassemblyBytes()); } settings.endGroup(); settings.beginGroup("gdboutputlog"); { @@ -3612,16 +3613,16 @@ void SeerGdbWidget::readSettings () { } settings.beginGroup("assembly"); { - setAssemblyShowAssemblyTabOnStartup( settings.value("showassemblytabonstartup", false).toBool()); - setAssemblyKeepAssemblyTabOnTop( settings.value("keepassemblytabontop", true).toBool()); - setAssemblyDisassemblyFlavor( settings.value("assemblydisassemblyflavor", "att").toString()); - setAssemblySymbolDemagling( settings.value("assemblysymboldemagling", "on").toString()); - setAssemblyRegisterFormat( settings.value("assemblyregisterformat", "Natural").toString()); - setAssemblyShowAddressColumn( settings.value("assemblyshowaddresscolumn", true).toBool()); - setAssemblyShowOffsetColumn( settings.value("assemblyshowoffsetcolumn", false).toBool()); - setAssemblyShowOpcodeColumn( settings.value("assemblyshowopcodecolumn", false).toBool()); - setAssemblyShowSourceLines( settings.value("assemblyshowsourcelines", false).toBool()); - setAssemblyDisassemblyMode( settings.value("assemblydisassemblymode", "function").toString(), settings.value("assemblydisassemblybytes", "256").toInt()); + setAssemblyShowAssemblyTabOnStartupMode( settings.value("showassemblytabonstartupmode", "never").toString()); + setAssemblyKeepAssemblyTabOnTop( settings.value("keepassemblytabontop", true).toBool()); + setAssemblyDisassemblyFlavor( settings.value("assemblydisassemblyflavor", "att").toString()); + setAssemblySymbolDemagling( settings.value("assemblysymboldemagling", "on").toString()); + setAssemblyRegisterFormat( settings.value("assemblyregisterformat", "Natural").toString()); + setAssemblyShowAddressColumn( settings.value("assemblyshowaddresscolumn", true).toBool()); + setAssemblyShowOffsetColumn( settings.value("assemblyshowoffsetcolumn", false).toBool()); + setAssemblyShowOpcodeColumn( settings.value("assemblyshowopcodecolumn", false).toBool()); + setAssemblyShowSourceLines( settings.value("assemblyshowsourcelines", false).toBool()); + setAssemblyDisassemblyMode( settings.value("assemblydisassemblymode", "function").toString(), settings.value("assemblydisassemblybytes", "256").toInt()); } settings.endGroup(); settings.beginGroup("gdboutputlog"); { @@ -4022,14 +4023,14 @@ const QStringList& SeerGdbWidget::sourceIgnoreFilePatterns () const { return _ignoreFilePatterns; } -void SeerGdbWidget::setAssemblyShowAssemblyTabOnStartup (bool flag) { +void SeerGdbWidget::setAssemblyShowAssemblyTabOnStartupMode (const QString& mode) { - _assemblyShowAssemblyTabOnStartup = flag; + _assemblyShowAssemblyTabOnStartupMode = mode; } -bool SeerGdbWidget::assemblyShowAssemblyTabOnStartup () const { +QString SeerGdbWidget::assemblyShowAssemblyTabOnStartupMode () const { - return _assemblyShowAssemblyTabOnStartup; + return _assemblyShowAssemblyTabOnStartupMode; } void SeerGdbWidget::setAssemblyKeepAssemblyTabOnTop (bool flag) { diff --git a/src/SeerGdbWidget.h b/src/SeerGdbWidget.h index 181c828..12cef54 100644 --- a/src/SeerGdbWidget.h +++ b/src/SeerGdbWidget.h @@ -29,395 +29,395 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { explicit SeerGdbWidget (QWidget* parent = 0); ~SeerGdbWidget (); - GdbMonitor* gdbMonitor (); - QProcess* gdbProcess (); + GdbMonitor* gdbMonitor (); + QProcess* gdbProcess (); - void setExecutableName (const QString& executableName); - const QString& executableName () const; + void setExecutableName (const QString& executableName); + const QString& executableName () const; - void setExecutableSymbolName (const QString& executableSymbolName); - const QString& executableSymbolName () const; + void setExecutableSymbolName (const QString& executableSymbolName); + const QString& executableSymbolName () const; - void setNewExecutableFlag (bool flag); - bool newExecutableFlag () const; + void setNewExecutableFlag (bool flag); + bool newExecutableFlag () const; - void setExecutableArguments (const QString& executableArguments); - const QString& executableArguments () const; + void setExecutableArguments (const QString& executableArguments); + const QString& executableArguments () const; - void setExecutableWorkingDirectory (const QString& executableWorkingDirectory); - const QString& executableWorkingDirectory () const; + void setExecutableWorkingDirectory (const QString& executableWorkingDirectory); + const QString& executableWorkingDirectory () const; - void setExecutableBreakpointsFilename (const QString& breakpointsFilename); - const QString& executableBreakpointsFilename () const; + void setExecutableBreakpointsFilename (const QString& breakpointsFilename); + const QString& executableBreakpointsFilename () const; - void setExecutableBreakpointFunctionName (const QString& nameoraddress); - const QString& executableBreakpointFunctionName () const; + void setExecutableBreakpointFunctionName (const QString& nameoraddress); + const QString& executableBreakpointFunctionName () const; - void setExecutableBreakpointSourceName (const QString& sourceFilenameAndLineno); - const QString& executableBreakpointSourceName () const; + void setExecutableBreakpointSourceName (const QString& sourceFilenameAndLineno); + const QString& executableBreakpointSourceName () const; - void setExecutablePid (int pid); - int executablePid () const; + void setExecutablePid (int pid); + int executablePid () const; - void setExecutableConnectHostPort (const QString& connectHostPort); - const QString& executableConnectHostPort () const; + void setExecutableConnectHostPort (const QString& connectHostPort); + const QString& executableConnectHostPort () const; - void setExecutableRRTraceDirectory (const QString& rrTraceDirectory); - const QString& executableRRTraceDirectory () const; + void setExecutableRRTraceDirectory (const QString& rrTraceDirectory); + const QString& executableRRTraceDirectory () const; - void setExecutableCoreFilename (const QString& coreFilename); - const QString& executableCoreFilename () const; + void setExecutableCoreFilename (const QString& coreFilename); + const QString& executableCoreFilename () const; - void setExecutablePreGdbCommands (const QStringList& preGdbCommands); - const QStringList& executablePreGdbCommands () const; + void setExecutablePreGdbCommands (const QStringList& preGdbCommands); + const QStringList& executablePreGdbCommands () const; - void setExecutablePostGdbCommands (const QStringList& postGdbCommands); - const QStringList& executablePostGdbCommands () const; + void setExecutablePostGdbCommands (const QStringList& postGdbCommands); + const QStringList& executablePostGdbCommands () const; - void setExecutableLaunchMode (const QString& launchMode); - const QString& executableLaunchMode () const; - const QString& executableBreakMode () const; + void setExecutableLaunchMode (const QString& launchMode); + const QString& executableLaunchMode () const; + const QString& executableBreakMode () const; // Gdb settings. - void setGdbLauncher (const QString& launchProgram); - QString gdbLauncher () const; + void setGdbLauncher (const QString& launchProgram); + QString gdbLauncher () const; - void setGdbProgram (const QString& program); - QString gdbProgram () const; + void setGdbProgram (const QString& program); + QString gdbProgram () const; - void setGdbArguments (const QString& arguments); - QString gdbArguments () const; + void setGdbArguments (const QString& arguments); + QString gdbArguments () const; - void setGdbProgramOverride (const QString& program); - QString gdbProgramOverride () const; + void setGdbProgramOverride (const QString& program); + QString gdbProgramOverride () const; - void setGdbArgumentsOverride (const QString& arguments); - QString gdbArgumentsOverride () const; + void setGdbArgumentsOverride (const QString& arguments); + QString gdbArgumentsOverride () const; - void setGdbAsyncMode (bool flag); - bool gdbAsyncMode () const; + void setGdbAsyncMode (bool flag); + bool gdbAsyncMode () const; - void setGdbNonStopMode (bool flag); - bool gdbNonStopMode () const; + void setGdbNonStopMode (bool flag); + bool gdbNonStopMode () const; - void setGdbServerDebug (bool flag); - bool gdbServerDebug () const; + void setGdbServerDebug (bool flag); + bool gdbServerDebug () const; - void setGdbHandleTerminatingException (bool flag); - bool gdbHandleTerminatingException () const; + void setGdbHandleTerminatingException (bool flag); + bool gdbHandleTerminatingException () const; - void setGdbRandomizeStartAddress (bool flag); - bool gdbRandomizeStartAddress () const; + void setGdbRandomizeStartAddress (bool flag); + bool gdbRandomizeStartAddress () const; - void setGdbEnablePrettyPrinting (bool flag); - bool gdbEnablePrettyPrinting () const; + void setGdbEnablePrettyPrinting (bool flag); + bool gdbEnablePrettyPrinting () const; - void setGdbRemoteTargetType (const QString& type); - QString gdbRemoteTargetType () const; + void setGdbRemoteTargetType (const QString& type); + QString gdbRemoteTargetType () const; - void setGdbArchitectureType (const QString& type); - QString gdbArchitectureType () const; + void setGdbArchitectureType (const QString& type); + QString gdbArchitectureType () const; - void setGdbRecordMode (const QString& mode); - QString gdbRecordMode () const; + void setGdbRecordMode (const QString& mode); + QString gdbRecordMode () const; - void setGdbRecordDirection (const QString& direction); - QString gdbRecordDirection () const; + void setGdbRecordDirection (const QString& direction); + QString gdbRecordDirection () const; - void setConsoleMode (const QString& mode); - QString consoleMode () const; + void setConsoleMode (const QString& mode); + QString consoleMode () const; - void setConsoleScrollLines (int count); - int consoleScrollLines () const; + void setConsoleScrollLines (int count); + int consoleScrollLines () const; - void setManualCommands (const QStringList& commands); - QStringList manualCommands (int count) const; + void setManualCommands (const QStringList& commands); + QStringList manualCommands (int count) const; - void setRememberManualCommandCount (int count); - int rememberManualCommandCount () const; - void clearManualCommandHistory (); + void setRememberManualCommandCount (int count); + int rememberManualCommandCount () const; + void clearManualCommandHistory (); - void setSourceAlternateDirectories (const QStringList& alternateDirectories); - const QStringList& sourceAlternateDirectories () const; + void setSourceAlternateDirectories (const QStringList& alternateDirectories); + const QStringList& sourceAlternateDirectories () const; - void setSourceMiscFilePatterns (const QStringList& filePatterns); - const QStringList& sourceMiscFilePatterns () const; + void setSourceMiscFilePatterns (const QStringList& filePatterns); + const QStringList& sourceMiscFilePatterns () const; - void setSourceSourceFilePatterns (const QStringList& filePatterns); - const QStringList& sourceSourceFilePatterns () const; + void setSourceSourceFilePatterns (const QStringList& filePatterns); + const QStringList& sourceSourceFilePatterns () const; - void setSourceHeaderFilePatterns (const QStringList& filePatterns); - const QStringList& sourceHeaderFilePatterns () const; + void setSourceHeaderFilePatterns (const QStringList& filePatterns); + const QStringList& sourceHeaderFilePatterns () const; - void setSourceIgnoreFilePatterns (const QStringList& filePatterns); - const QStringList& sourceIgnoreFilePatterns () const; + void setSourceIgnoreFilePatterns (const QStringList& filePatterns); + const QStringList& sourceIgnoreFilePatterns () const; - void setAssemblyShowAssemblyTabOnStartup (bool flag); - bool assemblyShowAssemblyTabOnStartup () const; + void setAssemblyShowAssemblyTabOnStartupMode (const QString& mode); + QString assemblyShowAssemblyTabOnStartupMode () const; - void setAssemblyKeepAssemblyTabOnTop (bool flag); - bool assemblyKeepAssemblyTabOnTop () const; + void setAssemblyKeepAssemblyTabOnTop (bool flag); + bool assemblyKeepAssemblyTabOnTop () const; - void setAssemblyDisassemblyFlavor (const QString& flavor); - QString assemblyDisassemblyFlavor () const; + void setAssemblyDisassemblyFlavor (const QString& flavor); + QString assemblyDisassemblyFlavor () const; - void setAssemblySymbolDemagling (const QString& onoff); - QString assemblySymbolDemagling () const; + void setAssemblySymbolDemagling (const QString& onoff); + QString assemblySymbolDemagling () const; - void setAssemblyShowAddressColumn (bool flag); - bool assemblyShowAddressColumn () const; + void setAssemblyShowAddressColumn (bool flag); + bool assemblyShowAddressColumn () const; - void setAssemblyShowOffsetColumn (bool flag); - bool assemblyShowOffsetColumn () const; + void setAssemblyShowOffsetColumn (bool flag); + bool assemblyShowOffsetColumn () const; - void setAssemblyShowOpcodeColumn (bool flag); - bool assemblyShowOpcodeColumn () const; + void setAssemblyShowOpcodeColumn (bool flag); + bool assemblyShowOpcodeColumn () const; - void setAssemblyShowSourceLines (bool flag); - bool assemblyShowSourceLines () const; + void setAssemblyShowSourceLines (bool flag); + bool assemblyShowSourceLines () const; - void setAssemblyRegisterFormat (const QString& format); - QString assemblyRegisterFormat () const; + void setAssemblyRegisterFormat (const QString& format); + QString assemblyRegisterFormat () const; - void setAssemblyDisassemblyMode (const QString& mode, int bytes); - QString assemblyDisassemblyMode () const; - int assemblyDisassemblyBytes () const; + void setAssemblyDisassemblyMode (const QString& mode, int bytes); + QString assemblyDisassemblyMode () const; + int assemblyDisassemblyBytes () const; - void setGdbOutputLogEnabled (bool flag); - bool isGdbOutputLogEnabled () const; + void setGdbOutputLogEnabled (bool flag); + bool isGdbOutputLogEnabled () const; - void setGdbOutputLogTimeStampEnabled (bool flag); - bool isGdbOutputLogTimeStampEnabled () const; + void setGdbOutputLogTimeStampEnabled (bool flag); + bool isGdbOutputLogTimeStampEnabled () const; - void setSeerOutputLogEnabled (bool flag); - bool isSeerOutputLogEnabled () const; + void setSeerOutputLogEnabled (bool flag); + bool isSeerOutputLogEnabled () const; - void setSeerOutputLogTimeStampEnabled (bool flag); - bool isSeerOutputLogTimeStampEnabled () const; + void setSeerOutputLogTimeStampEnabled (bool flag); + bool isSeerOutputLogTimeStampEnabled () const; // RR settings. - void setRRProgram (const QString& program); - QString rrProgram () const; + void setRRProgram (const QString& program); + QString rrProgram () const; - void setRRArguments (const QString& arguments); - QString rrArguments () const; + void setRRArguments (const QString& arguments); + QString rrArguments () const; - void setRRGdbArguments (const QString& arguments); - QString rrGdbArguments () const; + void setRRGdbArguments (const QString& arguments); + QString rrGdbArguments () const; // Editor manager. - SeerEditorManagerWidget* editorManager (); - const SeerEditorManagerWidget* editorManager () const; + SeerEditorManagerWidget* editorManager (); + const SeerEditorManagerWidget* editorManager () const; // Messages - void addMessage (const QString& message, QMessageBox::Icon messageType); + void addMessage (const QString& message, QMessageBox::Icon messageType); // Settings - void writeSettings (); - void readSettings (); + void writeSettings (); + void readSettings (); // Gdb - bool isGdbRuning () const; - void restoreLaunchMode (); - void saveLaunchMode (); - bool hasBackupLaunchMode () const; - void clearBackupLaunchMode (); - const QString& backupLaunchMode () const; + bool isGdbRuning () const; + void restoreLaunchMode (); + void saveLaunchMode (); + bool hasBackupLaunchMode () const; + void clearBackupLaunchMode (); + const QString& backupLaunchMode () const; public slots: - void handleLogsTabMoved (int to, int from); - void handleLogsTabChanged (int index); - void handleRaiseMessageTab (); + void handleLogsTabMoved (int to, int from); + void handleLogsTabChanged (int index); + void handleRaiseMessageTab (); - void handleText (const QString& text); - void handleManualCommandExecute (); - void handleGdbCommand (const QString& command, bool ignoreErrors=false); - void handleGdbExit (); - void handleGdbRunExecutable (const QString& breakMode, bool loadSessionBreakpoints); - void handleGdbAttachExecutable (bool loadSessionBreakpoints); - void handleGdbConnectExecutable (bool loadSessionBreakpoints); - void handleGdbRRExecutable (bool loadSessionBreakpoints); - void handleGdbCoreFileExecutable (); - void handleGdbTerminateExecutable (bool confirm=true); - void handleGdbShutdown (); - void handleGdbRunToLine (QString fullname, int lineno); - void handleGdbRunToAddress (QString address); - void handleGdbNext (); - void handleGdbNexti (); - void handleGdbStep (); - void handleGdbStepi (); - void handleGdbFinish (); - void handleGdbContinue (); - void handleGdbReverseNext (); - void handleGdbReverseNexti (); - void handleGdbReverseStep (); - void handleGdbReverseStepi (); - void handleGdbReverseFinish (); - void handleGdbReverseContinue (); - void handleGdbRecordStart (); - void handleGdbRecordStop (); - void handleGdbRecordForward (); - void handleGdbRecordReverse (); - void handleGdbRecordStartStopToggle (); - void handleGdbRecordDirectionToggle (); - void handleGdbInterrupt (); - void handleGdbInterruptSIGINT (); - void handleGdbInterruptSIGKILL (); - void handleGdbInterruptSIGFPE (); - void handleGdbInterruptSIGSEGV (); - void handleGdbInterruptSIGUSR1 (); - void handleGdbInterruptSIGUSR2 (); + void handleText (const QString& text); + void handleManualCommandExecute (); + void handleGdbCommand (const QString& command, bool ignoreErrors=false); + void handleGdbExit (); + void handleGdbRunExecutable (const QString& breakMode, bool loadSessionBreakpoints); + void handleGdbAttachExecutable (bool loadSessionBreakpoints); + void handleGdbConnectExecutable (bool loadSessionBreakpoints); + void handleGdbRRExecutable (bool loadSessionBreakpoints); + void handleGdbCoreFileExecutable (); + void handleGdbTerminateExecutable (bool confirm=true); + void handleGdbShutdown (); + void handleGdbRunToLine (QString fullname, int lineno); + void handleGdbRunToAddress (QString address); + void handleGdbNext (); + void handleGdbNexti (); + void handleGdbStep (); + void handleGdbStepi (); + void handleGdbFinish (); + void handleGdbContinue (); + void handleGdbReverseNext (); + void handleGdbReverseNexti (); + void handleGdbReverseStep (); + void handleGdbReverseStepi (); + void handleGdbReverseFinish (); + void handleGdbReverseContinue (); + void handleGdbRecordStart (); + void handleGdbRecordStop (); + void handleGdbRecordForward (); + void handleGdbRecordReverse (); + void handleGdbRecordStartStopToggle (); + void handleGdbRecordDirectionToggle (); + void handleGdbInterrupt (); + void handleGdbInterruptSIGINT (); + void handleGdbInterruptSIGKILL (); + void handleGdbInterruptSIGFPE (); + void handleGdbInterruptSIGSEGV (); + void handleGdbInterruptSIGUSR1 (); + void handleGdbInterruptSIGUSR2 (); - void handleGdbRunThreadGroup (QString threadGroup); - void handleGdbStartThreadGroup (QString threadGroup); - void handleGdbContinueThreadGroup (QString threadGroup); - void handleGdbInterruptThreadGroup (QString threadGroup); - void handleGdbNextThreadId (int threadid); - void handleGdbStepThreadId (int threadid); - void handleGdbFinishThreadId (int threadid); - void handleGdbContinueThreadId (int threadid); - void handleGdbInterruptThreadId (int threadid); + void handleGdbRunThreadGroup (QString threadGroup); + void handleGdbStartThreadGroup (QString threadGroup); + void handleGdbContinueThreadGroup (QString threadGroup); + void handleGdbInterruptThreadGroup (QString threadGroup); + void handleGdbNextThreadId (int threadid); + void handleGdbStepThreadId (int threadid); + void handleGdbFinishThreadId (int threadid); + void handleGdbContinueThreadId (int threadid); + void handleGdbInterruptThreadId (int threadid); - void handleGdbExecutableSources (); - void handleGdbExecutableFunctions (int id, const QString& functionRegex); - void handleGdbExecutableTypes (int id, const QString& typeRegex); - void handleGdbExecutableVariables (int id, const QString& variableNameRegex, const QString& variableTypeRegex); - void handleGdbExecutableLibraries (); - void handleGdbExecutableName (); - void handleGdbExecutableArguments (); - void handleGdbExecutableWorkingDirectory (); - void handleGdbExecutableLoadBreakpoints (); - void handleGdbExecutablePreCommands (); - void handleGdbExecutablePostCommands (); - void handleGdbSessionLoadBreakpoints (); - void handleGdbSessionSaveBreakpoints (); - void handleGdbTerminalDeviceName (); - void handleGdbStackListFrames (); - void handleGdbStackSelectFrame (int frameno); - void handleGdbStackListLocals (); - void handleGdbStackListArguments (); - void handleGdbGenericpointList (); - void handleGdbBreakpointDelete (QString breakpoints); - void handleGdbBreakpointEnable (QString breakpoints); - void handleGdbBreakpointDisable (QString breakpoints); - void handleGdbBreakpointInfo (int breakpointid, QString breakpoint); - void handleGdbBreakpointsInsert (QString breakpoints); - void handleGdbBreakpointInsert (QString breakpoint); - void handleGdbBreakpointCondition (QString breakpoint, QString condition); - void handleGdbBreakpointIgnore (QString breakpoint, QString count); - void handleGdbBreakpointCommand (QString breakpoint, QString commands); - void handleGdbBreakpointCommands (QString breakpoint, QStringList commands); - void handleGdbBreakpointReload (QStringList breakpointsText); - void handleGdbWatchpointReload (QStringList watchpointsText); - void handleGdbCatchpointReload (QStringList catchpointsText); - void handleGdbWatchpointDelete (QString watchpoints); - void handleGdbWatchpointEnable (QString watchpoints); - void handleGdbWatchpointDisable (QString watchpoints); - void handleGdbWatchpointInsert (QString watchpoint); - void handleGdbCatchpointDelete (QString catchpoints); - void handleGdbCatchpointEnable (QString catchpoints); - void handleGdbCatchpointDisable (QString catchpoints); - void handleGdbCatchpointInsert (QString catchpoint); - void handleGdbPrintpointDelete (QString breakpoints); - void handleGdbPrintpointEnable (QString breakpoints); - void handleGdbPrintpointDisable (QString breakpoints); - void handleGdbPrintpointInsert (QString type, QString function, QString channel, QString parameters); - void handleGdbThreadListFrames (); - void handleGdbThreadListIds (); - void handleGdbThreadListGroups (); - void handleGdbThreadSelectId (int threadid); - void handleGdbAdaListTasks (); - void handleGdbAdaListExceptions (); - void handleGdbSkipList (); - void handleGdbSkipAdd (QString skipmode, QString skipparameters); - void handleGdbSkipDelete (QString skipids); - void handleGdbSkipEnable (QString skipids); - void handleGdbSkipDisable (QString skipids); - void handleGdbCheckpointList (); - void handleGdbCheckpointInsert (); - void handleGdbCheckpointSelect (QString id); - void handleGdbCheckpointDelete (QString ids); - void handleGdbRegisterListNames (); - void handleGdbRegisterListValues (QString fmt); - void handleGdbRegisterSetValue (QString fmt, QString name, QString value); - void handleGdbDataEvaluateExpression (int expressionid, QString expression); - void handleGdbVarObjCreate (int expressionid, QString expression); - void handleGdbVarObjListChildren (int expressionid, QString objname); - void handleGdbVarObjUpdate (int expressionid, QString objname); - void handleGdbVarObjAssign (int expressionid, QString objname, QString value); - void handleGdbVarObjDelete (int expressionid, QString objname); - void handleGdbVarObjAttributes (int objid, QString objname); - void handleGdbDataListValues (); - void handleGdbDataListExpressions (); - void handleGdbDataAddExpression (QString expression); - void handleGdbDataDeleteExpressions (QString expressionids); - void handleGdbMemoryAddExpression (QString expression); - void handleGdbArrayAddExpression (QString expression); - void handleGdbMatrixAddExpression (QString expression); - void handleGdbStructAddExpression (QString expression); - void handleGdbVarAddExpression (QString expression); - void handleGdbImageAddExpression (QString expression); - void handleGdbMemoryEvaluateExpression (int expressionid, QString address, int count); - void handleGdbMemoryEvaluateExpression (int expressionid, QString address, int offset, int count); - void handleGdbAsmEvaluateExpression (int expressionid, QString address, int count, int mode); - void handleGdbArrayEvaluateExpression (int expressionid, QString address, int count); - void handleGdbGetAssembly (QString address); - void handleGdbGetSourceAndAssembly (QString address); - void handleGdbMemoryVisualizer (); - void handleGdbArrayVisualizer (); - void handleGdbMatrixVisualizer (); - void handleGdbStructVisualizer (); - void handleGdbVarVisualizer (); - void handleGdbImageVisualizer (); - void handleSplitterMoved (int pos, int index); - void handleManualCommandChanged (); - void handleLogOuputChanged (); - void handleGdbLoadBreakpoints (); - void handleGdbSaveBreakpoints (); - void handleHelpToolButtonClicked (); - void handleGdbAssemblyDisassemblyFlavor (); - void handleGdbAssemblySymbolDemangling (); - void handleGdbSchedulerLockingMode (QString mode); - void handleGdbScheduleMultipleMode (QString mode); - void handleGdbForkFollowMode (QString mode); - void handleGdbLoadMICommands (); - void handleGdbSourceScripts (); - void handleGdbSetArchitectureType (); + void handleGdbExecutableSources (); + void handleGdbExecutableFunctions (int id, const QString& functionRegex); + void handleGdbExecutableTypes (int id, const QString& typeRegex); + void handleGdbExecutableVariables (int id, const QString& variableNameRegex, const QString& variableTypeRegex); + void handleGdbExecutableLibraries (); + void handleGdbExecutableName (); + void handleGdbExecutableArguments (); + void handleGdbExecutableWorkingDirectory (); + void handleGdbExecutableLoadBreakpoints (); + void handleGdbExecutablePreCommands (); + void handleGdbExecutablePostCommands (); + void handleGdbSessionLoadBreakpoints (); + void handleGdbSessionSaveBreakpoints (); + void handleGdbTerminalDeviceName (); + void handleGdbStackListFrames (); + void handleGdbStackSelectFrame (int frameno); + void handleGdbStackListLocals (); + void handleGdbStackListArguments (); + void handleGdbGenericpointList (); + void handleGdbBreakpointDelete (QString breakpoints); + void handleGdbBreakpointEnable (QString breakpoints); + void handleGdbBreakpointDisable (QString breakpoints); + void handleGdbBreakpointInfo (int breakpointid, QString breakpoint); + void handleGdbBreakpointsInsert (QString breakpoints); + void handleGdbBreakpointInsert (QString breakpoint); + void handleGdbBreakpointCondition (QString breakpoint, QString condition); + void handleGdbBreakpointIgnore (QString breakpoint, QString count); + void handleGdbBreakpointCommand (QString breakpoint, QString commands); + void handleGdbBreakpointCommands (QString breakpoint, QStringList commands); + void handleGdbBreakpointReload (QStringList breakpointsText); + void handleGdbWatchpointReload (QStringList watchpointsText); + void handleGdbCatchpointReload (QStringList catchpointsText); + void handleGdbWatchpointDelete (QString watchpoints); + void handleGdbWatchpointEnable (QString watchpoints); + void handleGdbWatchpointDisable (QString watchpoints); + void handleGdbWatchpointInsert (QString watchpoint); + void handleGdbCatchpointDelete (QString catchpoints); + void handleGdbCatchpointEnable (QString catchpoints); + void handleGdbCatchpointDisable (QString catchpoints); + void handleGdbCatchpointInsert (QString catchpoint); + void handleGdbPrintpointDelete (QString breakpoints); + void handleGdbPrintpointEnable (QString breakpoints); + void handleGdbPrintpointDisable (QString breakpoints); + void handleGdbPrintpointInsert (QString type, QString function, QString channel, QString parameters); + void handleGdbThreadListFrames (); + void handleGdbThreadListIds (); + void handleGdbThreadListGroups (); + void handleGdbThreadSelectId (int threadid); + void handleGdbAdaListTasks (); + void handleGdbAdaListExceptions (); + void handleGdbSkipList (); + void handleGdbSkipAdd (QString skipmode, QString skipparameters); + void handleGdbSkipDelete (QString skipids); + void handleGdbSkipEnable (QString skipids); + void handleGdbSkipDisable (QString skipids); + void handleGdbCheckpointList (); + void handleGdbCheckpointInsert (); + void handleGdbCheckpointSelect (QString id); + void handleGdbCheckpointDelete (QString ids); + void handleGdbRegisterListNames (); + void handleGdbRegisterListValues (QString fmt); + void handleGdbRegisterSetValue (QString fmt, QString name, QString value); + void handleGdbDataEvaluateExpression (int expressionid, QString expression); + void handleGdbVarObjCreate (int expressionid, QString expression); + void handleGdbVarObjListChildren (int expressionid, QString objname); + void handleGdbVarObjUpdate (int expressionid, QString objname); + void handleGdbVarObjAssign (int expressionid, QString objname, QString value); + void handleGdbVarObjDelete (int expressionid, QString objname); + void handleGdbVarObjAttributes (int objid, QString objname); + void handleGdbDataListValues (); + void handleGdbDataListExpressions (); + void handleGdbDataAddExpression (QString expression); + void handleGdbDataDeleteExpressions (QString expressionids); + void handleGdbMemoryAddExpression (QString expression); + void handleGdbArrayAddExpression (QString expression); + void handleGdbMatrixAddExpression (QString expression); + void handleGdbStructAddExpression (QString expression); + void handleGdbVarAddExpression (QString expression); + void handleGdbImageAddExpression (QString expression); + void handleGdbMemoryEvaluateExpression (int expressionid, QString address, int count); + void handleGdbMemoryEvaluateExpression (int expressionid, QString address, int offset, int count); + void handleGdbAsmEvaluateExpression (int expressionid, QString address, int count, int mode); + void handleGdbArrayEvaluateExpression (int expressionid, QString address, int count); + void handleGdbGetAssembly (QString address); + void handleGdbGetSourceAndAssembly (QString address); + void handleGdbMemoryVisualizer (); + void handleGdbArrayVisualizer (); + void handleGdbMatrixVisualizer (); + void handleGdbStructVisualizer (); + void handleGdbVarVisualizer (); + void handleGdbImageVisualizer (); + void handleSplitterMoved (int pos, int index); + void handleManualCommandChanged (); + void handleLogOuputChanged (); + void handleGdbLoadBreakpoints (); + void handleGdbSaveBreakpoints (); + void handleHelpToolButtonClicked (); + void handleGdbAssemblyDisassemblyFlavor (); + void handleGdbAssemblySymbolDemangling (); + void handleGdbSchedulerLockingMode (QString mode); + void handleGdbScheduleMultipleMode (QString mode); + void handleGdbForkFollowMode (QString mode); + void handleGdbLoadMICommands (); + void handleGdbSourceScripts (); + void handleGdbSetArchitectureType (); - void handleGdbProcessFinished (int exitCode, QProcess::ExitStatus exitStatus); - void handleGdbProcessErrored (QProcess::ProcessError errorStatus); + void handleGdbProcessFinished (int exitCode, QProcess::ExitStatus exitStatus); + void handleGdbProcessErrored (QProcess::ProcessError errorStatus); - void handleConsoleModeChanged (); - void handleConsoleNewTextAdded (); - void handleConsoleNewTextViewed (); - void handleAboutToQuit (); + void handleConsoleModeChanged (); + void handleConsoleNewTextAdded (); + void handleConsoleNewTextViewed (); + void handleAboutToQuit (); signals: - void stoppingPointReached (); - void sessionTerminated (); - void changeWindowTitle (QString title); - void assemblyConfigChanged (); - void recordSettingsChanged (); - void stateChanged (); - void gdbCommandLogout (const QString& text); + void stoppingPointReached (); + void sessionTerminated (); + void changeWindowTitle (QString title); + void assemblyConfigChanged (); + void recordSettingsChanged (); + void stateChanged (); + void gdbCommandLogout (const QString& text); protected: - void writeLogsSettings (); - void readLogsSettings (); + void writeLogsSettings (); + void readLogsSettings (); private: - bool isQuitting () const; - void setIsQuitting (bool f); + bool isQuitting () const; + void setIsQuitting (bool f); - bool startGdb (); - bool startGdbRR (); - void killGdb (); - void createConsole (); - void deleteConsole (); - void reattachConsole (); - SeerConsoleWidget* console (); - void sendGdbInterrupt (int signal); - void delay (int seconds); + bool startGdb (); + bool startGdbRR (); + void killGdb (); + void createConsole (); + void deleteConsole (); + void reattachConsole (); + SeerConsoleWidget* console (); + void sendGdbInterrupt (int signal); + void delay (int seconds); bool _isQuitting; QString _gdbLauncher; @@ -438,7 +438,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm { QString _gdbRecordDirection; QString _gdbRemoteTargetType; QString _gdbArchitectureType; - bool _assemblyShowAssemblyTabOnStartup; + QString _assemblyShowAssemblyTabOnStartupMode; QString _assemblyDisassemblyFlavor; QString _assemblySymbolDemangling; QString _assemblyRegisterFormat; diff --git a/src/SeerMainWindow.cpp b/src/SeerMainWindow.cpp index bac9ec6..1bfc260 100644 --- a/src/SeerMainWindow.cpp +++ b/src/SeerMainWindow.cpp @@ -321,12 +321,12 @@ const QString& SeerMainWindow::executableBreakpointSourceName () const { return gdbWidget->executableBreakpointSourceName(); } -void SeerMainWindow::setExecutableShowAssemblyTab (bool flag) { - gdbWidget->setAssemblyShowAssemblyTabOnStartup(flag); +void SeerMainWindow::setExecutableShowAssemblyTabMode (const QString& mode) { + gdbWidget->setAssemblyShowAssemblyTabOnStartupMode(mode); } -bool SeerMainWindow::executableShowAssemblyTab () const { - return gdbWidget->assemblyShowAssemblyTabOnStartup(); +QString SeerMainWindow::executableShowAssemblyTabMode () const { + return gdbWidget->assemblyShowAssemblyTabOnStartupMode(); } void SeerMainWindow::setExecutableRandomizeStartAddress (bool flag) { @@ -579,7 +579,7 @@ void SeerMainWindow::handleFileDebug (bool loadDefaultProject) { dlg.setBreakpointsFilename(executableBreakpointsFilename()); dlg.setBreakpointFunctionName(executableBreakpointFunctionName()); dlg.setBreakpointSourceName(executableBreakpointSourceName()); - dlg.setShowAssemblyTab(executableShowAssemblyTab()); + dlg.setShowAssemblyTabMode(executableShowAssemblyTabMode()); dlg.setRandomizeStartAddress(executableRandomizeStartAddress()); dlg.setNonStopMode(executableNonStopMode()); dlg.setAttachPid(executablePid()); @@ -623,7 +623,7 @@ void SeerMainWindow::handleFileDebug (bool loadDefaultProject) { setExecutableBreakpointsFilename(dlg.breakpointsFilename()); setExecutableBreakpointFunctionName(dlg.breakpointFunctionName()); setExecutableBreakpointSourceName(dlg.breakpointSourceName()); - setExecutableShowAssemblyTab(dlg.showAssemblyTab()); + setExecutableShowAssemblyTabMode(dlg.showAssemblyTabMode()); setExecutableRandomizeStartAddress(dlg.randomizeStartAddress()); setExecutableNonStopMode(dlg.nonStopMode()); setExecutablePid(dlg.attachPid()); @@ -759,7 +759,7 @@ void SeerMainWindow::handleSettingsConfiguration () { dlg.setSourceMiscFilePatterns(gdbWidget->sourceMiscFilePatterns()); dlg.setSourceSourceFilePatterns(gdbWidget->sourceSourceFilePatterns()); dlg.setSourceHeaderFilePatterns(gdbWidget->sourceHeaderFilePatterns()); - dlg.setAssemblyShowAssemblyTabOnStartup(gdbWidget->assemblyShowAssemblyTabOnStartup()); + dlg.setAssemblyShowAssemblyTabOnStartupMode(gdbWidget->assemblyShowAssemblyTabOnStartupMode()); dlg.setAssemblyKeepAssemblyTabOnTop(gdbWidget->assemblyKeepAssemblyTabOnTop()); dlg.setAssemblyDisassemblyFlavor(gdbWidget->assemblyDisassemblyFlavor()); dlg.setAssemblySymbolDemagling(gdbWidget->assemblySymbolDemagling()); @@ -804,7 +804,7 @@ void SeerMainWindow::handleSettingsConfiguration () { gdbWidget->setSourceMiscFilePatterns(dlg.sourceMiscFilePatterns()); gdbWidget->setSourceSourceFilePatterns(dlg.sourceSourceFilePatterns()); gdbWidget->setSourceHeaderFilePatterns(dlg.sourceHeaderFilePatterns()); - gdbWidget->setAssemblyShowAssemblyTabOnStartup(dlg.assemblyShowAssemblyTabOnStartup()); + gdbWidget->setAssemblyShowAssemblyTabOnStartupMode(dlg.assemblyShowAssemblyTabOnStartupMode()); gdbWidget->setAssemblyKeepAssemblyTabOnTop(dlg.assemblyKeepAssemblyTabOnTop()); gdbWidget->setAssemblyDisassemblyFlavor(dlg.assemblyDisassemblyFlavor()); gdbWidget->setAssemblySymbolDemagling(dlg.assemblySymbolDemagling()); diff --git a/src/SeerMainWindow.h b/src/SeerMainWindow.h index 8255787..82ec52f 100644 --- a/src/SeerMainWindow.h +++ b/src/SeerMainWindow.h @@ -39,8 +39,8 @@ class SeerMainWindow : public QMainWindow, protected Ui::SeerMainWindowForm { const QString& executableBreakpointFunctionName () const; void setExecutableBreakpointSourceName (const QString& sourceFilenameAndLineno); const QString& executableBreakpointSourceName () const; - void setExecutableShowAssemblyTab (bool flag); - bool executableShowAssemblyTab () const; + void setExecutableShowAssemblyTabMode (const QString& mode); + QString executableShowAssemblyTabMode () const; void setExecutableRandomizeStartAddress (bool flag); bool executableRandomizeStartAddress () const; void setExecutableNonStopMode (bool flag); diff --git a/src/SeerStackFramesBrowserWidget.cpp b/src/SeerStackFramesBrowserWidget.cpp index 1852a12..2432c43 100644 --- a/src/SeerStackFramesBrowserWidget.cpp +++ b/src/SeerStackFramesBrowserWidget.cpp @@ -76,6 +76,9 @@ void SeerStackFramesBrowserWidget::handleText (const QString& text) { QString firstLiveFrameFullname = ""; QString firstLiveFrameLine = ""; + QString firstFrameLevel = ""; + QString firstFrameAddr = ""; + for ( const auto& frame_text : frame_list ) { QString level_text = Seer::parseFirst(frame_text, "level=", '"', '"', false); @@ -114,13 +117,30 @@ void SeerStackFramesBrowserWidget::handleText (const QString& text) { item->setFlags(Qt::NoItemFlags); } + // Get the address of the first entry of the frame. + if (addr_text != "") { + if (firstFrameLevel == "") { + firstFrameLevel = level_text; + firstFrameAddr = addr_text; + } + } + // Add the frame to the tree. stackTreeWidget->addTopLevelItem(item); } // Automatically bring up the file for the first live frame. if (firstLiveFrameLevel != "") { - emit selectedFile(firstLiveFrameFile, firstLiveFrameFullname, firstLiveFrameLine.toInt()); + if (firstLiveFrameFile != "" && firstLiveFrameFullname != "") { + emit selectedFile(firstLiveFrameFile, firstLiveFrameFullname, firstLiveFrameLine.toInt()); + } + } + + // Automatically bring up the assembly for the first frame. + if (firstFrameLevel != "") { + if (firstFrameAddr != "") { + emit selectedAddress(firstFrameAddr); + } } } @@ -185,9 +205,18 @@ void SeerStackFramesBrowserWidget::handleItemClicked (QTreeWidgetItem* item, int int lineno = item->text(3).toInt(); - emit selectedFile(item->text(2), item->text(4), lineno); + // Select frame. emit selectedFrame(item->text(0).toInt()); - emit selectedAddress(item->text(5)); + + // Select file if we can. + if (item->text(2) != "" && item->text(4) != "") { + emit selectedFile(item->text(2), item->text(4), lineno); + } + + // Select address if we can. + if (item->text(5) != "") { + emit selectedAddress(item->text(5)); + } } void SeerStackFramesBrowserWidget::handleItemEntered (QTreeWidgetItem* item, int column) { diff --git a/src/SeerThreadFramesBrowserWidget.cpp b/src/SeerThreadFramesBrowserWidget.cpp index 3a4df93..5b874ca 100644 --- a/src/SeerThreadFramesBrowserWidget.cpp +++ b/src/SeerThreadFramesBrowserWidget.cpp @@ -239,8 +239,18 @@ void SeerThreadFramesBrowserWidget::handleItemClicked (QTreeWidgetItem* item, in //qDebug() << "Emit selectedFile and selectedFrame"; - emit selectedFile(item->text(5), item->text(7), lineno); + // Select thread. emit selectedThread(item->text(1).toInt()); + + // Select file if we can. + if (item->text(5) != "" && item->text(7) != "") { + emit selectedFile(item->text(5), item->text(7), lineno); + } + + // Select address if we can. + if (item->text(11) != "") { + emit selectedAddress(item->text(11)); + } } } diff --git a/src/SeerThreadFramesBrowserWidget.h b/src/SeerThreadFramesBrowserWidget.h index 5d82cac..246820f 100644 --- a/src/SeerThreadFramesBrowserWidget.h +++ b/src/SeerThreadFramesBrowserWidget.h @@ -35,6 +35,7 @@ class SeerThreadFramesBrowserWidget : public QWidget, protected Ui::SeerThreadFr void refreshThreadFrames (); void refreshThreadIds (); void selectedFile (QString file, QString fullname, int lineno); + void selectedAddress (QString address); void selectedFrame (int frameno); void selectedThread (int threadid); void nextThreadId (int threadid); diff --git a/src/build/README.cmake b/src/build/README.cmake index 502c72a..46d5cb8 100644 --- a/src/build/README.cmake +++ b/src/build/README.cmake @@ -27,7 +27,7 @@ MacOS may need help finding the cmake config file for Qt6. Sometimes you need to specify a newer version of g++/gcc. Your installation may have an old version as the default. - % cmake -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 -DQTVERSION=QT6 -DCMAKE_BUILD_TYPE=Debug .. + % cmake -DCMAKE_CXX_COMPILER=g++-14 -DQTVERSION=QT6 -DCMAKE_BUILD_TYPE=Debug .. Checkout the Seer wiki for more build info. diff --git a/src/resources/help/seergdb.hlp b/src/resources/help/seergdb.hlp index 5874ff2..633ed67 100644 --- a/src/resources/help/seergdb.hlp +++ b/src/resources/help/seergdb.hlp @@ -63,7 +63,7 @@ Misc Options: --bs, --break-source Set breakpoints at a list of source files and line numbers. For 'run', 'start', 'attach', 'connect', or 'rr'. eg: --bs myprog.cpp:30,myprog.cpp:210 - --sat, --show-assembly-tab Show the Assembly Tab on Seer startup. For 'run' or 'start'. + --sat, --show-assembly-tab Show the Assembly Tab on Seer startup. For 'run' or 'start'. --sar, --start-address-randomize Randomize the program's starting address. For 'run' or 'start'. --nsm, --non-stop-mode Continue to run other threads at breakpoints. For 'run' or 'start'. diff --git a/src/seergdb.cpp b/src/seergdb.cpp index 500af1f..500c436 100644 --- a/src/seergdb.cpp +++ b/src/seergdb.cpp @@ -327,11 +327,11 @@ int main (int argc, char* argv[]) { if (executableShowAssemblyTab != "") { if (executableShowAssemblyTab == "yes") { - seer.setExecutableShowAssemblyTab(true); - + seer.setExecutableShowAssemblyTabMode("always"); }else if (executableShowAssemblyTab == "no") { - seer.setExecutableShowAssemblyTab(false); - + seer.setExecutableShowAssemblyTabMode("never"); + }else if (executableShowAssemblyTab == "auto") { + seer.setExecutableShowAssemblyTabMode("auto"); }else{ printf("%s: Unknown --show-assembly-tab option '%s'\n", qPrintable(QCoreApplication::applicationName()), qPrintable(executableShowAssemblyTab)); return 1;