show seek addr in hex in rntuple anchor hover info

This commit is contained in:
silverweed 2024-07-30 11:44:00 +02:00
parent 2ba48f8784
commit fce8869458
2 changed files with 8 additions and 4 deletions

View file

@ -632,10 +632,10 @@ Sec_Hover_Info get_section_hover_info(Arena *arena, Section section, u64 off, co
|| try_sec_hover.field<u16>("Version Major: %u") || try_sec_hover.field<u16>("Version Major: %u")
|| try_sec_hover.field<u16>("Version Minor: %u") || try_sec_hover.field<u16>("Version Minor: %u")
|| try_sec_hover.field<u16>("Version Patch: %u") || try_sec_hover.field<u16>("Version Patch: %u")
|| try_sec_hover.field<u64>("Seek Header: %u") || try_sec_hover.field<u64>("Seek Header: 0x%lX")
|| try_sec_hover.field<u64>("NBytes Header: %u") || try_sec_hover.field<u64>("NBytes Header: %u")
|| try_sec_hover.field<u64>("Len Header: %u") || try_sec_hover.field<u64>("Len Header: %u")
|| try_sec_hover.field<u64>("Seek Footer: %u") || try_sec_hover.field<u64>("Seek Footer: 0x%lX")
|| try_sec_hover.field<u64>("NBytes Footer: %u") || try_sec_hover.field<u64>("NBytes Footer: %u")
|| try_sec_hover.field<u64>("Len Footer: %u") || try_sec_hover.field<u64>("Len Footer: %u")
|| try_sec_hover.field<u64>("Max Key Size: %u") || try_sec_hover.field<u64>("Max Key Size: %u")

View file

@ -217,7 +217,7 @@ struct MemoryEditor
// Memory Editor contents only // Memory Editor contents only
void DrawContents(void* mem_data_void, size_t mem_size, size_t base_display_addr = 0x0000) void DrawContents(void* mem_data_void, size_t mem_size, size_t base_display_addr = 0x0000)
{ {
if (Cols < 1) if (Cols < 1)
Cols = 1; Cols = 1;
@ -282,11 +282,13 @@ struct MemoryEditor
// Disallow interacting with multiple bytes simultaneously. // Disallow interacting with multiple bytes simultaneously.
// This is needed because consecutive hex cells overlap each other by 1 pixel. // This is needed because consecutive hex cells overlap each other by 1 pixel.
bool interact_invoked = false; bool interact_invoked = false;
size_t addr;
while (clipper.Step()) while (clipper.Step())
{
for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible lines 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); ImGui::Text(format_address, s.AddrDigitsCount, base_display_addr + addr);
// Draw Hexadecimal // Draw Hexadecimal
@ -478,6 +480,8 @@ struct MemoryEditor
} }
} }
} }
}
ImGui::PopStyleVar(2); ImGui::PopStyleVar(2);
const float child_width = ImGui::GetWindowSize().x; const float child_width = ImGui::GetWindowSize().x;
ImGui::EndChild(); ImGui::EndChild();