mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-10-12 02:08:45 +00:00
DebugInterface: Enable stack tracing any EE thread
This commit is contained in:
@@ -111,8 +111,7 @@ void StackModel::refreshData()
|
||||
{
|
||||
if (thread->Status() == ThreadStatus::THS_RUN)
|
||||
{
|
||||
m_stackFrames = MipsStackWalk::Walk(&m_cpu, m_cpu.getPC(), m_cpu.getRegister(0, 31), m_cpu.getRegister(0, 29),
|
||||
thread->EntryPoint(), thread->StackTop());
|
||||
m_stackFrames = m_cpu.StackTrace(*thread);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,6 +708,23 @@ std::vector<std::unique_ptr<BiosThread>> R5900DebugInterface::GetThreadList() co
|
||||
return getEEThreads();
|
||||
}
|
||||
|
||||
std::vector<MipsStackWalk::StackFrame> R5900DebugInterface::StackTrace(const BiosThread& thread)
|
||||
{
|
||||
if (thread.Status() == ThreadStatus::THS_RUN)
|
||||
{
|
||||
return MipsStackWalk::Walk(this, getPC(), getRegister(0, 31), getRegister(0, 29),
|
||||
thread.EntryPoint(), thread.StackTop());
|
||||
}
|
||||
|
||||
EEInternalCtx* ctx = static_cast<EEInternalCtx*>(PSM(thread.RegCtx()));
|
||||
u32 pc = thread.PC();
|
||||
// $zero is not in the array so subtract 1
|
||||
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());
|
||||
}
|
||||
|
||||
std::vector<IopMod> R5900DebugInterface::GetModuleList() const
|
||||
{
|
||||
return {};
|
||||
@@ -1049,6 +1066,17 @@ std::vector<std::unique_ptr<BiosThread>> R3000DebugInterface::GetThreadList() co
|
||||
return getIOPThreads();
|
||||
}
|
||||
|
||||
std::vector<MipsStackWalk::StackFrame> R3000DebugInterface::StackTrace(const BiosThread& thread)
|
||||
{
|
||||
if (thread.Status() == ThreadStatus::THS_RUN)
|
||||
{
|
||||
return MipsStackWalk::Walk(this, getPC(), getRegister(0, 31), getRegister(0, 29),
|
||||
thread.EntryPoint(), thread.StackTop());
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<IopMod> R3000DebugInterface::GetModuleList() const
|
||||
{
|
||||
return getIOPModules();
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "ExpressionParser.h"
|
||||
#include "SymbolGuardian.h"
|
||||
#include "SymbolImporter.h"
|
||||
#include "MipsStackWalk.h"
|
||||
|
||||
#include "common/MemoryInterface.h"
|
||||
|
||||
@@ -72,6 +73,7 @@ public:
|
||||
virtual SymbolGuardian& GetSymbolGuardian() const = 0;
|
||||
virtual SymbolImporter* GetSymbolImporter() const = 0;
|
||||
virtual std::vector<std::unique_ptr<BiosThread>> GetThreadList() const = 0;
|
||||
virtual std::vector<MipsStackWalk::StackFrame> StackTrace(const BiosThread& thread) = 0;
|
||||
virtual std::vector<IopMod> GetModuleList() const = 0;
|
||||
|
||||
bool isAlive();
|
||||
@@ -135,6 +137,7 @@ public:
|
||||
SymbolGuardian& GetSymbolGuardian() const override;
|
||||
SymbolImporter* GetSymbolImporter() const override;
|
||||
std::vector<std::unique_ptr<BiosThread>> GetThreadList() const override;
|
||||
std::vector<MipsStackWalk::StackFrame> StackTrace(const BiosThread& thread) override;
|
||||
std::vector<IopMod> GetModuleList() const override;
|
||||
|
||||
std::string disasm(u32 address, bool simplify) override;
|
||||
@@ -180,6 +183,7 @@ public:
|
||||
SymbolGuardian& GetSymbolGuardian() const override;
|
||||
SymbolImporter* GetSymbolImporter() const override;
|
||||
std::vector<std::unique_ptr<BiosThread>> GetThreadList() const override;
|
||||
std::vector<MipsStackWalk::StackFrame> StackTrace(const BiosThread& thread) override;
|
||||
std::vector<IopMod> GetModuleList() const override;
|
||||
|
||||
std::string disasm(u32 address, bool simplify) override;
|
||||
|
||||
Reference in New Issue
Block a user