mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 09:18:09 +00:00
visualize unmapped addresses in memory view more correctly (not as 0s) - annotate explicitly with unmapped address annotation
This commit is contained in:
@@ -160,6 +160,8 @@ internal U64 cstring32_length(U32 *c);
|
||||
////////////////////////////////
|
||||
//~ rjf: String Constructors
|
||||
|
||||
#define s(S) str8_lit(S)
|
||||
|
||||
#define str8_lit(S) str8((U8*)(S), sizeof(S) - 1)
|
||||
#define str8_lit_comp(S) {(U8*)(S), sizeof(S) - 1,}
|
||||
#define str8_lit_cstr(S) str8((U8*)(S), sizeof(S))
|
||||
|
||||
@@ -3172,6 +3172,7 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
|
||||
//////////////////////////////
|
||||
//- rjf: produce fancy strings for all possible byte values in all cells
|
||||
//
|
||||
DR_FStrList unmapped_byte_fstrs = {0};
|
||||
DR_FStrList byte_fstrs[256] = {0};
|
||||
DR_FStrList byte_fstrs_selected[256] = {0};
|
||||
DR_FStrList byte_fstrs_changed[256] = {0};
|
||||
@@ -3187,6 +3188,10 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
|
||||
UI_TagF("weak") zero_color = ui_color_from_name(str8_lit("text"));
|
||||
Vec4F32 changed_color = full_color;
|
||||
UI_TagF("neutral") changed_color = ui_color_from_name(str8_lit("text"));
|
||||
{
|
||||
DR_FStr fstr = {str8_lit("x"), {font, font_raster_flags, zero_color, cell_font_size, 0, 0}};
|
||||
dr_fstrs_push(scratch.arena, &unmapped_byte_fstrs, &fstr);
|
||||
}
|
||||
for(U64 idx = 0; idx < ArrayCount(byte_fstrs); idx += 1)
|
||||
{
|
||||
U8 byte = (U8)idx;
|
||||
@@ -3606,6 +3611,27 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: fill unmapped annotations
|
||||
{
|
||||
Annotation *bad_annotation = push_array(scratch.arena, Annotation, 1);
|
||||
AnnotationNode *bad_annotation_node = push_array(scratch.arena, AnnotationNode, 1);
|
||||
bad_annotation_node->v = bad_annotation;
|
||||
UI_TagF("bad")
|
||||
{
|
||||
bad_annotation->name_string = s("(unmapped address)");
|
||||
bad_annotation->txt_color = ui_color_from_name(s("text"));
|
||||
}
|
||||
for(U64 vaddr = viz_range_bytes.min; vaddr < viz_range_bytes.max; vaddr += 1)
|
||||
{
|
||||
U64 visible_byte_idx = vaddr - viz_range_bytes.min;
|
||||
B32 byte_is_bad = !!(visible_memory_bad_flags[visible_byte_idx/64] & (1ull<<(visible_byte_idx%64)));
|
||||
if(byte_is_bad)
|
||||
{
|
||||
visible_memory_annotations[visible_byte_idx].first = visible_memory_annotations[visible_byte_idx].last = bad_annotation_node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
access_close(access);
|
||||
}
|
||||
|
||||
@@ -4236,6 +4262,10 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
|
||||
dr_fstrs_push(scratch.arena, &fstrs, &fstr);
|
||||
ui_box_equip_display_fstrs(cell_box, &fstrs);
|
||||
}
|
||||
else if(byte_is_bad)
|
||||
{
|
||||
ui_box_equip_display_fstrs(cell_box, &unmapped_byte_fstrs);
|
||||
}
|
||||
else if(byte_is_selected)
|
||||
{
|
||||
ui_box_equip_display_fstrs(cell_box, &byte_fstrs_selected[byte_value]);
|
||||
|
||||
Reference in New Issue
Block a user