From a1a3cd9d1b9af3bb9ed260772cc56da95cdf1d0c Mon Sep 17 00:00:00 2001 From: Ziemas Date: Thu, 23 Apr 2026 22:11:52 +0200 Subject: [PATCH] DebugData: Remove stack getters They're not used and the naming is confused, we can readd these if we actually want to use them. --- pcsx2-qt/Debugger/DebuggerWindow.cpp | 3 +-- pcsx2/DebugTools/BiosDebugData.cpp | 2 +- pcsx2/DebugTools/BiosDebugData.h | 7 ++----- pcsx2/DebugTools/DebugInterface.cpp | 8 ++++---- pcsx2/DebugTools/MipsStackWalk.cpp | 2 +- pcsx2/DebugTools/MipsStackWalk.h | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/pcsx2-qt/Debugger/DebuggerWindow.cpp b/pcsx2-qt/Debugger/DebuggerWindow.cpp index 2cce7168d8..a90ff3fdbc 100644 --- a/pcsx2-qt/Debugger/DebuggerWindow.cpp +++ b/pcsx2-qt/Debugger/DebuggerWindow.cpp @@ -525,8 +525,7 @@ void DebuggerWindow::onStepOut() cpu->getPC(), cpu->getRegister(0, 31), cpu->getRegister(0, 29), - thread->EntryPoint(), - thread->StackTop()); + thread->EntryPoint()); break; } } diff --git a/pcsx2/DebugTools/BiosDebugData.cpp b/pcsx2/DebugTools/BiosDebugData.cpp index 048a16bd03..344b9e84ff 100644 --- a/pcsx2/DebugTools/BiosDebugData.cpp +++ b/pcsx2/DebugTools/BiosDebugData.cpp @@ -49,7 +49,7 @@ std::vector> getIOPThreads() return {}; } - data.stackBottom = iopMemRead32(item + 0x3c); + data.stacMem = iopMemRead32(item + 0x3c); data.stackSize = iopMemRead32(item + 0x40); data.status = iopMemRead8(item + 0xc); data.tid = iopMemRead16(item + 0xa); diff --git a/pcsx2/DebugTools/BiosDebugData.h b/pcsx2/DebugTools/BiosDebugData.h index 2c3baa81db..36e89954c1 100644 --- a/pcsx2/DebugTools/BiosDebugData.h +++ b/pcsx2/DebugTools/BiosDebugData.h @@ -48,7 +48,7 @@ struct EEInternalThread u32 entry; int argc; u32 argstring; - u32 stackBottom; + u32 stackMem; int stackSize; u32 root; u32 heap_base; @@ -59,7 +59,7 @@ struct IOPInternalThread { u32 tid; u32 PC; - u32 stackBottom; + u32 stacMem; u32 stackSize; u32 regCtx; u32 status; @@ -109,7 +109,6 @@ public: [[nodiscard]] virtual WaitState Wait() const = 0; [[nodiscard]] virtual u32 WaitId() const = 0; [[nodiscard]] virtual u32 EntryPoint() const = 0; - [[nodiscard]] virtual u32 StackTop() const = 0; [[nodiscard]] virtual u32 Priority() const = 0; // Only call RegCtx on threads that aren't running @@ -145,7 +144,6 @@ public: }; [[nodiscard]] u32 WaitId() const override { return data.semaId; }; [[nodiscard]] u32 EntryPoint() const override { return data.entry; }; - [[nodiscard]] u32 StackTop() const override { return data.stackBottom + data.stackSize; }; [[nodiscard]] u32 Priority() const override { return data.currentPriority; }; [[nodiscard]] u32 RegCtx() const override { return data.regCtx; }; @@ -190,7 +188,6 @@ public: }; [[nodiscard]] u32 WaitId() const override { return data.waitId; }; [[nodiscard]] u32 EntryPoint() const override { return data.entrypoint; }; - [[nodiscard]] u32 StackTop() const override { return data.stackBottom + data.stackSize; }; [[nodiscard]] u32 Priority() const override { return data.initPriority; }; [[nodiscard]] u32 RegCtx() const override { return data.regCtx; }; diff --git a/pcsx2/DebugTools/DebugInterface.cpp b/pcsx2/DebugTools/DebugInterface.cpp index bc3e348987..a64b9b348d 100644 --- a/pcsx2/DebugTools/DebugInterface.cpp +++ b/pcsx2/DebugTools/DebugInterface.cpp @@ -713,7 +713,7 @@ std::vector R5900DebugInterface::StackTrace(const Bio if (thread.Status() == ThreadStatus::THS_RUN) { return MipsStackWalk::Walk(this, getPC(), getRegister(0, 31), getRegister(0, 29), - thread.EntryPoint(), thread.StackTop()); + thread.EntryPoint()); } EEInternalCtx* ctx = static_cast(PSM(thread.RegCtx())); @@ -722,7 +722,7 @@ std::vector R5900DebugInterface::StackTrace(const Bio u32 ra = ctx->gpr[31 - 1]._u32[0]; u32 sp = ctx->gpr[29 - 1]._u32[0]; - return MipsStackWalk::Walk(this, pc, ra, sp, thread.EntryPoint(), thread.StackTop()); + return MipsStackWalk::Walk(this, pc, ra, sp, thread.EntryPoint()); } std::vector R5900DebugInterface::GetModuleList() const @@ -1071,7 +1071,7 @@ std::vector R3000DebugInterface::StackTrace(const Bio if (thread.Status() == ThreadStatus::THS_RUN) { return MipsStackWalk::Walk(this, getPC(), getRegister(0, 31), getRegister(0, 29), - thread.EntryPoint(), thread.StackTop()); + thread.EntryPoint()); } u32 p = thread.RegCtx(); @@ -1079,7 +1079,7 @@ std::vector R3000DebugInterface::StackTrace(const Bio u32 ra = Read32(p + 0x7c); u32 sp = Read32(p + 0x74); - return MipsStackWalk::Walk(this, pc, ra, sp, thread.EntryPoint(), thread.StackTop()); + return MipsStackWalk::Walk(this, pc, ra, sp, thread.EntryPoint()); } std::vector R3000DebugInterface::GetModuleList() const diff --git a/pcsx2/DebugTools/MipsStackWalk.cpp b/pcsx2/DebugTools/MipsStackWalk.cpp index cafcbfeace..a77b79367f 100644 --- a/pcsx2/DebugTools/MipsStackWalk.cpp +++ b/pcsx2/DebugTools/MipsStackWalk.cpp @@ -183,7 +183,7 @@ namespace MipsStackWalk return ScanForEntry(cpu, frame, newPossibleEntry, ra); } - std::vector Walk(DebugInterface* cpu, u32 pc, u32 ra, u32 sp, u32 threadEntry, u32 threadStackTop) + std::vector Walk(DebugInterface* cpu, u32 pc, u32 ra, u32 sp, u32 threadEntry) { std::vector frames; StackFrame current; diff --git a/pcsx2/DebugTools/MipsStackWalk.h b/pcsx2/DebugTools/MipsStackWalk.h index 364b874a5b..e4d6ddc425 100644 --- a/pcsx2/DebugTools/MipsStackWalk.h +++ b/pcsx2/DebugTools/MipsStackWalk.h @@ -20,5 +20,5 @@ namespace MipsStackWalk { int stackSize; }; - std::vector Walk(DebugInterface* cpu, u32 pc, u32 ra, u32 sp, u32 threadEntry, u32 threadStackTop); + std::vector Walk(DebugInterface* cpu, u32 pc, u32 ra, u32 sp, u32 threadEntry); };