Routing messages to debug targets.
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <xenia/cpu/processor.h>
|
||||
|
||||
#include <jansson.h>
|
||||
|
||||
#include <xenia/emulator.h>
|
||||
#include <xenia/cpu/xenon_memory.h>
|
||||
#include <xenia/cpu/xenon_runtime.h>
|
||||
@@ -51,11 +53,16 @@ Processor::Processor(Emulator* emulator) :
|
||||
emulator_(emulator), export_resolver_(emulator->export_resolver()),
|
||||
runtime_(0), memory_(emulator->memory()),
|
||||
interrupt_thread_lock_(NULL), interrupt_thread_state_(NULL),
|
||||
interrupt_thread_block_(0) {
|
||||
interrupt_thread_block_(0),
|
||||
DebugTarget(emulator->debug_server()) {
|
||||
InitializeIfNeeded();
|
||||
|
||||
emulator_->debug_server()->AddTarget("cpu", this);
|
||||
}
|
||||
|
||||
Processor::~Processor() {
|
||||
emulator_->debug_server()->RemoveTarget("cpu");
|
||||
|
||||
if (interrupt_thread_block_) {
|
||||
memory_->HeapFree(interrupt_thread_block_, 2048);
|
||||
delete interrupt_thread_state_;
|
||||
@@ -158,3 +165,9 @@ uint64_t Processor::ExecuteInterrupt(
|
||||
xe_mutex_unlock(interrupt_thread_lock_);
|
||||
return result;
|
||||
}
|
||||
|
||||
json_t* Processor::OnDebugRequest(
|
||||
const char* command, json_t* request, bool& succeeded) {
|
||||
succeeded = true;
|
||||
return json_null();
|
||||
}
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
#ifndef XENIA_CPU_PROCESSOR_H_
|
||||
#define XENIA_CPU_PROCESSOR_H_
|
||||
|
||||
#include <xenia/core.h>
|
||||
#include <alloy/runtime/register_access.h>
|
||||
#include <xenia/core.h>
|
||||
#include <xenia/debug/debug_target.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -31,7 +32,7 @@ using RegisterReadCallback = alloy::runtime::RegisterReadCallback;
|
||||
using RegisterWriteCallback = alloy::runtime::RegisterWriteCallback;
|
||||
|
||||
|
||||
class Processor {
|
||||
class Processor : public debug::DebugTarget {
|
||||
public:
|
||||
Processor(Emulator* emulator);
|
||||
~Processor();
|
||||
@@ -55,6 +56,9 @@ public:
|
||||
uint64_t ExecuteInterrupt(
|
||||
uint32_t cpu, uint64_t address, uint64_t arg0, uint64_t arg1);
|
||||
|
||||
virtual json_t* OnDebugRequest(
|
||||
const char* command, json_t* request, bool& succeeded);
|
||||
|
||||
private:
|
||||
Emulator* emulator_;
|
||||
ExportResolver* export_resolver_;
|
||||
|
||||
Reference in New Issue
Block a user