From fce8869458e2a902092e5cbf57130a65e8ec340d Mon Sep 17 00:00:00 2001 From: silverweed Date: Tue, 30 Jul 2024 11:44:00 +0200 Subject: [PATCH] show seek addr in hex in rntuple anchor hover info --- src/rntuple.cpp | 4 ++-- third_party/imgui_club/imgui_memory_editor.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rntuple.cpp b/src/rntuple.cpp index bbf7645..189ba15 100644 --- a/src/rntuple.cpp +++ b/src/rntuple.cpp @@ -632,10 +632,10 @@ Sec_Hover_Info get_section_hover_info(Arena *arena, Section section, u64 off, co || try_sec_hover.field("Version Major: %u") || try_sec_hover.field("Version Minor: %u") || try_sec_hover.field("Version Patch: %u") - || try_sec_hover.field("Seek Header: %u") + || try_sec_hover.field("Seek Header: 0x%lX") || try_sec_hover.field("NBytes Header: %u") || try_sec_hover.field("Len Header: %u") - || try_sec_hover.field("Seek Footer: %u") + || try_sec_hover.field("Seek Footer: 0x%lX") || try_sec_hover.field("NBytes Footer: %u") || try_sec_hover.field("Len Footer: %u") || try_sec_hover.field("Max Key Size: %u") diff --git a/third_party/imgui_club/imgui_memory_editor.h b/third_party/imgui_club/imgui_memory_editor.h index 466c3e6..214dfaf 100644 --- a/third_party/imgui_club/imgui_memory_editor.h +++ b/third_party/imgui_club/imgui_memory_editor.h @@ -217,7 +217,7 @@ struct MemoryEditor // Memory Editor contents only void DrawContents(void* mem_data_void, size_t mem_size, size_t base_display_addr = 0x0000) - { + { if (Cols < 1) Cols = 1; @@ -282,11 +282,13 @@ struct MemoryEditor // Disallow interacting with multiple bytes simultaneously. // This is needed because consecutive hex cells overlap each other by 1 pixel. bool interact_invoked = false; + size_t addr; while (clipper.Step()) + { for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible lines { - size_t addr = (size_t)(line_i) * Cols; + addr = (size_t)(line_i) * Cols; ImGui::Text(format_address, s.AddrDigitsCount, base_display_addr + addr); // Draw Hexadecimal @@ -478,6 +480,8 @@ struct MemoryEditor } } } + } + ImGui::PopStyleVar(2); const float child_width = ImGui::GetWindowSize().x; ImGui::EndChild();