mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[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.
This commit is contained in:
@@ -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]])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user