summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Debug
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-03-12 18:48:23 +0100
committerAdmiral H. Curtiss <pikachu025@gmail.com>2023-03-13 18:13:20 +0100
commit3006c23c85b4028cb63143f095f8017342b1cbce (patch)
treeb728c7518467dbd322654caa508a7402050c7d8f /Source/Core/Common/Debug
parent31d33d0efde8a517c4754dc6a3efb14f12cd85a0 (diff)
Core/CPUThreadGuard: Fetch System from Guard.
Diffstat (limited to 'Source/Core/Common/Debug')
-rw-r--r--Source/Core/Common/Debug/CodeTrace.cpp11
-rw-r--r--Source/Core/Common/Debug/CodeTrace.h2
2 files changed, 7 insertions, 6 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 &&
diff --git a/Source/Core/Common/Debug/CodeTrace.h b/Source/Core/Common/Debug/CodeTrace.h
index c47ae8e961..ae99b6d9a2 100644
--- a/Source/Core/Common/Debug/CodeTrace.h
+++ b/Source/Core/Common/Debug/CodeTrace.h
@@ -73,7 +73,7 @@ public:
private:
InstructionAttributes GetInstructionAttributes(const TraceOutput& line) const;
- TraceOutput SaveCurrentInstruction(const Core::CPUThreadGuard* guard) const;
+ TraceOutput SaveCurrentInstruction(const Core::CPUThreadGuard& guard) const;
HitType TraceLogic(const TraceOutput& current_instr, bool first_hit = false);
bool m_recording = false;