Processor breakpoint support

This commit is contained in:
Dr. Chat
2015-11-25 21:35:05 -06:00
committed by Ben Vanik
parent 5019f1aa98
commit e383e2f101
7 changed files with 269 additions and 0 deletions

View File

@@ -25,6 +25,8 @@
#include "xenia/memory.h"
namespace xe {
class Emulator;
namespace debug {
class Debugger;
} // namespace debug
@@ -33,6 +35,7 @@ class Debugger;
namespace xe {
namespace cpu {
class Breakpoint;
class StackWalker;
class ThreadState;
class XexModule;
@@ -89,7 +92,16 @@ class Processor {
Irql RaiseIrql(Irql new_value);
void LowerIrql(Irql old_value);
bool InstallBreakpoint(Breakpoint* bp);
bool UninstallBreakpoint(Breakpoint* bp);
bool BreakpointHit(uint32_t address, uint64_t host_pc);
Breakpoint* FindBreakpoint(uint32_t address);
std::vector<Breakpoint*> breakpoints() const { return breakpoints_; }
private:
static bool ExceptionCallbackThunk(Exception* ex, void* data);
bool ExceptionCallback(Exception* ex);
bool DemandFunction(Function* function);
Memory* memory_ = nullptr;
@@ -108,6 +120,9 @@ class Processor {
Module* builtin_module_ = nullptr;
uint32_t next_builtin_address_ = 0xFFFF0000u;
std::mutex breakpoint_lock_;
std::vector<Breakpoint*> breakpoints_;
Irql irql_;
};