Set up the compiler to ptrace the runtime (#107)

* set up the compiler to ptrace the runtime

* clang format

* move debugger state to a separate Debugger class

* support registers and break and continue

* documentation and fix windows

* make listener part of compiler, not a separate library

* implement memory read and write

* fix for windows
This commit is contained in:
water111
2020-10-31 14:07:43 -04:00
committed by GitHub
parent a45d180f2c
commit 0451a06d76
34 changed files with 1215 additions and 110 deletions
+3 -8
View File
@@ -45,6 +45,8 @@
#include "game/overlord/overlord.h"
#include "game/overlord/srpc.h"
#include "common/goal_constants.h"
u8* g_ee_main_mem = nullptr;
namespace {
@@ -95,13 +97,6 @@ void deci2_runner(SystemThreadInterface& iface) {
}
// EE System
constexpr int EE_MAIN_MEM_SIZE = 128 * (1 << 20); // 128 MB, same as PS2 TOOL
constexpr u64 EE_MAIN_MEM_MAP = 0x2000000000; // intentionally > 32-bit to catch pointer bugs
// when true, attempt to map the EE memory in the low 2 GB of RAM
// this allows us to use EE pointers as real pointers. However, this might not always work,
// so this should be used only for debugging.
constexpr bool EE_MEM_LOW_MAP = false;
/*!
* SystemThread Function for the EE (PS2 Main CPU)
@@ -137,7 +132,7 @@ void ee_runner(SystemThreadInterface& iface) {
// prevent access to the first 1 MB of memory.
// On the PS2 this is the kernel and can't be accessed either.
// this may not work well on systems with a page size > 1 MB.
mprotect((void*)g_ee_main_mem, 1024 * 1024, PROT_NONE);
mprotect((void*)g_ee_main_mem, EE_MAIN_MEM_LOW_PROTECT, PROT_NONE);
fileio_init_globals();
kboot_init_globals();
kdgo_init_globals();