From 348b64ebb009c1cefe2145ff738ab640c4323ff4 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Fri, 31 Dec 2021 20:30:42 -0800 Subject: [PATCH] [tools] Fix the j6tw GDB command The j6tw (j6 table walk) command to debug page tables was throwing an exception for an integer that was too big when the default radix was 16, because it would interpret ints as hex even without the 0x prefix. Now j6tw explicitly converts to hex and uses the prefix to be explicit. --- assets/debugging/jsix.elf-gdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/debugging/jsix.elf-gdb.py b/assets/debugging/jsix.elf-gdb.py index be711af..a69c3bf 100644 --- a/assets/debugging/jsix.elf-gdb.py +++ b/assets/debugging/jsix.elf-gdb.py @@ -114,7 +114,7 @@ class TableWalkCommand(gdb.Command): table = pml4 entry = 0 for i in range(len(indices)): - entry = int(gdb.parse_and_eval(f'((uint64_t*){table})[{indices[i]}]')) + entry = int(gdb.parse_and_eval(f'((uint64_t*)0x{table:x})[0x{indices[i]:x}]')) flagset = flagsets[i] flag_names = " | ".join([f[1] for f in flagset if (entry & f[0]) == f[0]])