summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Debug/CodeTrace.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2023-03-13 23:36:17 +0100
committerGitHub <noreply@github.com>2023-03-13 23:36:17 +0100
commit5c962ea71f9937042bd85c858012cd4d1a7dc2a6 (patch)
tree1265d85690870eceb62d19fa82f34da0e63bea0e /Source/Core/Common/Debug/CodeTrace.cpp
parent936c05e60041fae1f9be82f5226a04dd41f85234 (diff)
parent3006c23c85b4028cb63143f095f8017342b1cbce (diff)
Merge pull request #11650 from AdmiralCurtiss/more-system
More passing of System instead of using the singleton.
Diffstat (limited to 'Source/Core/Common/Debug/CodeTrace.cpp')
-rw-r--r--Source/Core/Common/Debug/CodeTrace.cpp11
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 &&