improve free slot hover info
This commit is contained in:
parent
84a9266f4b
commit
7577457b21
1 changed files with 13 additions and 5 deletions
|
@ -340,9 +340,11 @@ struct Sec_Hover_Fn {
|
||||||
return was_zipped;
|
return was_zipped;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tkey(const char *title = "TKey")
|
// Returns the key len
|
||||||
|
u16 tkey(const char *title = "TKey")
|
||||||
{
|
{
|
||||||
titled_section(title, [this] {
|
u16 keylen = 0;
|
||||||
|
titled_section(title, [this, &keylen] {
|
||||||
u16 version_be;
|
u16 version_be;
|
||||||
if (!read(&version_be, cur_field_off + 4))
|
if (!read(&version_be, cur_field_off + 4))
|
||||||
return;
|
return;
|
||||||
|
@ -350,7 +352,10 @@ struct Sec_Hover_Fn {
|
||||||
u32 version = bswap(version_be);
|
u32 version = bswap(version_be);
|
||||||
b8 is_big = version > 1000;
|
b8 is_big = version > 1000;
|
||||||
|
|
||||||
field_be<u32>("NBytes: %u");
|
field<i32>("NBytes: %d", [] (Arena *arena, String8_Node *prev, const char *fmt, i32 x) {
|
||||||
|
x = bswap(x);
|
||||||
|
return push_str8_node_child(arena, prev, fmt, abs(x));
|
||||||
|
});
|
||||||
field<u16>("Version: %u", [] (Arena *arena, String8_Node *prev, const char *fmt, u16 x) {
|
field<u16>("Version: %u", [] (Arena *arena, String8_Node *prev, const char *fmt, u16 x) {
|
||||||
x = bswap(x);
|
x = bswap(x);
|
||||||
x -= (x > 1000) * 1000;
|
x -= (x > 1000) * 1000;
|
||||||
|
@ -358,7 +363,7 @@ struct Sec_Hover_Fn {
|
||||||
});
|
});
|
||||||
field_be<u32>("Obj Len: %u");
|
field_be<u32>("Obj Len: %u");
|
||||||
field<u32>("Datetime: ", hover_display_datetime_str);
|
field<u32>("Datetime: ", hover_display_datetime_str);
|
||||||
field_be<u16>("Key Len: %u");
|
field_be<u16>("Key Len: %u", &keylen);
|
||||||
field_be<u16>("Cycle: %u");
|
field_be<u16>("Cycle: %u");
|
||||||
if (is_big) {
|
if (is_big) {
|
||||||
field_be<u64>("Seek Key: 0x%" PRIX64);
|
field_be<u64>("Seek Key: 0x%" PRIX64);
|
||||||
|
@ -371,6 +376,8 @@ struct Sec_Hover_Fn {
|
||||||
field_str8<u8>("Obj Name: %s");
|
field_str8<u8>("Obj Name: %s");
|
||||||
field_str8<u8>("Obj Title: %s");
|
field_str8<u8>("Obj Title: %s");
|
||||||
}, HoverSec_HideIfNotHovered);
|
}, HoverSec_HideIfNotHovered);
|
||||||
|
|
||||||
|
return keylen;
|
||||||
}
|
}
|
||||||
|
|
||||||
void envelope_preamble()
|
void envelope_preamble()
|
||||||
|
@ -1073,7 +1080,8 @@ struct Sec_Hover_Fn {
|
||||||
void free_slot()
|
void free_slot()
|
||||||
{
|
{
|
||||||
titled_section("Free Slot", [this] {
|
titled_section("Free Slot", [this] {
|
||||||
range("Freed Data", section.range.len);
|
u32 keylen = tkey();
|
||||||
|
range("Freed Data", section.range.len - section.post_size - keylen);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue