Skip to content

Commit 0119294

Browse files
authored
Merge pull request #407 from epasveer/260-would-be-nice-if-assembly-view-was-shown-by-default-when-there-is-no-source-code
260 would be nice if assembly view was shown by default when there is no source code
2 parents 2d89f42 + df17f0e commit 0119294

24 files changed

+850
-670
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* GDB: Add Seer config to set gdb architecture.
1818
* GDB: Add an optional 'launcher' program to start gdb. eg: flatpak-spawn.
1919
* Build: Add flatpak generation to github actions.
20+
* Assemby: An option to show assembly tab when there is no source file.
2021

2122
## [2.6] - 2025-10-07
2223
* Watchpoints: Fixed regression when adding commands to a watchpoint.

src/SeerAssemblyConfigPage.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ SeerAssemblyConfigPage::SeerAssemblyConfigPage(QWidget* parent) : QWidget(parent
2020
SeerAssemblyConfigPage::~SeerAssemblyConfigPage() {
2121
}
2222

23-
bool SeerAssemblyConfigPage::showAssemblyTabOnStartup () const {
23+
QString SeerAssemblyConfigPage::showAssemblyTabOnStartupMode () const {
2424

25-
return assemblyTabOnStartupCheckBox->isChecked();
25+
return showAssemblyTabComboBox->currentText();
2626
}
2727

2828
bool SeerAssemblyConfigPage::keepAssemblyTabOnTop () const {
@@ -93,9 +93,9 @@ int SeerAssemblyConfigPage::disassemblyBytes () const {
9393
return pcLengthSpinBox->value();
9494
}
9595

96-
void SeerAssemblyConfigPage::setShowAssemblyTabOnStartup (bool flag) {
96+
void SeerAssemblyConfigPage::setShowAssemblyTabOnStartupMode (const QString& mode) {
9797

98-
assemblyTabOnStartupCheckBox->setChecked(flag);
98+
showAssemblyTabComboBox->setCurrentText(mode);
9999
}
100100

101101
void SeerAssemblyConfigPage::setKeepAssemblyTabOnTop (bool flag) {
@@ -163,7 +163,7 @@ void SeerAssemblyConfigPage::setDisassemblyMode (const QString& mode, int bytes)
163163

164164
void SeerAssemblyConfigPage::reset () {
165165

166-
setShowAssemblyTabOnStartup(false);
166+
setShowAssemblyTabOnStartupMode("never");
167167
setKeepAssemblyTabOnTop(true);
168168
setDisassemblyFlavor("att");
169169
setSymbolDemagling("on");

src/SeerAssemblyConfigPage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SeerAssemblyConfigPage : public QWidget, protected Ui::SeerAssemblyConfigP
1616
explicit SeerAssemblyConfigPage (QWidget* parent = 0);
1717
~SeerAssemblyConfigPage ();
1818

19-
bool showAssemblyTabOnStartup () const;
19+
QString showAssemblyTabOnStartupMode () const;
2020
bool keepAssemblyTabOnTop () const;
2121
QString disassemblyFlavor () const;
2222
QString symbolDemagling () const;
@@ -28,7 +28,7 @@ class SeerAssemblyConfigPage : public QWidget, protected Ui::SeerAssemblyConfigP
2828
QString disassemblyMode () const;
2929
int disassemblyBytes () const;
3030

31-
void setShowAssemblyTabOnStartup (bool flag);
31+
void setShowAssemblyTabOnStartupMode (const QString& mode);
3232
void setKeepAssemblyTabOnTop (bool flag);
3333
void setDisassemblyFlavor (const QString& flavor);
3434
void setSymbolDemagling (const QString& onoff);

src/SeerAssemblyConfigPage.ui

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,49 @@
2020
<string>Assembly Settings</string>
2121
</property>
2222
<layout class="QGridLayout" name="gridLayout">
23-
<item row="0" column="0" colspan="3">
24-
<widget class="QCheckBox" name="assemblyTabOnStartupCheckBox">
23+
<item row="0" column="0">
24+
<widget class="QLabel" name="showAssemblyTabLabel">
2525
<property name="text">
26-
<string>Show Assembly tab on Seer startup</string>
26+
<string>Show Assembly tab on startup</string>
2727
</property>
2828
</widget>
2929
</item>
30-
<item row="0" column="5" colspan="2">
30+
<item row="0" column="1">
31+
<spacer name="horizontalSpacer_11">
32+
<property name="orientation">
33+
<enum>Qt::Horizontal</enum>
34+
</property>
35+
<property name="sizeType">
36+
<enum>QSizePolicy::Fixed</enum>
37+
</property>
38+
<property name="sizeHint" stdset="0">
39+
<size>
40+
<width>27</width>
41+
<height>20</height>
42+
</size>
43+
</property>
44+
</spacer>
45+
</item>
46+
<item row="0" column="2">
47+
<widget class="QComboBox" name="showAssemblyTabComboBox">
48+
<item>
49+
<property name="text">
50+
<string>never</string>
51+
</property>
52+
</item>
53+
<item>
54+
<property name="text">
55+
<string>always</string>
56+
</property>
57+
</item>
58+
<item>
59+
<property name="text">
60+
<string>auto</string>
61+
</property>
62+
</item>
63+
</widget>
64+
</item>
65+
<item row="0" column="5">
3166
<spacer name="horizontalSpacer_7">
3267
<property name="orientation">
3368
<enum>Qt::Horizontal</enum>
@@ -47,7 +82,7 @@
4782
</property>
4883
</widget>
4984
</item>
50-
<item row="1" column="5" colspan="2">
85+
<item row="1" column="5">
5186
<spacer name="horizontalSpacer_8">
5287
<property name="orientation">
5388
<enum>Qt::Horizontal</enum>
@@ -119,7 +154,7 @@
119154
</attribute>
120155
</widget>
121156
</item>
122-
<item row="3" column="5" colspan="2">
157+
<item row="3" column="5">
123158
<spacer name="horizontalSpacer_5">
124159
<property name="orientation">
125160
<enum>Qt::Horizontal</enum>
@@ -178,7 +213,7 @@
178213
</attribute>
179214
</widget>
180215
</item>
181-
<item row="4" column="5" colspan="2">
216+
<item row="4" column="5">
182217
<spacer name="horizontalSpacer_6">
183218
<property name="orientation">
184219
<enum>Qt::Horizontal</enum>
@@ -299,7 +334,7 @@
299334
</item>
300335
</widget>
301336
</item>
302-
<item row="6" column="5" colspan="2">
337+
<item row="6" column="5">
303338
<spacer name="horizontalSpacer_4">
304339
<property name="orientation">
305340
<enum>Qt::Horizontal</enum>
@@ -377,7 +412,7 @@
377412
</property>
378413
</widget>
379414
</item>
380-
<item row="7" column="5" colspan="2">
415+
<item row="7" column="5">
381416
<spacer name="horizontalSpacer_10">
382417
<property name="orientation">
383418
<enum>Qt::Horizontal</enum>
@@ -400,12 +435,20 @@
400435
<widget class="QTextBrowser" name="textBrowser">
401436
<property name="html">
402437
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
403-
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
438+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
404439
p, li { white-space: pre-wrap; }
440+
hr { height: 1px; border-width: 0; }
441+
li.unchecked::marker { content: &quot;\2610&quot;; }
442+
li.checked::marker { content: &quot;\2612&quot;; }
405443
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
406444
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Set various Assembly and Register settings.&lt;/span&gt;&lt;/p&gt;
407445
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
408-
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; background-color:transparent;&quot;&gt;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:&lt;/span&gt;&lt;/p&gt;
446+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; background-color:transparent;&quot;&gt;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.&lt;/span&gt;&lt;/p&gt;
447+
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;
448+
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Never. Seer won't show the assembly tab at start up.&lt;/li&gt;
449+
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Always. Seer will always show the assembly tab.&lt;/li&gt;
450+
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Auto. Seer will show the the assembly tab if there is no source file to show.&lt;/li&gt;&lt;/ul&gt;
451+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; background-color:transparent;&quot;&gt;The assembly tab can always be shown with:&lt;/span&gt;&lt;/p&gt;
409452
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
410453
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Monospace';&quot;&gt; View-&amp;gt;Assembly View&lt;/span&gt;&lt;/p&gt;
411454
&lt;p style=&quot;-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';&quot;&gt;&lt;br /&gt;&lt;/p&gt;
@@ -421,15 +464,18 @@ p, li { white-space: pre-wrap; }
421464
&lt;p style=&quot;-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';&quot;&gt;&lt;br /&gt;&lt;/p&gt;
422465
&lt;p style=&quot;-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';&quot;&gt;&lt;br /&gt;&lt;/p&gt;
423466
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Monospace';&quot;&gt;The Assembly Editor can show different columns along side the assembly. These can be quickly changed in the Assembly Editor using ^F.&lt;/span&gt;&lt;/p&gt;
424-
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Address&lt;/li&gt;
467+
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;
468+
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Address&lt;/li&gt;
425469
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Offset&lt;/li&gt;
426470
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Opcode&lt;/li&gt;
427471
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Source&lt;/li&gt;&lt;/ul&gt;
428472
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;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.&lt;/p&gt;
429-
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;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.&lt;/li&gt;
473+
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;
474+
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;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.&lt;/li&gt;
430475
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Length - A number of bytes after the current $PC is shown.&lt;/li&gt;&lt;/ul&gt;
431476
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; background-color:transparent;&quot;&gt;In the Register browser, register values can be shown in various formats:&lt;/span&gt;&lt;/p&gt;
432-
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; background-color:transparent;&quot;&gt;Natural (A predefined format, based on the register name)&lt;/span&gt;&lt;/li&gt;
477+
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;
478+
&lt;li style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; background-color:transparent;&quot;&gt;Natural (A predefined format, based on the register name)&lt;/span&gt;&lt;/li&gt;
433479
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Hex&lt;/li&gt;
434480
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Octal&lt;/li&gt;
435481
&lt;li style=&quot; background-color:transparent;&quot; style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Binary&lt;/li&gt;
@@ -443,7 +489,6 @@ p, li { white-space: pre-wrap; }
443489
<zorder>printPointGroupBox</zorder>
444490
</widget>
445491
<tabstops>
446-
<tabstop>assemblyTabOnStartupCheckBox</tabstop>
447492
<tabstop>assemblyTabOnTopCheckBox</tabstop>
448493
<tabstop>attFlavorRadioButton</tabstop>
449494
<tabstop>intelFlavorRadioButton</tabstop>
@@ -461,7 +506,7 @@ p, li { white-space: pre-wrap; }
461506
<connections/>
462507
<buttongroups>
463508
<buttongroup name="disassemblyFlavorButtonGroup"/>
464-
<buttongroup name="assemblyDemangleButtonGroup"/>
465509
<buttongroup name="disassemblyModeButtonGroup"/>
510+
<buttongroup name="assemblyDemangleButtonGroup"/>
466511
</buttongroups>
467512
</ui>

src/SeerBreakpointsBrowserWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void SeerBreakpointsBrowserWidget::handleItemDoubleClicked (QTreeWidgetItem* ite
233233
int lineno = item->text(8).toInt();
234234

235235
emit selectedFile(item->text(6), item->text(7), lineno);
236-
emit selectedAddress(item->text(4));
236+
emit maybeSelectedAddress(item->text(6), item->text(7), item->text(4));
237237
}
238238

239239
void SeerBreakpointsBrowserWidget::handleRefreshToolButton () {

src/SeerBreakpointsBrowserWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class SeerBreakpointsBrowserWidget : public QWidget, protected Ui::SeerBreakpoin
4747
void insertBreakpoint (QString breakpoint);
4848
void selectedFile (QString file, QString fullname, int lineno);
4949
void selectedAddress (QString address);
50+
void maybeSelectedAddress (QString file, QString fullname, QString address);
5051

5152
protected:
5253
void showEvent (QShowEvent* event);

src/SeerConfigDialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,14 @@ QStringList SeerConfigDialog::sourceHeaderFilePatterns () const {
364364
return _sourceConfigPage->headerFilePatterns();
365365
}
366366

367-
void SeerConfigDialog::setAssemblyShowAssemblyTabOnStartup (bool flag) {
367+
void SeerConfigDialog::setAssemblyShowAssemblyTabOnStartupMode (const QString& mode) {
368368

369-
_assemblyConfigPage->setShowAssemblyTabOnStartup(flag);
369+
_assemblyConfigPage->setShowAssemblyTabOnStartupMode(mode);
370370
}
371371

372-
bool SeerConfigDialog::assemblyShowAssemblyTabOnStartup () const {
372+
QString SeerConfigDialog::assemblyShowAssemblyTabOnStartupMode () const {
373373

374-
return _assemblyConfigPage->showAssemblyTabOnStartup();
374+
return _assemblyConfigPage->showAssemblyTabOnStartupMode();
375375
}
376376

377377
void SeerConfigDialog::setAssemblyKeepAssemblyTabOnTop (bool flag) {

src/SeerConfigDialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ class SeerConfigDialog : public QDialog, protected Ui::SeerConfigDialogForm {
108108
QStringList sourceHeaderFilePatterns () const;
109109

110110
// Assembly settings.
111-
void setAssemblyShowAssemblyTabOnStartup (bool flag);
112-
bool assemblyShowAssemblyTabOnStartup () const;
111+
void setAssemblyShowAssemblyTabOnStartupMode (const QString& mode);
112+
QString assemblyShowAssemblyTabOnStartupMode () const;
113113

114114
void setAssemblyKeepAssemblyTabOnTop (bool flag);
115115
bool assemblyKeepAssemblyTabOnTop () const;

0 commit comments

Comments
 (0)