cpu::Processor now tracks a pointer to the emulator.
This commit is contained in:
parent
7d59258839
commit
28468f8a18
|
@ -189,7 +189,7 @@ class TestRunner {
|
|||
memory->Reset();
|
||||
|
||||
// Setup a fresh processor.
|
||||
processor.reset(new Processor(memory.get(), nullptr, nullptr));
|
||||
processor.reset(new Processor(nullptr, memory.get(), nullptr, nullptr));
|
||||
processor->Setup();
|
||||
processor->set_debug_info_flags(DebugInfoFlags::kDebugInfoAll);
|
||||
|
||||
|
|
|
@ -55,9 +55,12 @@ class BuiltinModule : public Module {
|
|||
std::string name_;
|
||||
};
|
||||
|
||||
Processor::Processor(xe::Memory* memory, ExportResolver* export_resolver,
|
||||
debug::Debugger* debugger)
|
||||
: memory_(memory), debugger_(debugger), export_resolver_(export_resolver) {}
|
||||
Processor::Processor(xe::Emulator* emulator, xe::Memory* memory,
|
||||
ExportResolver* export_resolver, debug::Debugger* debugger)
|
||||
: emulator_(emulator),
|
||||
memory_(memory),
|
||||
debugger_(debugger),
|
||||
export_resolver_(export_resolver) {}
|
||||
|
||||
Processor::~Processor() {
|
||||
{
|
||||
|
|
|
@ -49,10 +49,11 @@ enum class Irql : uint32_t {
|
|||
|
||||
class Processor {
|
||||
public:
|
||||
Processor(Memory* memory, ExportResolver* export_resolver,
|
||||
Processor(Emulator* emulator, Memory* memory, ExportResolver* export_resolver,
|
||||
debug::Debugger* debugger);
|
||||
~Processor();
|
||||
|
||||
Emulator* emulator() const { return emulator_; }
|
||||
Memory* memory() const { return memory_; }
|
||||
debug::Debugger* debugger() const { return debugger_; }
|
||||
StackWalker* stack_walker() const { return stack_walker_.get(); }
|
||||
|
@ -105,6 +106,7 @@ class Processor {
|
|||
|
||||
bool DemandFunction(Function* function);
|
||||
|
||||
Emulator* emulator_ = nullptr;
|
||||
Memory* memory_ = nullptr;
|
||||
debug::Debugger* debugger_ = nullptr;
|
||||
std::unique_ptr<StackWalker> stack_walker_;
|
||||
|
|
|
@ -40,7 +40,7 @@ class TestFunction {
|
|||
#if XENIA_TEST_X64
|
||||
{
|
||||
auto processor =
|
||||
std::make_unique<Processor>(memory.get(), nullptr, nullptr);
|
||||
std::make_unique<Processor>(nullptr, memory.get(), nullptr, nullptr);
|
||||
processor->Setup();
|
||||
processors.emplace_back(std::move(processor));
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ X_STATUS Emulator::Setup(
|
|||
|
||||
// Initialize the CPU.
|
||||
processor_ = std::make_unique<xe::cpu::Processor>(
|
||||
memory_.get(), export_resolver_.get(), debugger_.get());
|
||||
this, memory_.get(), export_resolver_.get(), debugger_.get());
|
||||
if (!processor_->Setup()) {
|
||||
return X_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue