diff --git a/src/demon/win32/demon_os_win32.c b/src/demon/win32/demon_os_win32.c index 60600a4b..d4911e65 100644 --- a/src/demon/win32/demon_os_win32.c +++ b/src/demon/win32/demon_os_win32.c @@ -957,7 +957,9 @@ demon_os_run(Arena *arena, DEMON_OS_RunCtrls *ctrls){ } // rjf: check if trap - B32 is_trap = (!first_bp && exception->ExceptionCode == DEMON_W32_EXCEPTION_BREAKPOINT); + B32 is_trap = (!first_bp && + (exception->ExceptionCode == DEMON_W32_EXCEPTION_BREAKPOINT || + exception->ExceptionCode == DEMON_W32_EXCEPTION_STACK_BUFFER_OVERRUN)); // rjf: check if this trap is currently registered B32 hit_user_trap = 0; @@ -979,7 +981,8 @@ demon_os_run(Arena *arena, DEMON_OS_RunCtrls *ctrls){ // TODO(rjf): x86/x64 specific check // TODO(rjf): do we need to check to make sure the instruction // pointer has not changed? - hit_explicit_trap = (instruction_byte == 0xCC); + hit_explicit_trap = (instruction_byte == 0xCC || + instruction_byte == 0xCD); } } @@ -1038,6 +1041,11 @@ demon_os_run(Arena *arena, DEMON_OS_RunCtrls *ctrls){ e->kind = report_event_kind; }break; + case DEMON_W32_EXCEPTION_STACK_BUFFER_OVERRUN: + { + e->kind = DEMON_EventKind_Trap; + }break; + case DEMON_W32_EXCEPTION_SINGLE_STEP: { e->kind = DEMON_EventKind_SingleStep; diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index e701cfb7..b4945c2a 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -4990,7 +4990,8 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D }break; case CTRL_EventCause_InterruptedByTrap: { - + icon = DF_IconKind_WarningBig; + explanation = push_str8f(scratch.arena, "%S interrupted by trap - 0x%x", thread_display_string, stop_event.exception_code); }break; case CTRL_EventCause_InterruptedByHalt: {