Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced dump to trace #3098

Open
wants to merge 30 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d5384d7
Introduced dump to trace
torusrxxx May 18, 2023
5adac83
Disassemble to get correct memory operand size
torusrxxx Jun 7, 2023
f3d0f9a
Use trace file dump index to accelerate memory reference search
torusrxxx Jun 11, 2023
226efe3
Added trace dump to trace widget
torusrxxx Jul 27, 2023
9852b09
Fixed CustomizeMenuDialog and various features related to modules
torusrxxx Aug 20, 2023
42208c0
Add files via upload
torusrxxx Sep 1, 2023
9750488
Fixed empty dump
torusrxxx Sep 15, 2023
b45acd5
fix PUSH memory access don't appear in dump
torusrxxx Sep 15, 2023
de28917
optimize getBytes and fixed empty dump while not debugging
torusrxxx Sep 15, 2023
090da1a
Multiple trace tabs
torusrxxx Sep 16, 2023
77cfffa
Modify mTraceFile to getTraceFile() for later move to TraceWidget
torusrxxx Sep 19, 2023
ecc5a16
temporary
torusrxxx Sep 20, 2023
80995bb
Merge branch 'development' into patch000000dc
torusrxxx Sep 20, 2023
3a9e36b
Fix crash in menu builder when opening second tab
torusrxxx Sep 20, 2023
87ca72d
Moved trace file reader to trace widget
torusrxxx Sep 26, 2023
34bdcb7
Fix memory access by first instruction not in trace
torusrxxx Sep 26, 2023
cd810ad
revert vcxproj changes
torusrxxx Sep 26, 2023
f75c4fd
Fixed closing trace tab
torusrxxx Oct 2, 2023
a9645df
Fix crash in MenuBuilder getId again
torusrxxx Oct 2, 2023
8700a5c
Remove placeholder tab, add context menu in trace manager
torusrxxx Oct 6, 2023
07fbd1a
Fixed persistent crash at registerMenuBuilder; adjust menu order; fix…
torusrxxx Oct 7, 2023
8dd134f
Add DisableTraceDump setting and clean up
torusrxxx Oct 7, 2023
be9d090
Add browse in explorer action in trace view
torusrxxx Oct 17, 2023
c137b7e
Merge branch 'development' into patch000000dc
torusrxxx Feb 19, 2024
c5ca1c6
Merge branch 'development' into patch000000dc
torusrxxx Apr 10, 2024
5f1868b
Add stack view in trace browser
torusrxxx Apr 10, 2024
d0bd094
Tidy up code of trace stack
torusrxxx Apr 12, 2024
a436a4b
Add xref dialog to trace dump
torusrxxx Apr 20, 2024
a461951
Add Xrefs to trace disassembler too
torusrxxx Apr 20, 2024
9749d15
Fix showing reference and log from trace
torusrxxx Apr 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/gui/Src/BasicView/HexDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static int dwordStringMaxLength(HexDump::DwordViewMode mode);
static int qwordStringMaxLength(HexDump::QwordViewMode mode);
static int twordStringMaxLength(HexDump::TwordViewMode mode);

HexDump::HexDump(Architecture* architecture, QWidget* parent)
HexDump::HexDump(Architecture* architecture, QWidget* parent, MemoryPage* memPage)
: AbstractTableView(parent),
mArchitecture(architecture)
{
Expand All @@ -27,7 +27,10 @@ HexDump::HexDump(Architecture* architecture, QWidget* parent)

setRowCount(0);

mMemPage = new MemoryPage(0, 0);
if(!memPage)
mMemPage = new MemoryPage(0, 0, this);
else
mMemPage = memPage;
mForceColumn = -1;

clearDescriptors();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/Src/BasicView/HexDump.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class HexDump : public AbstractTableView
std::function<void()> columnSwitch;
};

HexDump(Architecture* architecture, QWidget* parent = nullptr);
explicit HexDump(Architecture* architecture, QWidget* parent = nullptr, MemoryPage* memPage = nullptr);
~HexDump() override;

// Configuration
Expand Down Expand Up @@ -127,7 +127,7 @@ class HexDump : public AbstractTableView
void appendResetDescriptor(int width, QString title, bool clickable, ColumnDescriptor descriptor);
void clearDescriptors();

