diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-03-12 18:48:23 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-03-13 18:13:20 +0100 |
| commit | 3006c23c85b4028cb63143f095f8017342b1cbce (patch) | |
| tree | b728c7518467dbd322654caa508a7402050c7d8f /Source/Core/Common/Debug/CodeTrace.cpp | |
| parent | 31d33d0efde8a517c4754dc6a3efb14f12cd85a0 (diff) | |
Core/CPUThreadGuard: Fetch System from Guard.
Diffstat (limited to 'Source/Core/Common/Debug/CodeTrace.cpp')
| -rw-r--r-- | Source/Core/Common/Debug/CodeTrace.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/Core/Common/Debug/CodeTrace.cpp b/Source/Core/Common/Debug/CodeTrace.cpp index 3023923fbb..49ad967382 100644 --- a/Source/Core/Common/Debug/CodeTrace.cpp +++ b/Source/Core/Common/Debug/CodeTrace.cpp @@ -8,6 +8,7 @@ #include <regex> #include "Common/Event.h" +#include "Core/Core.h" #include "Core/Debugger/PPCDebugInterface.h" #include "Core/HW/CPU.h" #include "Core/PowerPC/PowerPC.h" @@ -122,14 +123,14 @@ InstructionAttributes CodeTrace::GetInstructionAttributes(const TraceOutput& ins return tmp_attributes; } -TraceOutput CodeTrace::SaveCurrentInstruction(const Core::CPUThreadGuard* guard) const +TraceOutput CodeTrace::SaveCurrentInstruction(const Core::CPUThreadGuard& guard) const { - auto& system = Core::System::GetInstance(); + auto& system = guard.GetSystem(); auto& ppc_state = system.GetPPCState(); // Quickly save instruction and memory target for fast logging. TraceOutput output; - const std::string instr = PowerPC::debug_interface.Disassemble(guard, ppc_state.pc); + const std::string instr = PowerPC::debug_interface.Disassemble(&guard, ppc_state.pc); output.instruction = instr; output.address = ppc_state.pc; @@ -147,7 +148,7 @@ AutoStepResults CodeTrace::AutoStepping(const Core::CPUThreadGuard& guard, bool if (m_recording) return results; - TraceOutput pc_instr = SaveCurrentInstruction(&guard); + TraceOutput pc_instr = SaveCurrentInstruction(guard); const InstructionAttributes instr = GetInstructionAttributes(pc_instr); // Not an instruction we should start autostepping from (ie branches). @@ -199,7 +200,7 @@ AutoStepResults CodeTrace::AutoStepping(const Core::CPUThreadGuard& guard, bool { PowerPC::SingleStep(); - pc_instr = SaveCurrentInstruction(&guard); + pc_instr = SaveCurrentInstruction(guard); hit = TraceLogic(pc_instr); results.count += 1; } while (clock::now() < timeout && hit < stop_condition && |
