mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
CodeTrace: Avoid ppcState global.
This commit is contained in:
parent
41ad0490f0
commit
bbdfb4bc14
@ -11,6 +11,7 @@
|
|||||||
#include "Core/Debugger/PPCDebugInterface.h"
|
#include "Core/Debugger/PPCDebugInterface.h"
|
||||||
#include "Core/HW/CPU.h"
|
#include "Core/HW/CPU.h"
|
||||||
#include "Core/PowerPC/PowerPC.h"
|
#include "Core/PowerPC/PowerPC.h"
|
||||||
|
#include "Core/System.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@ -56,11 +57,13 @@ void CodeTrace::SetRegTracked(const std::string& reg)
|
|||||||
|
|
||||||
InstructionAttributes CodeTrace::GetInstructionAttributes(const TraceOutput& instruction) const
|
InstructionAttributes CodeTrace::GetInstructionAttributes(const TraceOutput& instruction) const
|
||||||
{
|
{
|
||||||
|
auto& system = Core::System::GetInstance();
|
||||||
|
|
||||||
// Slower process of breaking down saved instruction. Only used when stepping through code if a
|
// Slower process of breaking down saved instruction. Only used when stepping through code if a
|
||||||
// decision has to be made, otherwise used afterwards on a log file.
|
// decision has to be made, otherwise used afterwards on a log file.
|
||||||
InstructionAttributes tmp_attributes;
|
InstructionAttributes tmp_attributes;
|
||||||
tmp_attributes.instruction = instruction.instruction;
|
tmp_attributes.instruction = instruction.instruction;
|
||||||
tmp_attributes.address = PowerPC::ppcState.pc;
|
tmp_attributes.address = system.GetPPCState().pc;
|
||||||
std::string instr = instruction.instruction;
|
std::string instr = instruction.instruction;
|
||||||
std::smatch match;
|
std::smatch match;
|
||||||
|
|
||||||
@ -106,11 +109,14 @@ InstructionAttributes CodeTrace::GetInstructionAttributes(const TraceOutput& ins
|
|||||||
|
|
||||||
TraceOutput CodeTrace::SaveCurrentInstruction() const
|
TraceOutput CodeTrace::SaveCurrentInstruction() const
|
||||||
{
|
{
|
||||||
|
auto& system = Core::System::GetInstance();
|
||||||
|
auto& ppc_state = system.GetPPCState();
|
||||||
|
|
||||||
// Quickly save instruction and memory target for fast logging.
|
// Quickly save instruction and memory target for fast logging.
|
||||||
TraceOutput output;
|
TraceOutput output;
|
||||||
const std::string instr = PowerPC::debug_interface.Disassemble(PowerPC::ppcState.pc);
|
const std::string instr = PowerPC::debug_interface.Disassemble(ppc_state.pc);
|
||||||
output.instruction = instr;
|
output.instruction = instr;
|
||||||
output.address = PowerPC::ppcState.pc;
|
output.address = ppc_state.pc;
|
||||||
|
|
||||||
if (IsInstructionLoadStore(output.instruction))
|
if (IsInstructionLoadStore(output.instruction))
|
||||||
output.memory_target = PowerPC::debug_interface.GetMemoryAddressFromInstruction(instr);
|
output.memory_target = PowerPC::debug_interface.GetMemoryAddressFromInstruction(instr);
|
||||||
|
Loading…
Reference in New Issue
Block a user