mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 07:32:23 -07:00
process memory read failuer visualization in eval watch view tables
This commit is contained in:
@@ -958,6 +958,22 @@ ctrl_query_cached_data_from_process_vaddr_range(Arena *arena, CTRL_MachineID mac
|
||||
// rjf: write this chunk
|
||||
MemoryCopy((U8*)read_out+write_off, in_range_data.str, in_range_data.size);
|
||||
|
||||
// rjf; if this page's data doesn't fill the entire range, mark
|
||||
// missing bytes as bad
|
||||
if(data.size < page_size)
|
||||
{
|
||||
for(U64 invalid_vaddr = data_vaddr_range.min+data.size;
|
||||
invalid_vaddr < data_vaddr_range.min + page_size;
|
||||
invalid_vaddr += 1)
|
||||
{
|
||||
if(contains_1u64(range, invalid_vaddr))
|
||||
{
|
||||
U64 idx_in_range = invalid_vaddr-range.min;
|
||||
byte_bad_flags[idx_in_range/64] |= (1ull<<(idx_in_range%64));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: if this page's hash & last_hash don't match, diff each byte &
|
||||
// fill out changed flags
|
||||
if(!u128_match(page_hashes[page_idx], page_last_hashes[page_idx]))
|
||||
|
||||
+1
-1
@@ -10519,7 +10519,7 @@ df_error_label(String8 string)
|
||||
ui_set_next_font(ui_icon_font());
|
||||
ui_set_next_text_alignment(UI_TextAlign_Center);
|
||||
UI_PrefWidth(ui_em(2.25f, 1.f)) ui_label(df_g_icon_kind_text_table[DF_IconKind_WarningBig]);
|
||||
ui_label(string);
|
||||
UI_PrefWidth(ui_text_dim(10, 0)) ui_label(string);
|
||||
}
|
||||
return sig;
|
||||
}
|
||||
|
||||
+22
-7
@@ -1110,8 +1110,9 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
B32 row_selected = ((semantic_idx+1) == cursor.y);
|
||||
B32 row_expanded = df_expand_key_is_set(&eval_view->expand_tree_table, row->key);
|
||||
|
||||
//- rjf: determine if row's data is fresh
|
||||
//- rjf: determine if row's data is fresh and/or bad
|
||||
B32 row_is_fresh = 0;
|
||||
B32 row_is_bad = 0;
|
||||
switch(row->eval.mode)
|
||||
{
|
||||
default:{}break;
|
||||
@@ -1126,7 +1127,10 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
if(slice.byte_changed_flags[idx] != 0)
|
||||
{
|
||||
row_is_fresh = 1;
|
||||
break;
|
||||
}
|
||||
if(slice.byte_bad_flags[idx] != 0)
|
||||
{
|
||||
row_is_bad = 1;
|
||||
}
|
||||
}
|
||||
}break;
|
||||
@@ -1178,11 +1182,6 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
ui_set_next_flags(disabled_flags|UI_BoxFlag_DrawOverlay);
|
||||
ui_set_next_overlay_color(mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_Highlight0), v4f32(1, 1, 1, 0.2f)));
|
||||
}
|
||||
else if(row->flags & DF_EvalVizRowFlag_ExprIsSpecial)
|
||||
{
|
||||
ui_set_next_flags(disabled_flags|UI_BoxFlag_DrawOverlay);
|
||||
ui_set_next_overlay_color(mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground), v4f32(1, 1, 1, 0.2f)));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_set_next_flags(disabled_flags);
|
||||
@@ -1241,6 +1240,11 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
// rjf: build
|
||||
UI_Signal sig = {0};
|
||||
B32 next_expanded = row_expanded;
|
||||
if(row->flags & DF_EvalVizRowFlag_ExprIsSpecial)
|
||||
{
|
||||
ui_set_next_flags(disabled_flags|UI_BoxFlag_DrawOverlay);
|
||||
ui_set_next_overlay_color(mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground), v4f32(1, 1, 1, 0.2f)));
|
||||
}
|
||||
UI_TableCell
|
||||
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((cell_selected && ewv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
@@ -1401,6 +1405,11 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
|
||||
// rjf: build
|
||||
UI_Signal sig = {0};
|
||||
if(row_is_bad)
|
||||
{
|
||||
ui_set_next_flags(disabled_flags|UI_BoxFlag_DrawOverlay);
|
||||
ui_set_next_overlay_color(mul_4f32(df_rgba_from_theme_color(DF_ThemeColor_FailureBackground), v4f32(1, 1, 1, 0.2f)));
|
||||
}
|
||||
UI_TableCell UI_Font(code_font)
|
||||
UI_FocusHot(cell_selected ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
UI_FocusActive((cell_selected && ewv->input_editing) ? UI_FocusKind_On : UI_FocusKind_Off)
|
||||
@@ -1448,6 +1457,12 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: bad & hovering -> display
|
||||
if(row_is_bad && sig.hovering) UI_Tooltip
|
||||
{
|
||||
UI_PrefWidth(ui_children_sum(1)) df_error_label(str8_lit("Could not read process memory successfully."));
|
||||
}
|
||||
|
||||
// rjf: press -> focus & commit if editing & not selected
|
||||
if(sig.pressed)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user