mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-07-11 01:34:17 +02:00
DebugInterface: Allow stack tracing any IOP thread
This commit is contained in:
@@ -49,7 +49,8 @@ std::vector<std::unique_ptr<BiosThread>> getIOPThreads()
|
||||
return {};
|
||||
}
|
||||
|
||||
data.stackTop = iopMemRead32(item + 0x3c);
|
||||
data.stackBottom = iopMemRead32(item + 0x3c);
|
||||
data.stackSize = iopMemRead32(item + 0x40);
|
||||
data.status = iopMemRead8(item + 0xc);
|
||||
data.tid = iopMemRead16(item + 0xa);
|
||||
data.entrypoint = iopMemRead32(item + 0x38);
|
||||
@@ -57,9 +58,9 @@ std::vector<std::unique_ptr<BiosThread>> getIOPThreads()
|
||||
data.waitId = iopMemRead32(item + 0x20);
|
||||
data.initPriority = iopMemRead16(item + 0xe);
|
||||
|
||||
data.SavedSP = iopMemRead32(item + 0x10);
|
||||
data.regCtx = iopMemRead32(item + 0x10);
|
||||
|
||||
data.PC = iopMemRead32(data.SavedSP + 0x8c);
|
||||
data.PC = iopMemRead32(data.regCtx + 0x8c);
|
||||
|
||||
threads.emplace_back(std::make_unique<IOPThread>(data));
|
||||
|
||||
|
||||
@@ -59,8 +59,9 @@ struct IOPInternalThread
|
||||
{
|
||||
u32 tid;
|
||||
u32 PC;
|
||||
u32 stackTop;
|
||||
u32 SavedSP;
|
||||
u32 stackBottom;
|
||||
u32 stackSize;
|
||||
u32 regCtx;
|
||||
u32 status;
|
||||
u32 entrypoint;
|
||||
u32 waitstate;
|
||||
@@ -189,9 +190,9 @@ public:
|
||||
};
|
||||
[[nodiscard]] u32 WaitId() const override { return data.waitId; };
|
||||
[[nodiscard]] u32 EntryPoint() const override { return data.entrypoint; };
|
||||
[[nodiscard]] u32 StackTop() const override { return data.stackTop; };
|
||||
[[nodiscard]] u32 StackTop() const override { return data.stackBottom + data.stackSize; };
|
||||
[[nodiscard]] u32 Priority() const override { return data.initPriority; };
|
||||
[[nodiscard]] u32 RegCtx() const override { return 0; };
|
||||
[[nodiscard]] u32 RegCtx() const override { return data.regCtx; };
|
||||
|
||||
private:
|
||||
IOPInternalThread data;
|
||||
|
||||
@@ -1074,7 +1074,12 @@ std::vector<MipsStackWalk::StackFrame> R3000DebugInterface::StackTrace(const Bio
|
||||
thread.EntryPoint(), thread.StackTop());
|
||||
}
|
||||
|
||||
return {};
|
||||
u32 p = thread.RegCtx();
|
||||
u32 pc = Read32(p + 0x8c);
|
||||
u32 ra = Read32(p + 0x7c);
|
||||
u32 sp = Read32(p + 0x74);
|
||||
|
||||
return MipsStackWalk::Walk(this, pc, ra, sp, thread.EntryPoint(), thread.StackTop());
|
||||
}
|
||||
|
||||
std::vector<IopMod> R3000DebugInterface::GetModuleList() const
|
||||
|
||||
Reference in New Issue
Block a user