void printDumpAt(duint parVA, bool select, bool repaint = true, bool updateTableOffset = true);
virtual void printDumpAt(duint parVA, bool select, bool repaint = true, bool updateTableOffset = true);
duint rvaToVa(duint rva) const;

duint getTableOffsetRva() const;
Expand Down
5 changes: 3 additions & 2 deletions src/gui/Src/Gui/CPUDisassembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class CPUDisassembly : public Disassembly

// Context menu management
void setupRightClickContextMenu();
void addFollowReferenceMenuItem(QString name, duint value, QMenu* menu, bool isReferences, bool isFollowInCPU);
void setupFollowReferenceMenu(duint va, QMenu* menu, bool isReferences, bool isFollowInCPU);
void copySelectionSlot(bool copyBytes);
void copySelectionToFileSlot(bool copyBytes);
void setSideBar(CPUSideBar* sideBar);
Expand Down Expand Up @@ -116,6 +114,9 @@ public slots:

void pushSelectionInto(bool copyBytes, QTextStream & stream, QTextStream* htmlStream = nullptr);

void addFollowReferenceMenuItem(QString name, duint value, QMenu* menu, bool isReferences, bool isFollowInCPU);
void setupFollowReferenceMenu(duint va, QMenu* menu, bool isReferences, bool isFollowInCPU);

// Menus
QMenu* mHwSlotSelectMenu;
QMenu* mPluginMenu = nullptr;
Expand Down
6 changes: 4 additions & 2 deletions src/gui/Src/Gui/CustomizeMenuDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ CustomizeMenuDialog::CustomizeMenuDialog(QWidget* parent) :
builder = i.builder;
id = builder->getId();
}
else //invalid or unsupported type.Continue
else // Invalid or unsupported type. Continue
continue;
//Get localized string for the name of individual views
// Get localized string for the name of individual views
if(id == "CPUDisassembly")
viewName = tr("Disassembler");
else if(id == "CPUDump")
Expand Down Expand Up @@ -62,6 +62,8 @@ CustomizeMenuDialog::CustomizeMenuDialog(QWidget* parent) :
viewName = tr("View");
else if(id == "TraceBrowser")
viewName = tr("Trace disassembler");
else if(id == "TraceDump")
viewName = tr("Trace dump");
else
continue;
// Add Parent Node
Expand Down
9 changes: 4 additions & 5 deletions src/gui/Src/Gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
#include "MRUList.h"
#include "AboutDialog.h"
#include "UpdateChecker.h"
#include "Tracer/TraceBrowser.h"
#include "Tracer/TraceWidget.h"
#include "Tracer/TraceManager.h"
//#include "Tracer/TraceWidget.h"
#include "Utils/MethodInvoker.h"

MainWindow::MainWindow(QWidget* parent)
Expand Down Expand Up @@ -227,11 +227,10 @@ MainWindow::MainWindow(QWidget* parent)
mHandlesView->setWindowIcon(DIcon("handles"));

// Trace view
mTraceWidget = new TraceWidget(this);
mTraceWidget = new TraceManager(this);
mTraceWidget->setWindowTitle(tr("Trace"));
mTraceWidget->setWindowIcon(DIcon("trace"));
connect(mTraceWidget->getTraceBrowser(), SIGNAL(displayReferencesWidget()), this, SLOT(displayReferencesWidget()));
connect(mTraceWidget->getTraceBrowser(), SIGNAL(displayLogWidget()), this, SLOT(displayLogWidget()));
connect(mTraceWidget, SIGNAL(displayLogWidget()), this, SLOT(displayLogWidget()));

mTabWidget = new MHTabWidget(this, true, true);

Expand Down
4 changes: 2 additions & 2 deletions src/gui/Src/Gui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SettingsDialog;
class SimpleTraceDialog;
class MRUList;
class UpdateChecker;
class TraceWidget;
class TraceManager;

