Skip to content

Commit

Permalink
Debugger: Split out SymbolImporter into its own class
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd authored and SternXD committed Dec 5, 2024
1 parent 369b7b9 commit 40a5b5f
Show file tree
Hide file tree
Showing 12 changed files with 516 additions and 447 deletions.
1 change: 1 addition & 0 deletions pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <QtWidgets/QStyledItemDelegate>

#include "DebugTools/DebugInterface.h"
#include "DebugTools/SymbolGuardian.h"

class SymbolTreeValueDelegate : public QStyledItemDelegate
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Debugger/SymbolTree/SymbolTreeWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void SymbolTreeWidget::reset()

m_ui.treeView->setColumnHidden(SymbolTreeModel::SIZE, !m_show_size_column || !m_show_size_column->isChecked());

m_cpu.GetSymbolGuardian().UpdateFunctionHashes(m_cpu);
m_cpu.GetSymbolImporter().UpdateFunctionHashes(m_cpu);

SymbolFilters filters;
std::unique_ptr<SymbolTreeNode> root;
Expand Down
2 changes: 2 additions & 0 deletions pcsx2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ set(pcsx2DebugToolsSources
DebugTools/MipsStackWalk.cpp
DebugTools/Breakpoints.cpp
DebugTools/SymbolGuardian.cpp
DebugTools/SymbolImporter.cpp
DebugTools/DisR3000A.cpp
DebugTools/DisR5900asm.cpp
DebugTools/DisVU0Micro.cpp
Expand All @@ -806,6 +807,7 @@ set(pcsx2DebugToolsHeaders
DebugTools/MipsStackWalk.h
DebugTools/Breakpoints.h
DebugTools/SymbolGuardian.h
DebugTools/SymbolImporter.h
DebugTools/Debug.h
DebugTools/DisASM.h
DebugTools/DisVUmicro.h
Expand Down
10 changes: 10 additions & 0 deletions pcsx2/DebugTools/DebugInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,11 @@ SymbolGuardian& R5900DebugInterface::GetSymbolGuardian() const
return R5900SymbolGuardian;
}

SymbolImporter& R5900DebugInterface::GetSymbolImporter() const
{
return R5900SymbolImporter;
}

std::vector<std::unique_ptr<BiosThread>> R5900DebugInterface::GetThreadList() const
{
return getEEThreads();
Expand Down Expand Up @@ -1213,6 +1218,11 @@ SymbolGuardian& R3000DebugInterface::GetSymbolGuardian() const
return R3000SymbolGuardian;
}

SymbolImporter& R3000DebugInterface::GetSymbolImporter() const
{
return R3000SymbolImporter;
}

std::vector<std::unique_ptr<BiosThread>> R3000DebugInterface::GetThreadList() const
{
return getIOPThreads();
Expand Down
16 changes: 10 additions & 6 deletions pcsx2/DebugTools/DebugInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "MemoryTypes.h"
#include "ExpressionParser.h"
#include "SymbolGuardian.h"
#include "SymbolImporter.h"

#include <string>

Expand Down Expand Up @@ -81,8 +82,9 @@ class DebugInterface : public MemoryReader
virtual bool isValidAddress(u32 address) = 0;
virtual u32 getCycles() = 0;
virtual BreakPointCpu getCpuType() = 0;
[[nodiscard]] virtual SymbolGuardian& GetSymbolGuardian() const = 0;
[[nodiscard]] virtual std::vector<std::unique_ptr<BiosThread>> GetThreadList() const = 0;
virtual SymbolGuardian& GetSymbolGuardian() const = 0;
virtual SymbolImporter& GetSymbolImporter() const = 0;
virtual std::vector<std::unique_ptr<BiosThread>> GetThreadList() const = 0;

bool evaluateExpression(const char* expression, u64& dest);
bool initExpression(const char* exp, PostfixExpression& dest);
Expand Down Expand Up @@ -136,8 +138,9 @@ class R5900DebugInterface : public DebugInterface
bool getCPCOND0() override;
void setPc(u32 newPc) override;
void setRegister(int cat, int num, u128 newValue) override;
[[nodiscard]] SymbolGuardian& GetSymbolGuardian() const override;
[[nodiscard]] std::vector<std::unique_ptr<BiosThread>> GetThreadList() const override;
SymbolGuardian& GetSymbolGuardian() const override;
SymbolImporter& GetSymbolImporter() const override;
std::vector<std::unique_ptr<BiosThread>> GetThreadList() const override;

std::string disasm(u32 address, bool simplify) override;
bool isValidAddress(u32 address) override;
Expand Down Expand Up @@ -178,8 +181,9 @@ class R3000DebugInterface : public DebugInterface
bool getCPCOND0() override;
void setPc(u32 newPc) override;
void setRegister(int cat, int num, u128 newValue) override;
[[nodiscard]] SymbolGuardian& GetSymbolGuardian() const override;
[[nodiscard]] std::vector<std::unique_ptr<BiosThread>> GetThreadList() const override;
SymbolGuardian& GetSymbolGuardian() const override;
SymbolImporter& GetSymbolImporter() const override;
std::vector<std::unique_ptr<BiosThread>> GetThreadList() const override;

std::string disasm(u32 address, bool simplify) override;
bool isValidAddress(u32 address) override;
Expand Down
Loading

0 comments on commit 40a5b5f

Please sign in to comment.