Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add floating point interpretation in memory panel #162

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/raddbg/raddbg_views.c
Original file line number Diff line number Diff line change
Expand Up @@ -7153,6 +7153,8 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(memory)
ui_labelf("U16:");
ui_labelf("U32:");
ui_labelf("U64:");
ui_labelf("F32:");
ui_labelf("F64:");
}
UI_PrefWidth(ui_em(45.f, 1.f)) UI_HeightFill UI_Column
UI_PrefHeight(ui_px(row_height_px, 0.f))
Expand All @@ -7165,15 +7167,21 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(memory)
U64 as_u16 = 0;
U64 as_u32 = 0;
U64 as_u64 = 0;
F32 as_f32 = 0;
F64 as_f64 = 0;
U64 cursor_off = cursor-viz_range_bytes.min;
as_u8 = (U64)*(U8 *)(visible_memory + cursor_off);
as_u16 = (U64)*(U16*)(visible_memory + cursor_off);
as_u32 = (U64)*(U32*)(visible_memory + cursor_off);
as_u64 = (U64)*(U64*)(visible_memory + cursor_off);
as_f32 = (F32)*(F32*)(visible_memory + cursor_off);
as_f64 = (F64)*(F64*)(visible_memory + cursor_off);
ui_labelf("%02X (%I64u)", as_u8, as_u8);
ui_labelf("%04X (%I64u)", as_u16, as_u16);
ui_labelf("%08X (%I64u)", as_u32, as_u32);
ui_labelf("%016I64X (%I64u)", as_u64, as_u64);
ui_labelf("%+.8e (%+.6a)", as_f32, as_f32);
ui_labelf("%+.17e (%+.13a)", as_f64, as_f64);
}
}
}
Expand Down