# HG changeset patch # User Michael Pavone # Date 1499403095 25200 # Node ID 4f96103b4b4762eeb4418ac517e1cf351b9cdb5d # Parent 9a3e003bdcb36086c080448c101814285ee9df13 Fix s(tep) debug command for the case of dbra with an expired counter reg diff -r 9a3e003bdcb3 -r 4f96103b4b47 debug.c --- a/debug.c Fri Jun 30 18:42:52 2017 -0700 +++ b/debug.c Thu Jul 06 21:51:35 2017 -0700 @@ -796,10 +796,16 @@ branch_f = after; branch_t = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; insert_breakpoint(context, branch_t, debugger); - } else if(inst.op == M68K_DBCC && inst.extra.cond != COND_FALSE) { - branch_t = after; - branch_f = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; - insert_breakpoint(context, branch_f, debugger); + } else if(inst.op == M68K_DBCC) { + if (inst.extra.cond == COND_FALSE) { + if (context->dregs[inst.dst.params.regs.pri] & 0xFFFF) { + after = m68k_branch_target(&inst, context->dregs, context->aregs); + } + } else { + branch_t = after; + branch_f = m68k_branch_target(&inst, context->dregs, context->aregs); + insert_breakpoint(context, branch_f, debugger); + } } else { after = m68k_branch_target(&inst, context->dregs, context->aregs) & 0xFFFFFF; }