mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
implement better exception support
This commit is contained in:
parent
e1d0a9f94d
commit
5d8fd75db6
@ -114,6 +114,8 @@ void c11_debugger_exception_on_trace(py_Ref exc) {
|
||||
debugger.current_excname = name;
|
||||
debugger.current_excmessage = message;
|
||||
clear_structures();
|
||||
py_assign(py_list_getitem(python_vars, 0), exc);
|
||||
py_clearexc(NULL);
|
||||
}
|
||||
|
||||
const char* c11_debugger_excinfo(const char** message) {
|
||||
@ -178,6 +180,8 @@ bool c11_debugger_path_equal(const char* path1, const char* path2) {
|
||||
C11_STOP_REASON c11_debugger_should_pause() {
|
||||
if(debugger.current_event == TRACE_EVENT_POP && !debugger.isexceptionmode)
|
||||
return C11_DEBUGGER_NOSTOP;
|
||||
if(py_checkexc() && debugger.isexceptionmode == false)
|
||||
return C11_DEBUGGER_NOSTOP;
|
||||
C11_STOP_REASON pause_resaon = C11_DEBUGGER_NOSTOP;
|
||||
int is_out = debugger.curr_stack_depth <= debugger.pause_allowed_depth;
|
||||
int is_new_line = debugger.current_line != debugger.step_line;
|
||||
|
Loading…
x
Reference in New Issue
Block a user