diff options
Diffstat (limited to 'scripts/gdb')
| -rw-r--r-- | scripts/gdb/teachos/dump_mb2i.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/gdb/teachos/dump_mb2i.py b/scripts/gdb/teachos/dump_mb2i.py index ca0c378..3a9ee4a 100644 --- a/scripts/gdb/teachos/dump_mb2i.py +++ b/scripts/gdb/teachos/dump_mb2i.py @@ -161,9 +161,9 @@ class DumpMB2I(gdb.Command): def _print_tag(self, inferior, tag_address, tag_type, tag_size): name = TAG_NAMES.get(tag_type, f"Unknown Tag") - gdb.write( - f"[Tag {tag_type:#04x}] {name} (size: {self._format_size(tag_size)})\n" - ) + size = self._format_size(tag_size) + payload = self._format_size(tag_size - 8) + gdb.write(f"[Tag {tag_type:#04x}] {name} (size: {size} | payload: {payload})\n") if tag_size <= 8 and tag_type != TagType.END: return @@ -182,9 +182,8 @@ class DumpMB2I(gdb.Command): TagType.FRAMEBUFFER: self._write_framebuffer_info_tag, } - handler = handlers.get(tag_type) - if handler: - handler(data) + handler = handlers.get(tag_type, self._write_unknown_tag) + handler(data) except Exception as e: gdb.write( @@ -242,3 +241,9 @@ class DumpMB2I(gdb.Command): gdb.write(f"{INDENT}width: {width} chars | height: {height} chars\n") else: gdb.write(f"{INDENT}width: {width} px | height: {height} px\n") + + def _write_unknown_tag(self, data): + for i in range(0, len(data), 16): + chunk = data[i : i + 16] + hex_chunk = " ".join([f"{b:02x}" for b in chunk]) + gdb.write(f"{INDENT}{i:#010x}: {hex_chunk}\n") |
