Mercurial > repos > blastem
comparison genesis.c @ 2424:767ec72acca7
Avoid conflicts between watchpoints and normal debugger entry
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 24 Jan 2024 18:51:44 -0800 |
parents | 664c3e749428 |
children | 65c2e4d990cc |
comparison
equal
deleted
inserted
replaced
2423:b733a10488c6 | 2424:767ec72acca7 |
---|---|
368 context->target_cycle = context->current_cycle; | 368 context->target_cycle = context->current_cycle; |
369 return; | 369 return; |
370 } | 370 } |
371 | 371 |
372 context->target_cycle = context->int_cycle < context->sync_cycle ? context->int_cycle : context->sync_cycle; | 372 context->target_cycle = context->int_cycle < context->sync_cycle ? context->int_cycle : context->sync_cycle; |
373 if (context->should_return || gen->header.enter_debugger) { | 373 if (context->should_return || gen->header.enter_debugger || context->wp_hit) { |
374 context->target_cycle = context->current_cycle; | 374 context->target_cycle = context->current_cycle; |
375 } else if (context->target_cycle < context->current_cycle) { | 375 } else if (context->target_cycle < context->current_cycle) { |
376 //Changes to SR can result in an interrupt cycle that's in the past | 376 //Changes to SR can result in an interrupt cycle that's in the past |
377 //This can cause issues with the implementation of STOP though | 377 //This can cause issues with the implementation of STOP though |
378 context->target_cycle = context->current_cycle; | 378 context->target_cycle = context->current_cycle; |
609 adjust_int_cycle(context, v_context); | 609 adjust_int_cycle(context, v_context); |
610 if (gen->reset_cycle < context->target_cycle) { | 610 if (gen->reset_cycle < context->target_cycle) { |
611 context->target_cycle = gen->reset_cycle; | 611 context->target_cycle = gen->reset_cycle; |
612 } | 612 } |
613 if (address) { | 613 if (address) { |
614 if (gen->header.enter_debugger) { | 614 if (gen->header.enter_debugger || context->wp_hit) { |
615 gen->header.enter_debugger = 0; | 615 if (!context->wp_hit) { |
616 gen->header.enter_debugger = 0; | |
617 } | |
616 #ifndef IS_LIB | 618 #ifndef IS_LIB |
617 if (gen->header.debugger_type == DEBUGGER_NATIVE) { | 619 if (gen->header.debugger_type == DEBUGGER_NATIVE) { |
618 debugger(context, address); | 620 debugger(context, address); |
619 } else { | 621 } else { |
620 gdb_debug_enter(context, address); | 622 gdb_debug_enter(context, address); |