diff --git a/cpu/ppc/ppcexec.cpp b/cpu/ppc/ppcexec.cpp index 9cc3ee8..1e0083b 100644 --- a/cpu/ppc/ppcexec.cpp +++ b/cpu/ppc/ppcexec.cpp @@ -610,7 +610,7 @@ void ppc_exec_single() } /** Execute PPC code until goal_addr is reached. */ -void ppc_exec_until(uint32_t goal_addr) +void ppc_exec_until(volatile uint32_t goal_addr) { uint32_t bb_start_la, page_start, delta; uint8_t* pc_real; @@ -670,7 +670,7 @@ again: } /** Execute PPC code until control is reached the specified region. */ -void ppc_exec_dbg(uint32_t start_addr, uint32_t size) +void ppc_exec_dbg(volatile uint32_t start_addr, volatile uint32_t size) { uint32_t bb_start_la, page_start, delta; uint8_t* pc_real; @@ -692,6 +692,7 @@ void ppc_exec_dbg(uint32_t start_addr, uint32_t size) page_start = bb_start_la & 0xFFFFF000; ppc_state.pc = bb_start_la; bb_kind = BB_end_kind::BB_NONE; + //printf("DBG Exec: got exception, continue at %X\n", ppc_state.pc); goto again; } @@ -721,6 +722,7 @@ again: } ppc_state.pc = bb_start_la; bb_kind = BB_end_kind::BB_NONE; + //printf("DBG Exec: new basic block at %X, start_addr=%X\n", ppc_state.pc, start_addr); } else { ppc_state.pc += 4; pc_real += 4; diff --git a/debugger/debugger.cpp b/debugger/debugger.cpp index 8f68bf8..bf1b4c9 100644 --- a/debugger/debugger.cpp +++ b/debugger/debugger.cpp @@ -171,7 +171,7 @@ void exec_single_68k() /* Getting here means we're outside the emualtor opcode table. Execute PPC code until we hit the opcode table again. */ LOG_F(9, "Tracing outside the emulator table, PC = %X\n", ppc_pc); - ppc_exec_dbg(emu_table_virt, EMU_68K_TABLE_SIZE); + ppc_exec_dbg(emu_table_virt, EMU_68K_TABLE_SIZE - 1); } /** Execute emulated 68k code until target_addr is reached. */ @@ -188,12 +188,12 @@ void exec_until_68k(uint32_t target_addr) reg = "PC"; ppc_pc = get_reg(reg); - if (ppc_pc >= emu_table_virt && ppc_pc < (emu_table_virt + EMU_68K_TABLE_SIZE)) { + if (ppc_pc >= emu_table_virt && ppc_pc < (emu_table_virt + EMU_68K_TABLE_SIZE - 1)) { LOG_F(9, "Tracing within emulator table, PC = %X\n", ppc_pc); ppc_exec_single(); } else { LOG_F(9, "Tracing outside the emulator table, PC = %X\n", ppc_pc); - ppc_exec_dbg(emu_table_virt, EMU_68K_TABLE_SIZE); + ppc_exec_dbg(emu_table_virt, EMU_68K_TABLE_SIZE - 1); } reg = "R24"; }