#endif
static uaecptr nextpc;
-int instruction_breakpoint (TCHAR **c)
+int instruction_breakpoint(TCHAR **c)
{
struct breakpoint_node *bpn;
+ int bpcnt = 0;
int i;
+ if (more_params(c)) {
+ TCHAR nc = _totupper((*c)[0]);
+ if (nc == 'N') {
+ next_char(c);
+ bpcnt = readint(c);
+ }
+ }
if (more_params (c)) {
TCHAR nc = _totupper ((*c)[0]);
if (nc == 'O') {
int bpidx = readint(c);
if (more_params(c) && bpidx >= 0 && bpidx < BREAKPOINT_TOTAL) {
bpn = &bpnodes[bpidx];
+ bpn->cnt = bpcnt;
int regid = getregidx(c);
if (regid >= 0) {
bpn->type = regid;
bpn->value1 = trace_param[0];
bpn->type = BREAKPOINT_REG_PC;
bpn->oper = BREAKPOINT_CMP_EQUAL;
+ bpn->cnt = bpcnt;
bpn->enabled = 1;
console_out (_T("Breakpoint added.\n"));
trace_mode = 0;
debug_continue();
return;
}
- if (bp > 0)
+ if (bp > 0) {
+ if (bpnodes[bp - 1].cnt > 0) {
+ bpnodes[bp - 1].cnt--;
+ }
+ if (bpnodes[bp - 1].cnt > 0) {
+ debug_continue();
+ return;
+ }
console_out_f(_T("Breakpoint %d triggered.\n"), bp - 1);
+ }
debug_cycles(1);
}
} else {