Skip to content

Commit

Permalink
Merge be9d090 into a4be9f8
Browse files Browse the repository at this point in the history
  • Loading branch information
torusrxxx committed Oct 17, 2023
2 parents a4be9f8 + be9d090 commit ae0467f
Show file tree
Hide file tree
Showing 33 changed files with 2,785 additions and 498 deletions.
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
10 changes: 5 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 @@ -226,11 +226,11 @@ 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->getTraceBrowser(), SIGNAL(displayReferencesWidget()), this, SLOT(displayReferencesWidget()));
//connect(mTraceWidget->getTraceBrowser(), 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
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;
};

0 comments on commit ae0467f

Please sign in to comment.