Add hexdump to trailing user data for vis_heap_chunks command (#2620)

pull/2627/head
CptGibbon 12 months ago committed by GitHub
parent 2c583c21d4
commit 8a2debb9d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1135,6 +1135,11 @@ def vis_heap_chunks(
cursor += ptr_size
if printed % 2 != 0:
# Alignment whitespace of ("0x" + "00" * ptr_size) length.
machine_word_string_length = 2 + (2 * ptr_size)
out += "\t" + " " * machine_word_string_length + "\t" + color_func(asc)
print(out)
if reached_mapping_end:

@ -69,7 +69,7 @@ def test_vis_heap_chunk_command(start_binary):
expected.append(
"%#x\t0x0000000000000000\t0x0000000000000000\t................" % heap_iter()
)
expected.append("%#x\t0x0000000000000000" % heap_iter())
expected.append("%#x\t0x0000000000000000\t \t........" % heap_iter())
assert result == expected
## This time using `default-visualize-chunk-number` to set `count`, to make sure that the config can work
@ -92,7 +92,7 @@ def test_vis_heap_chunk_command(start_binary):
expected2 = expected[:-1] + [
"%#x\t0x0000000000000000\t0x0000000000000021\t........!......." % heap_iter(0),
"%#x\t0x0000000000000000\t0x0000000000000000\t................" % heap_iter(),
"%#x\t0x0000000000000000" % heap_iter(),
"%#x\t0x0000000000000000\t \t........" % heap_iter(),
]
assert result2 == expected2

Loading…
Cancel
Save