interpret & visualize __fastfail events correctly

This commit is contained in:
Ryan Fleury
2024-01-14 21:36:39 -08:00
parent f736533933
commit d2ec1d6a3a
2 changed files with 12 additions and 3 deletions
+10 -2
View File
@@ -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;
+2 -1
View File
@@ -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:
{