diff --git a/main/gbx/gbx_exec.c b/main/gbx/gbx_exec.c index 8e2e75a03..94eea3a71 100644 --- a/main/gbx/gbx_exec.c +++ b/main/gbx/gbx_exec.c @@ -1014,24 +1014,33 @@ void EXEC_function_loop() if (EXEC_debug && !STACK_has_error_handler()) { ERROR_hook(); - DEBUG.Main(TRUE); + for(;;) + DEBUG.Main(TRUE); - if (TP && TC) + /*if (TP && TC) { ERROR_lock(); while (BP > TP) { EXEC_leave_drop(); if (!PC) - STACK_pop_frame(&EXEC_current); + break; } while (SP > TP) - POP(); + + if (!PC) + { + ERROR_unlock(); + STACK_pop_frame(&EXEC_current); + PROPAGATE(); + } + + POP(); PC = TC; ERROR_unlock(); } - retry = TRUE; + retry = TRUE;*/ } else { diff --git a/main/gbx/gbx_exec.h b/main/gbx/gbx_exec.h index 131c7da80..3bcd18ad4 100644 --- a/main/gbx/gbx_exec.h +++ b/main/gbx/gbx_exec.h @@ -139,10 +139,6 @@ extern EXEC_GLOBAL EXEC; #define EC EXEC_current.ec // Save register for TRY #define ET EXEC_current.et -// Last break in the function -#define TC EXEC_current.tc -// Stack at the last break in the function -#define TP EXEC_current.tp // GoSub stack #define GP EXEC_current.gp diff --git a/main/gbx/gbx_exec_loop.c b/main/gbx/gbx_exec_loop.c index b2b9c9d65..86c572bc7 100644 --- a/main/gbx/gbx_exec_loop.c +++ b/main/gbx/gbx_exec_loop.c @@ -3748,8 +3748,8 @@ static void _break(ushort code) { if (EXEC_debug) { - TC = PC + 1; - TP = SP; + /*TC = PC + 1; + TP = SP;*/ //fprintf(stderr, "%s\n", DEBUG_get_current_position()); diff --git a/main/gbx/gbx_stack.h b/main/gbx/gbx_stack.h index 6469611f6..b0ba65d46 100644 --- a/main/gbx/gbx_stack.h +++ b/main/gbx/gbx_stack.h @@ -49,8 +49,6 @@ typedef PCODE *pc; // instruction PCODE *ec; // instruction if error PCODE *et; // TRY save - PCODE *tc; // Last break in the function - VALUE *tp; // Stack at the last break in the function VALUE *gp; // GOSUB stack pointer } STACK_CONTEXT;