mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-01 11:48:10 +00:00
correctly pipe through exception info, visualize exceptions better
This commit is contained in:
+15
-16
@@ -11758,13 +11758,14 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
|
||||
if(thread != &ctrl_entity_nil)
|
||||
{
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, rd_icon_kind_text_table[RD_IconKind_WarningBig], .font = rd_font_from_slot(RD_FontSlot_Icons), .raster_flags = rd_raster_flags_from_slot(RD_FontSlot_Icons));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
switch(event->exception_kind)
|
||||
{
|
||||
default:
|
||||
{
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_concat_in_place(&fstrs, &thread_fstrs);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit an exception - "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit an exception: "));
|
||||
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
|
||||
String8 exception_explanation_string = rd_string_from_exception_code(event->exception_code);
|
||||
String8 exception_info_string = push_str8f(arena, "%S%s%S%s",
|
||||
@@ -11776,37 +11777,35 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
|
||||
}break;
|
||||
case CTRL_ExceptionKind_CppThrow:
|
||||
{
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_concat_in_place(&fstrs, &thread_fstrs);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit a C++ exception - "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit a C++ exception: "));
|
||||
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, exception_code_string);
|
||||
}break;
|
||||
case CTRL_ExceptionKind_MemoryRead:
|
||||
{
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_concat_in_place(&fstrs, &thread_fstrs);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit an exception - "));
|
||||
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
|
||||
String8 exception_info_string = push_str8f(arena, "%S (Access violation reading 0x%I64x)", exception_code_string, event->vaddr_rng.min);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit an exception: "));
|
||||
String8 exception_info_string = push_str8f(arena, "Access violation reading from address 0x%I64x", event->vaddr_rng.min);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, exception_info_string);
|
||||
}break;
|
||||
case CTRL_ExceptionKind_MemoryWrite:
|
||||
{
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_concat_in_place(&fstrs, &thread_fstrs);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit an exception - "));
|
||||
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
|
||||
String8 exception_info_string = push_str8f(arena, "%S (Access violation writing 0x%I64x)", exception_code_string, event->vaddr_rng.min);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit an exception: "));
|
||||
String8 exception_info_string = push_str8f(arena, "Access violation writing to address 0x%I64x", event->vaddr_rng.min);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, exception_info_string);
|
||||
}break;
|
||||
case CTRL_ExceptionKind_MemoryExecute:
|
||||
{
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_concat_in_place(&fstrs, &thread_fstrs);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit an exception - "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit(" hit an exception: "));
|
||||
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
|
||||
String8 exception_info_string = push_str8f(arena, "%S (Access violation executing 0x%I64x)", exception_code_string, event->vaddr_rng.min);
|
||||
String8 exception_info_string = push_str8f(arena, "Access violation executing at address 0x%I64x", event->vaddr_rng.min);
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, exception_info_string);
|
||||
}break;
|
||||
}
|
||||
@@ -11814,7 +11813,7 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
|
||||
else
|
||||
{
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, rd_icon_kind_text_table[RD_IconKind_WarningBig], .font = rd_font_from_slot(RD_FontSlot_Icons), .raster_flags = rd_raster_flags_from_slot(RD_FontSlot_Icons));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit("Hit an exception - "));
|
||||
dr_fstrs_push_new(arena, &fstrs, ¶ms, str8_lit("Hit an exception: "));
|
||||
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
|
||||
String8 exception_explanation_string = rd_string_from_exception_code(event->exception_code);
|
||||
String8 exception_info_string = push_str8f(arena, "%S%s%S%s",
|
||||
|
||||
@@ -1765,8 +1765,8 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
|
||||
line_num += 1, line_idx += 1)
|
||||
{
|
||||
String8 line_text = params->line_text[line_idx];
|
||||
F32 line_text_dim = fnt_dim_from_tag_size_string(params->font, params->font_size, 0, params->tab_size, line_text).x + params->line_num_width_px;
|
||||
line_extras_off[line_idx] = Max(line_text_dim, params->font_size*50);
|
||||
F32 line_text_dim = fnt_dim_from_tag_size_string(params->font, params->font_size, 0, params->tab_size, line_text).x + params->line_num_width_px + params->catchall_margin_width_px + params->priority_margin_width_px;
|
||||
line_extras_off[line_idx] = Max(line_text_dim, params->font_size*30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1806,7 +1806,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
|
||||
stop_event.cause == CTRL_EventCause_InterruptedByTrap))
|
||||
{
|
||||
DR_FStrList explanation_fstrs = rd_stop_explanation_fstrs_from_ctrl_event(scratch.arena, &stop_event);
|
||||
UI_Parent(line_extras_boxes[line_idx]) UI_PrefWidth(ui_children_sum(1)) UI_PrefHeight(ui_px(params->line_height_px, 1.f))
|
||||
UI_Parent(line_extras_boxes[line_idx]) UI_PrefWidth(ui_text_dim(10, 1)) UI_TextAlignment(UI_TextAlign_Center) UI_PrefHeight(ui_px(params->line_height_px, 1.f))
|
||||
UI_TagF("bad_pop")
|
||||
{
|
||||
UI_Box *box = ui_build_box_from_stringf(UI_BoxFlag_DrawText, "###exception_info");
|
||||
|
||||
Reference in New Issue
Block a user