namespace Ui
{
Expand Down Expand Up @@ -174,7 +174,7 @@ public slots:
CalculatorDialog* mCalculatorDialog;
HandlesView* mHandlesView;
NotesManager* mNotesManager;
TraceWidget* mTraceWidget;
TraceManager* mTraceWidget;
SimpleTraceDialog* mSimpleTraceDialog;
UpdateChecker* mUpdateChecker;
DebugStatusLabel* mStatusLabel;
Expand Down
7 changes: 7 additions & 0 deletions src/gui/Src/Gui/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ void SettingsDialog::LoadSettings()
GetSettingBool("Gui", "EnableQtHighDpiScaling", &settings.guiEnableQtHighDpiScaling);
GetSettingBool("Gui", "WindowLongPath", &settings.guiEnableWindowLongPath);
GetSettingBool("Gui", "NoIcons", &settings.guiNoIcons);
GetSettingBool("Gui", "DisableTraceDump", &settings.guiDisableTraceDump);
ui->chkFpuRegistersLittleEndian->setChecked(settings.guiFpuRegistersLittleEndian);
ui->chkSaveColumnOrder->setChecked(settings.guiSaveColumnOrder);
ui->chkNoCloseDialog->setChecked(settings.guiNoCloseDialog);
Expand All @@ -291,6 +292,7 @@ void SettingsDialog::LoadSettings()
ui->chkQtHighDpiScaling->setChecked(settings.guiEnableQtHighDpiScaling);
ui->chkWindowLongPath->setChecked(settings.guiEnableWindowLongPath);
ui->chkNoIcons->setChecked(settings.guiNoIcons);
ui->chkDisableTraceDump->setChecked(settings.guiDisableTraceDump);

//Misc tab
if(DbgFunctions()->GetJit)
Expand Down Expand Up @@ -443,6 +445,7 @@ void SettingsDialog::SaveSettings()
BridgeSettingSetUint("Gui", "EnableQtHighDpiScaling", settings.guiEnableQtHighDpiScaling);
BridgeSettingSetUint("Gui", "WindowLongPath", settings.guiEnableWindowLongPath);
BridgeSettingSetUint("Gui", "NoIcons", settings.guiNoIcons);
BridgeSettingSetUint("Gui", "DisableTraceDump", settings.guiDisableTraceDump);

//Misc tab
if(DbgFunctions()->GetJit)
Expand Down Expand Up @@ -1164,3 +1167,7 @@ void SettingsDialog::on_chkNoIcons_toggled(bool checked)
settings.guiNoIcons = checked;
}

void SettingsDialog::on_chkDisableTraceDump_toggled(bool checked)
{
settings.guiDisableTraceDump = checked;
}
2 changes: 2 additions & 0 deletions src/gui/Src/Gui/SettingsDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ private slots:
void on_chkQtHighDpiScaling_toggled(bool checked);
void on_chkWindowLongPath_toggled(bool checked);
void on_chkNoIcons_toggled(bool checked);
void on_chkDisableTraceDump_toggled(bool checked);
//Misc tab
void on_chkSetJIT_stateChanged(int arg1);
void on_editSymbolStore_textEdited(const QString & arg1);
Expand Down Expand Up @@ -248,6 +249,7 @@ private slots:
bool guiEnableQtHighDpiScaling = true;
bool guiEnableWindowLongPath = false;
bool guiNoIcons = false;
bool guiDisableTraceDump = false;
//Misc Tab
bool miscSetJIT = false;
bool miscSymbolStore = false;
Expand Down
10 changes: 10 additions & 0 deletions src/gui/Src/Gui/SettingsDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkDisableTraceDump">
<property name="toolTip">
<string>Dump in trace view consumes significant memory and CPU resources. It can be disabled if you find it too slow. Already opened trace tabs are not affected.</string>
</property>
<property name="text">
<string>Disable dump in trace view</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacerGUI">
<property name="orientation">
Expand Down
2 changes: 1 addition & 1 deletion src/gui/Src/Gui/XrefBrowseDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private slots:

void changeAddress(duint address);
void setupContextMenu();
QString GetFunctionSymbol(duint addr);
static QString GetFunctionSymbol(duint addr);

XREF_INFO mXrefInfo;
duint mAddress;
Expand Down
6 changes: 3 additions & 3 deletions src/gui/Src/Memory/MemoryPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class MemoryPage : public QObject
public:
explicit MemoryPage(duint parBase, duint parSize, QObject* parent = nullptr);

bool read(void* parDest, dsint parRVA, duint parSize) const;
bool write(const void* parDest, dsint parRVA, duint parSize);
virtual bool read(void* parDest, dsint parRVA, duint parSize) const;
virtual bool write(const void* parDest, dsint parRVA, duint parSize);
duint getSize() const;
duint getBase() const;
duint va(dsint rva) const;
void setAttributes(duint base, duint size);
bool inRange(duint va) const;

private:
protected:
duint mBase;
duint mSize;
};