[gamecode] Add an exit debug event type

The VM never sends it because it cannot know if its exit is program exit
or just sub-program exit, but it's available for host systems to send.
This commit is contained in:
Bill Currie 2020-03-25 18:28:28 +09:00
parent 7b9177ec56
commit 6f7ddf52ac
2 changed files with 4 additions and 0 deletions

View file

@ -1695,6 +1695,7 @@ typedef enum {
prd_trace, prd_trace,
prd_breakpoint, prd_breakpoint,
prd_watchpoint, prd_watchpoint,
prd_exit, // not sent by VM
prd_runerror, prd_runerror,
prd_error, // lower level error thann prd_runerror prd_error, // lower level error thann prd_runerror
} prdebug_t; } prdebug_t;

View file

@ -232,6 +232,9 @@ run_progs (void *data)
PR_ExecuteProgram (thread->pr, thread->main_func); PR_ExecuteProgram (thread->pr, thread->main_func);
PR_PopFrame (thread->pr); PR_PopFrame (thread->pr);
if (thread->pr->debug_handler) {
thread->pr->debug_handler (prd_exit, thread->pr->debug_data);
}
thread->return_code = R_INT (thread->pr); thread->return_code = R_INT (thread->pr);
return thread; return thread;
} }