summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-11-03 22:39:00 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2020-11-03 22:42:52 +0100
commit2dde7bcb26e9015b3331384b7bee82b1066229d4 (patch)
tree3bb73f14ec8fe97fa28e2e17858ede89e589eef7 /libpcsxcore
parent5d8182c246538e84b4b1bda5ba1c4e388fa9cccd (diff)
downloadpcsxr-2dde7bcb26e9015b3331384b7bee82b1066229d4.tar.gz
Notify gdb stub whenever a break instruction is executed
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/psxinterpreter.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c
index ae100cb9..0ea4b1bf 100644
--- a/libpcsxcore/psxinterpreter.c
+++ b/libpcsxcore/psxinterpreter.c
@@ -655,8 +655,10 @@ void psxMTLO() { _rLo_ = _rRs_; } // Lo = Rs
* Special purpose instructions *
* Format: OP *
*********************************************************/
+static void process_gdb(int);
void psxBREAK() {
// Break exception - psx rom doens't handles this
+ if (Config.GdbServer) process_gdb(1);
}
void psxSYSCALL() {
@@ -1204,7 +1206,7 @@ static void intClear(u32 Addr, u32 Size) {
static void intShutdown() {
}
-static void process_gdb(void) {
+static void process_gdb(int found_break) {
static int shutdown;
static u32 tgt_addr;
static int step, must_continue;
@@ -1215,7 +1217,14 @@ start:
if (shutdown)
return;
- if (halt || step || (must_continue && tgt_addr && tgt_addr == psxRegs.pc)) {
+ if (found_break) {
+ msg.type = MSG_TYPE_BREAK;
+ gdbstub_sys_send(&msg);
+ must_continue = 0;
+ step = 0;
+ halt = 0;
+ }
+ else if (halt || step || (must_continue && tgt_addr && tgt_addr == psxRegs.pc)) {
msg.type = MSG_TYPE_HIT;
#if DEBUG == 1
printf("hit address 0x%08X\n", psxRegs.pc);
@@ -1276,7 +1285,7 @@ static inline void execI() {
debugI();
- if (Config.GdbServer) process_gdb();
+ if (Config.GdbServer) process_gdb(0);
else if (Config.Debug) ProcessDebug();
psxRegs.pc += 4;