aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-05-06 06:56:47 +0000
committerFelix Morgner <felix.morgner@ost.ch>2026-05-06 06:56:47 +0000
commit78bdb0fa6dc5e89156a5c2e1f8d1b5650fe26e20 (patch)
tree6b09cf4887112fe56cd51348a27c58867707789d /scripts/gdb
parenta8a9ade74fc5571ba34635d7ea4bae58748100b0 (diff)
downloadkernel-78bdb0fa6dc5e89156a5c2e1f8d1b5650fe26e20.tar.xz
kernel-78bdb0fa6dc5e89156a5c2e1f8d1b5650fe26e20.zip
dump_mb2i: dump unsupported tags as hex
Diffstat (limited to 'scripts/gdb')
-rw-r--r--scripts/gdb/teachos/dump_mb2i.py17
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")