SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 4180348567ffbc1f17bcf29203cefddabe7f8669 parent eef8b8448cb483a220d14bf055361a3eeffc6ef5 Author: Lior Halphon <LIJI32@gmail.com> Date: Mon, 17 Oct 2022 14:27:11 +0300 Fix issues where finish and next did not behave as expected Diffstat:
| M | Core/debugger.c | 9 | ++++----- |
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/Core/debugger.c b/Core/debugger.c @@ -2110,6 +2110,7 @@ void GB_debugger_call_hook(GB_gameboy_t *gb, uint16_t call_addr) while (gb->backtrace_size) { if (gb->backtrace_sps[gb->backtrace_size - 1] < gb->sp) { gb->backtrace_size--; + gb->debug_call_depth--; } else { break; @@ -2120,20 +2121,18 @@ void GB_debugger_call_hook(GB_gameboy_t *gb, uint16_t call_addr) gb->backtrace_returns[gb->backtrace_size].bank = bank_for_addr(gb, call_addr); gb->backtrace_returns[gb->backtrace_size].addr = call_addr; gb->backtrace_size++; + gb->debug_call_depth++; } - - gb->debug_call_depth++; } void GB_debugger_ret_hook(GB_gameboy_t *gb) { /* Called just before the CPU runs ret/reti */ - gb->debug_call_depth--; - while (gb->backtrace_size) { if (gb->backtrace_sps[gb->backtrace_size - 1] <= gb->sp) { gb->backtrace_size--; + gb->debug_call_depth--; } else { break; @@ -2373,7 +2372,7 @@ void GB_debugger_run(GB_gameboy_t *gb) if (gb->debug_next_command && gb->debug_call_depth <= 0 && !gb->halted) { gb->debug_stopped = true; } - if (gb->debug_fin_command && gb->debug_call_depth == -1) { + if (gb->debug_fin_command && gb->debug_call_depth <= -1) { gb->debug_stopped = true; } if (gb->debug_stopped) {
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.