mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Added Assembly setting config tab.
(att/intel flavor, demangle symbol names, etc.)
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
-data-disassemble -a $pc -- 2
|
||||||
|
|
||||||
|
^done,asm_insns=[
|
||||||
|
{address="0x08048080",func-name="_start",offset="0",opcodes="ba 0e 00 00 00",inst="mov edx,0xe"},
|
||||||
|
{address="0x08048085",func-name="_start",offset="5",opcodes="b9 a4 90 04 08",inst="mov ecx,0x80490a4"},
|
||||||
|
{address="0x0804808a",func-name="_start",offset="10",opcodes="bb 01 00 00 00",inst="mov ebx,0x1"},
|
||||||
|
{address="0x0804808f",func-name="_start",offset="15",opcodes="b8 04 00 00 00",inst="mov eax,0x4"},
|
||||||
|
{address="0x08048094",func-name="_start",offset="20",opcodes="cd 80",inst="int 0x80"},
|
||||||
|
{address="0x08048096",func-name="_start",offset="22",opcodes="bb 00 00 00 00",inst="mov ebx,0x0"},
|
||||||
|
{address="0x0804809b",func-name="_start",offset="27",opcodes="b8 01 00 00 00",inst="mov eax,0x1"},
|
||||||
|
{address="0x080480a0",func-name="_start",offset="32",opcodes="cd 80",inst="int 0x80"}
|
||||||
|
]
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ void SeerEditorManagerWidget::showAssembly () {
|
|||||||
createAssemblyWidgetTab();
|
createAssemblyWidgetTab();
|
||||||
}
|
}
|
||||||
|
|
||||||
assemblyWidgetTab()->assemblyArea()->requestAssembly("$pc");
|
assemblyWidgetTab()->assemblyArea()->setAddress("$pc");
|
||||||
}
|
}
|
||||||
|
|
||||||
SeerEditorWidgetAssembly* SeerEditorManagerWidget::assemblyWidgetTab () {
|
SeerEditorWidgetAssembly* SeerEditorManagerWidget::assemblyWidgetTab () {
|
||||||
@@ -1024,3 +1024,12 @@ void SeerEditorManagerWidget::handleRequestAssembly (QString address) {
|
|||||||
emit refreshStackFrames();
|
emit refreshStackFrames();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SeerEditorManagerWidget::handleAssemblyConfigChanged () {
|
||||||
|
|
||||||
|
// Tell the assembly tab to refresh.
|
||||||
|
if (assemblyWidgetTab() != 0) {
|
||||||
|
assemblyWidgetTab()->reloadAssembly();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
|
|||||||
void handleAddMemoryVisualizer (QString expression);
|
void handleAddMemoryVisualizer (QString expression);
|
||||||
void handleAddArrayVisualizer (QString expression);
|
void handleAddArrayVisualizer (QString expression);
|
||||||
void handleRequestAssembly (QString address);
|
void handleRequestAssembly (QString address);
|
||||||
|
void handleAssemblyConfigChanged ();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleFileOpenToolButtonClicked ();
|
void handleFileOpenToolButtonClicked ();
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ SeerEditorWidgetAssembly::SeerEditorWidgetAssembly(QWidget* parent) : QWidget(pa
|
|||||||
QObject::connect(searchUpToolButton, &QToolButton::clicked, this, &SeerEditorWidgetAssembly::handleSearchUpToolButton);
|
QObject::connect(searchUpToolButton, &QToolButton::clicked, this, &SeerEditorWidgetAssembly::handleSearchUpToolButton);
|
||||||
QObject::connect(searchLineNumberLineEdit, &QLineEdit::returnPressed, this, &SeerEditorWidgetAssembly::handleSearchLineNumberLineEdit);
|
QObject::connect(searchLineNumberLineEdit, &QLineEdit::returnPressed, this, &SeerEditorWidgetAssembly::handleSearchLineNumberLineEdit);
|
||||||
QObject::connect(searchCloseToolButton, &QToolButton::clicked, this, &SeerEditorWidgetAssembly::handleSearchCloseToolButton);
|
QObject::connect(searchCloseToolButton, &QToolButton::clicked, this, &SeerEditorWidgetAssembly::handleSearchCloseToolButton);
|
||||||
|
QObject::connect(refreshToolButton, &QToolButton::clicked, this, &SeerEditorWidgetAssembly::reloadAssembly);
|
||||||
QObject::connect(assemblyWidget, &SeerEditorWidgetAssemblyArea::showSearchBar, this, &SeerEditorWidgetAssembly::showSearchBar);
|
QObject::connect(assemblyWidget, &SeerEditorWidgetAssemblyArea::showSearchBar, this, &SeerEditorWidgetAssembly::showSearchBar);
|
||||||
|
|
||||||
QObject::connect(_textSearchShortcut, &QShortcut::activated, this, &SeerEditorWidgetAssembly::handleTextSearchShortcut);
|
QObject::connect(_textSearchShortcut, &QShortcut::activated, this, &SeerEditorWidgetAssembly::handleTextSearchShortcut);
|
||||||
@@ -100,6 +101,13 @@ const SeerKeySettings& SeerEditorWidgetAssembly::keySettings () const {
|
|||||||
return _keySettings;
|
return _keySettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SeerEditorWidgetAssembly::reloadAssembly () {
|
||||||
|
|
||||||
|
QString addr = assemblyArea()->address();
|
||||||
|
|
||||||
|
assemblyArea()->setAddress(addr, true);
|
||||||
|
}
|
||||||
|
|
||||||
void SeerEditorWidgetAssembly::showSearchBar (bool flag) {
|
void SeerEditorWidgetAssembly::showSearchBar (bool flag) {
|
||||||
|
|
||||||
// Go through the widgets in the search bar and hide/show them.
|
// Go through the widgets in the search bar and hide/show them.
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ class SeerEditorWidgetAssemblyArea : public SeerPlainTextEdit {
|
|||||||
void miniMapAreaPaintEvent (QPaintEvent* event);
|
void miniMapAreaPaintEvent (QPaintEvent* event);
|
||||||
int miniMapAreaWidth ();
|
int miniMapAreaWidth ();
|
||||||
|
|
||||||
void setAddress (const QString& address);
|
void setAddress (const QString& address, bool force=false);
|
||||||
|
const QString& address () const;
|
||||||
bool setCurrentLine (const QString& address);
|
bool setCurrentLine (const QString& address);
|
||||||
void scrollToLine (const QString& address);
|
void scrollToLine (const QString& address);
|
||||||
|
|
||||||
@@ -195,22 +196,23 @@ class SeerEditorWidgetAssembly : public QWidget, protected Ui::SeerEditorWidgetA
|
|||||||
|
|
||||||
SeerEditorWidgetAssemblyArea* assemblyArea ();
|
SeerEditorWidgetAssemblyArea* assemblyArea ();
|
||||||
|
|
||||||
bool isSearchBarShown () const;
|
bool isSearchBarShown () const;
|
||||||
bool searchMatchCase () const;
|
bool searchMatchCase () const;
|
||||||
void setKeySettings (const SeerKeySettings& settings);
|
void setKeySettings (const SeerKeySettings& settings);
|
||||||
const SeerKeySettings& keySettings () const;
|
const SeerKeySettings& keySettings () const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showSearchBar (bool flag);
|
void reloadAssembly ();
|
||||||
void setSearchMatchCase (bool flag);
|
void showSearchBar (bool flag);
|
||||||
|
void setSearchMatchCase (bool flag);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleSearchLineNumberLineEdit ();
|
void handleSearchLineNumberLineEdit ();
|
||||||
void handleSearchTextLineEdit ();
|
void handleSearchTextLineEdit ();
|
||||||
void handleSearchDownToolButton ();
|
void handleSearchDownToolButton ();
|
||||||
void handleSearchUpToolButton ();
|
void handleSearchUpToolButton ();
|
||||||
void handleSearchCloseToolButton ();
|
void handleSearchCloseToolButton ();
|
||||||
void handleTextSearchShortcut ();
|
void handleTextSearchShortcut ();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -131,6 +131,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="refreshToolButton">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Refresh the Assembly view.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resource.qrc">
|
||||||
|
<normaloff>:/seer/resources/RelaxLightIcons/view-refresh.svg</normaloff>:/seer/resources/RelaxLightIcons/view-refresh.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -482,11 +482,11 @@ void SeerEditorWidgetAssemblyArea::refreshExtraSelections () {
|
|||||||
setExtraSelections(extraSelections);
|
setExtraSelections(extraSelections);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SeerEditorWidgetAssemblyArea::setAddress (const QString& address) {
|
void SeerEditorWidgetAssemblyArea::setAddress (const QString& address, bool force) {
|
||||||
|
|
||||||
// Emit the signal to load the assembly for address 'address' if
|
// Emit the signal to load the assembly for address 'address' if
|
||||||
// it's not already loaded.
|
// it's not already loaded.
|
||||||
if (_addressLineMap.contains(address.toULongLong(0,0)) == false) {
|
if (_addressLineMap.contains(address.toULongLong(0,0)) == false || force == true) {
|
||||||
|
|
||||||
// Hack to keep track of address when the assembly hasn't been loaded yet.
|
// Hack to keep track of address when the assembly hasn't been loaded yet.
|
||||||
_currentAddress = address;
|
_currentAddress = address;
|
||||||
@@ -495,6 +495,11 @@ void SeerEditorWidgetAssemblyArea::setAddress (const QString& address) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString& SeerEditorWidgetAssemblyArea::address () const {
|
||||||
|
|
||||||
|
return _currentAddress;
|
||||||
|
}
|
||||||
|
|
||||||
bool SeerEditorWidgetAssemblyArea::setCurrentLine (const QString& address) {
|
bool SeerEditorWidgetAssemblyArea::setCurrentLine (const QString& address) {
|
||||||
|
|
||||||
//qDebug() << address;
|
//qDebug() << address;
|
||||||
@@ -1119,7 +1124,7 @@ void SeerEditorWidgetAssemblyArea::handleText (const QString& text) {
|
|||||||
// Move to the line that has our address.
|
// Move to the line that has our address.
|
||||||
setCurrentLine(_currentAddress);
|
setCurrentLine(_currentAddress);
|
||||||
|
|
||||||
_currentAddress = "";
|
// _currentAddress = ""; // Do we need to reset this?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
|
|||||||
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, _catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::handleStoppingPointReached);
|
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, _catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::handleStoppingPointReached);
|
||||||
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, _printpointsBrowserWidget, &SeerPrintpointsBrowserWidget::handleStoppingPointReached);
|
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, _printpointsBrowserWidget, &SeerPrintpointsBrowserWidget::handleStoppingPointReached);
|
||||||
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget, &SeerStackManagerWidget::handleStoppingPointReached);
|
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget, &SeerStackManagerWidget::handleStoppingPointReached);
|
||||||
|
QObject::connect(this, &SeerGdbWidget::assemblyConfigChanged, editorManagerWidget, &SeerEditorManagerWidget::handleAssemblyConfigChanged);
|
||||||
|
|
||||||
QObject::connect(leftCenterRightSplitter, &QSplitter::splitterMoved, this, &SeerGdbWidget::handleSplitterMoved);
|
QObject::connect(leftCenterRightSplitter, &QSplitter::splitterMoved, this, &SeerGdbWidget::handleSplitterMoved);
|
||||||
QObject::connect(sourceLibraryVariableManagerSplitter, &QSplitter::splitterMoved, this, &SeerGdbWidget::handleSplitterMoved);
|
QObject::connect(sourceLibraryVariableManagerSplitter, &QSplitter::splitterMoved, this, &SeerGdbWidget::handleSplitterMoved);
|
||||||
@@ -2242,6 +2243,8 @@ void SeerGdbWidget::setAssemblyDisassembyFlavor (const QString& flavor) {
|
|||||||
|
|
||||||
if (isGdbRuning()) {
|
if (isGdbRuning()) {
|
||||||
handleGdbAssemblyDisassemblyFlavor();
|
handleGdbAssemblyDisassemblyFlavor();
|
||||||
|
|
||||||
|
emit assemblyConfigChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2256,6 +2259,8 @@ void SeerGdbWidget::setAssemblySymbolDemagling (const QString& onoff) {
|
|||||||
|
|
||||||
if (isGdbRuning()) {
|
if (isGdbRuning()) {
|
||||||
handleGdbAssemblySymbolDemangling();
|
handleGdbAssemblySymbolDemangling();
|
||||||
|
|
||||||
|
emit assemblyConfigChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
|||||||
signals:
|
signals:
|
||||||
void stoppingPointReached ();
|
void stoppingPointReached ();
|
||||||
void changeWindowTitle (QString title);
|
void changeWindowTitle (QString title);
|
||||||
|
void assemblyConfigChanged ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user