Skip to content

Commit 5048147

Browse files
committed
add floating point visualization to memview
1 parent aa42d12 commit 5048147

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/raddbg/raddbg_views.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7153,6 +7153,8 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(memory)
71537153
ui_labelf("U16:");
71547154
ui_labelf("U32:");
71557155
ui_labelf("U64:");
7156+
ui_labelf("F32:");
7157+
ui_labelf("F64:");
71567158
}
71577159
UI_PrefWidth(ui_em(45.f, 1.f)) UI_HeightFill UI_Column
71587160
UI_PrefHeight(ui_px(row_height_px, 0.f))
@@ -7165,15 +7167,21 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(memory)
71657167
U64 as_u16 = 0;
71667168
U64 as_u32 = 0;
71677169
U64 as_u64 = 0;
7170+
F32 as_f32 = 0;
7171+
F64 as_f64 = 0;
71687172
U64 cursor_off = cursor-viz_range_bytes.min;
71697173
as_u8 = (U64)*(U8 *)(visible_memory + cursor_off);
71707174
as_u16 = (U64)*(U16*)(visible_memory + cursor_off);
71717175
as_u32 = (U64)*(U32*)(visible_memory + cursor_off);
71727176
as_u64 = (U64)*(U64*)(visible_memory + cursor_off);
7177+
as_f32 = (F32)*(F32*)(visible_memory + cursor_off);
7178+
as_f64 = (F64)*(F64*)(visible_memory + cursor_off);
71737179
ui_labelf("%02X (%I64u)", as_u8, as_u8);
71747180
ui_labelf("%04X (%I64u)", as_u16, as_u16);
71757181
ui_labelf("%08X (%I64u)", as_u32, as_u32);
71767182
ui_labelf("%016I64X (%I64u)", as_u64, as_u64);
7183+
ui_labelf("%+.8e (%+.6a)", as_f32, as_f32);
7184+
ui_labelf("%+.17e (%+.13a)", as_f64, as_f64);
71777185
}
71787186
}
71797187
}

0 commit comments

Comments
 (0)