mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Add config to set gdb's architecture.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
* Breakpoints: Allow multiple filename:line entries for the --break-source option.
|
||||
* Control: Add ^D to toggle record playback direction for RR, Undo, and gdb's Record.
|
||||
* Control: Add SHIFT+F5 (etal) to reverse step (etc.) during record playback for RR, Undo, and gdb's Record.
|
||||
* GDB: Add Seer config to set gdb architecture.
|
||||
|
||||
## [2.6] - 2025-10-07
|
||||
* Watchpoints: Fixed regression when adding commands to a watchpoint.
|
||||
|
||||
@@ -244,6 +244,16 @@ QString SeerConfigDialog::gdbRemoteTargetType () const {
|
||||
return _gdbConfigPage->gdbRemoteTargetType();
|
||||
}
|
||||
|
||||
void SeerConfigDialog::setGdbArchitectureType (const QString& type) {
|
||||
|
||||
_gdbConfigPage->setGdbArchitectureType(type);
|
||||
}
|
||||
|
||||
QString SeerConfigDialog::gdbArchitectureType () const {
|
||||
|
||||
return _gdbConfigPage->gdbArchitectureType();
|
||||
}
|
||||
|
||||
void SeerConfigDialog::setEditorFont (const QFont& font) {
|
||||
|
||||
_editorConfigPage->setEditorFont(font);
|
||||
|
||||
@@ -68,6 +68,9 @@ class SeerConfigDialog : public QDialog, protected Ui::SeerConfigDialogForm {
|
||||
void setGdbRemoteTargetType (const QString& type);
|
||||
QString gdbRemoteTargetType () const;
|
||||
|
||||
void setGdbArchitectureType (const QString& type);
|
||||
QString gdbArchitectureType () const;
|
||||
|
||||
// Editor settings.
|
||||
void setEditorFont (const QFont& font);
|
||||
const QFont& editorFont () const;
|
||||
|
||||
@@ -62,6 +62,15 @@ QString SeerGdbConfigPage::gdbRemoteTargetType () const {
|
||||
return gdbRemoteTargetTypeCombo->currentText();
|
||||
}
|
||||
|
||||
QString SeerGdbConfigPage::gdbArchitectureType () const {
|
||||
|
||||
QString type = gdbArchitectureLineEdit->text();
|
||||
|
||||
if (type == "") type = "auto";
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
void SeerGdbConfigPage::setGdbProgram (const QString& program) {
|
||||
|
||||
gdbProgramLineEdit->setText(program);
|
||||
@@ -102,6 +111,11 @@ void SeerGdbConfigPage::setGdbRemoteTargetType (const QString& type) {
|
||||
gdbRemoteTargetTypeCombo->setCurrentText(type);
|
||||
}
|
||||
|
||||
void SeerGdbConfigPage::setGdbArchitectureType (const QString& type) {
|
||||
|
||||
gdbArchitectureLineEdit->setText(type);
|
||||
}
|
||||
|
||||
void SeerGdbConfigPage::reset () {
|
||||
|
||||
setGdbProgram("/usr/bin/gdb");
|
||||
@@ -111,6 +125,8 @@ void SeerGdbConfigPage::reset () {
|
||||
setGdbHandleTerminatingException(true);
|
||||
setGdbRandomizeStartAddress(false);
|
||||
setGdbEnablePrettyPrinting(true);
|
||||
setGdbRemoteTargetType("extended-remote");
|
||||
setGdbArchitectureType("auto");
|
||||
}
|
||||
|
||||
void SeerGdbConfigPage::handleGdbProgramToolButton () {
|
||||
|
||||
@@ -24,6 +24,7 @@ class SeerGdbConfigPage : public QWidget, protected Ui::SeerGdbConfigPage {
|
||||
bool gdbRandomizeStartAddress () const;
|
||||
bool gdbEnablePrettyPrinting () const;
|
||||
QString gdbRemoteTargetType () const;
|
||||
QString gdbArchitectureType () const;
|
||||
|
||||
|
||||
void setGdbProgram (const QString& program);
|
||||
@@ -34,6 +35,7 @@ class SeerGdbConfigPage : public QWidget, protected Ui::SeerGdbConfigPage {
|
||||
void setGdbRandomizeStartAddress (bool flag);
|
||||
void setGdbEnablePrettyPrinting (bool flag);
|
||||
void setGdbRemoteTargetType (const QString& type);
|
||||
void setGdbArchitectureType (const QString& type);
|
||||
|
||||
void reset ();
|
||||
|
||||
|
||||
+49
-13
@@ -19,7 +19,7 @@
|
||||
<property name="title">
|
||||
<string>Gdb Settings</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="gdbProgramLabel">
|
||||
<property name="text">
|
||||
@@ -27,7 +27,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="gdbProgramLineEdit">
|
||||
<property name="toolTip">
|
||||
<string>Specify the path and name of the gdb debugger.</string>
|
||||
@@ -37,7 +37,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="gdbProgramToolButton">
|
||||
<property name="toolTip">
|
||||
<string>Open a file dialog to locate the gdb debugger.</string>
|
||||
@@ -58,7 +58,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="gdbArgumentsLineEdit">
|
||||
<property name="toolTip">
|
||||
<string>Arguments to pass to the gdb debugger.</string>
|
||||
@@ -68,7 +68,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="4">
|
||||
<item row="2" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="gdbAsyncModeCheckBox">
|
||||
@@ -122,16 +122,16 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<item row="3" column="0" colspan="3">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="gdbRemoteTargetTypeLabel">
|
||||
<property name="text">
|
||||
<string>Remote target type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="gdbRemoteTargetTypeCombo">
|
||||
<property name="toolTip">
|
||||
<string>Select the type of remote target connection.</string>
|
||||
@@ -148,10 +148,8 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="2" colspan="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_1">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@@ -163,6 +161,38 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="gdbArchitectureTypeLabel">
|
||||
<property name="text">
|
||||
<string>Architecture type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="gdbArchitectureLineEdit">
|
||||
<property name="toolTip">
|
||||
<string>Executable architecture type.</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>385</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -201,6 +231,12 @@ li.checked::marker { content: "\2612"; }
|
||||
<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=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The Architecture Type sets the target's architecture type. The value can be &quot;auto&quot;, in addition of one of the support architectures your version of gdb supports.</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;">Run this command in gdb to see a full list of architectures supported by your version of gdb.</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;"> (gdb) set architecture</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></string>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
@@ -756,6 +756,16 @@ QString SeerGdbWidget::gdbRemoteTargetType () const {
|
||||
return _gdbRemoteTargetType;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setGdbArchitectureType (const QString& type) {
|
||||
|
||||
_gdbArchitectureType = type;
|
||||
}
|
||||
|
||||
QString SeerGdbWidget::gdbArchitectureType () const {
|
||||
|
||||
return _gdbArchitectureType;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setGdbRecordMode(const QString& mode) {
|
||||
|
||||
if (mode == "auto") {
|
||||
@@ -1115,6 +1125,7 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode, bool loadS
|
||||
|
||||
// Load the executable, if needed.
|
||||
if (newExecutableFlag() == true) {
|
||||
handleGdbSetArchitectureType();
|
||||
handleGdbExecutablePreCommands(); // Run any 'pre' commands before program is loaded.
|
||||
handleGdbExecutableName(); // Load the program into the gdb process.
|
||||
handleGdbExecutableSources(); // Load the program source files.
|
||||
@@ -1258,6 +1269,7 @@ void SeerGdbWidget::handleGdbAttachExecutable (bool loadSessionBreakpoints) {
|
||||
|
||||
// Load the executable, if needed.
|
||||
if (newExecutableFlag() == true) {
|
||||
handleGdbSetArchitectureType();
|
||||
handleGdbExecutablePreCommands(); // Run any 'pre' commands before program is loaded.
|
||||
handleGdbExecutableName(); // Load the program into the gdb process.
|
||||
handleGdbExecutableSources(); // Load the program source files.
|
||||
@@ -1376,6 +1388,7 @@ void SeerGdbWidget::handleGdbConnectExecutable (bool loadSessionBreakpoints) {
|
||||
|
||||
// Load the executable, if needed.
|
||||
if (newExecutableFlag() == true) {
|
||||
handleGdbSetArchitectureType();
|
||||
handleGdbExecutableName(); // Load the program into the gdb process.
|
||||
handleGdbExecutableSources(); // Load the program source files.
|
||||
handleGdbExecutableLoadBreakpoints(); // Set the program's breakpoints (if any) before running.
|
||||
@@ -1485,6 +1498,7 @@ void SeerGdbWidget::handleGdbRRExecutable (bool loadSessionBreakpoints) {
|
||||
// Load the executable, if needed.
|
||||
// For RR, this will start it.
|
||||
if (newExecutableFlag() == true) {
|
||||
handleGdbSetArchitectureType();
|
||||
handleGdbExecutablePreCommands(); // Run any 'pre' commands before program is loaded.
|
||||
handleGdbExecutableName(); // Load the program into the gdb process.
|
||||
handleGdbExecutableSources(); // Load the program source files.
|
||||
@@ -1604,6 +1618,7 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
|
||||
reattachConsole();
|
||||
|
||||
if (newExecutableFlag() == true) {
|
||||
handleGdbSetArchitectureType();
|
||||
handleGdbExecutablePreCommands(); // Run any 'pre' commands before program is loaded.
|
||||
handleGdbExecutableName(); // Load the program into the gdb process.
|
||||
handleGdbExecutableSources(); // Load the program source files.
|
||||
@@ -4149,6 +4164,13 @@ void SeerGdbWidget::handleGdbSourceScripts () {
|
||||
qDebug() << "Done.";
|
||||
}
|
||||
|
||||
void SeerGdbWidget::handleGdbSetArchitectureType () {
|
||||
|
||||
if (gdbArchitectureType() != "") {
|
||||
handleGdbCommand(QString("set architecture ") + gdbArchitectureType());
|
||||
}
|
||||
}
|
||||
|
||||
QString SeerGdbWidget::assemblySymbolDemagling () const {
|
||||
|
||||
return _assemblySymbolDemangling;
|
||||
|
||||
@@ -112,6 +112,9 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
||||
void setGdbRemoteTargetType (const QString& type);
|
||||
QString gdbRemoteTargetType () const;
|
||||
|
||||
void setGdbArchitectureType (const QString& type);
|
||||
QString gdbArchitectureType () const;
|
||||
|
||||
void setGdbRecordMode (const QString& mode);
|
||||
QString gdbRecordMode () const;
|
||||
|
||||
@@ -376,6 +379,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
||||
void handleGdbForkFollowMode (QString mode);
|
||||
void handleGdbLoadMICommands ();
|
||||
void handleGdbSourceScripts ();
|
||||
void handleGdbSetArchitectureType ();
|
||||
|
||||
void handleGdbProcessFinished (int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void handleGdbProcessErrored (QProcess::ProcessError errorStatus);
|
||||
@@ -429,6 +433,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
||||
QString _gdbRecordMode;
|
||||
QString _gdbRecordDirection;
|
||||
QString _gdbRemoteTargetType;
|
||||
QString _gdbArchitectureType;
|
||||
bool _assemblyShowAssemblyTabOnStartup;
|
||||
QString _assemblyDisassemblyFlavor;
|
||||
QString _assemblySymbolDemangling;
|
||||
|
||||
@@ -741,6 +741,7 @@ void SeerMainWindow::handleSettingsConfiguration () {
|
||||
dlg.setGdbRandomizeStartAddress(gdbWidget->gdbRandomizeStartAddress());
|
||||
dlg.setGdbEnablePrettyPrinting(gdbWidget->gdbEnablePrettyPrinting());
|
||||
dlg.setGdbRemoteTargetType(gdbWidget->gdbRemoteTargetType());
|
||||
dlg.setGdbArchitectureType(gdbWidget->gdbArchitectureType());
|
||||
dlg.setEditorFont(gdbWidget->editorManager()->editorFont());
|
||||
dlg.setEditorTabSize(gdbWidget->editorManager()->editorTabSize());
|
||||
dlg.setEditorHighlighterSettings(gdbWidget->editorManager()->editorHighlighterSettings());
|
||||
@@ -785,6 +786,7 @@ void SeerMainWindow::handleSettingsConfiguration () {
|
||||
gdbWidget->setGdbRandomizeStartAddress(dlg.gdbRandomizeStartAddress());
|
||||
gdbWidget->setGdbEnablePrettyPrinting(dlg.gdbEnablePrettyPrinting());
|
||||
gdbWidget->setGdbRemoteTargetType(dlg.gdbRemoteTargetType());
|
||||
gdbWidget->setGdbArchitectureType(dlg.gdbArchitectureType());
|
||||
gdbWidget->editorManager()->setEditorFont(dlg.editorFont());
|
||||
gdbWidget->editorManager()->setEditorTabSize(dlg.editorTabSize());
|
||||
gdbWidget->editorManager()->setEditorHighlighterSettings(dlg.editorHighlighterSettings());
|
||||
@@ -1554,6 +1556,7 @@ void SeerMainWindow::writeConfigSettings () {
|
||||
settings.setValue("randomizestartaddress", gdbWidget->gdbRandomizeStartAddress());
|
||||
settings.setValue("enableprettyprinting", gdbWidget->gdbEnablePrettyPrinting());
|
||||
settings.setValue("remotetargettype", gdbWidget->gdbRemoteTargetType());
|
||||
settings.setValue("architecturetype", gdbWidget->gdbArchitectureType());
|
||||
} settings.endGroup();
|
||||
|
||||
settings.beginGroup("rr"); {
|
||||
@@ -1633,6 +1636,7 @@ void SeerMainWindow::readConfigSettings () {
|
||||
gdbWidget->setGdbRandomizeStartAddress(settings.value("randomizestartaddress", false).toBool());
|
||||
gdbWidget->setGdbEnablePrettyPrinting(settings.value("enableprettyprinting", true).toBool());
|
||||
gdbWidget->setGdbRemoteTargetType(settings.value("remotetargettype", "extended-remote").toString());
|
||||
gdbWidget->setGdbArchitectureType(settings.value("architecturetype", "auto").toString());
|
||||
} settings.endGroup();
|
||||
|
||||
settings.beginGroup("rr"); {
|
||||
|
||||
Reference in New Issue
Block a user