@ -547,12 +547,15 @@ def test_jemalloc_extent_info(start_binary):
gdb . execute ( " break break_here " )
gdb . execute ( " continue " )
EXPECTED_EXTENT_ADDRESS = 0x7FFFF7A16580
find_extent_results = gdb . execute ( " jemalloc_find_extent ptr " , to_string = True ) . splitlines ( )
extent_address = None
for line in find_extent_results :
if " Extent Address: " in line :
extent_address = int ( line . split ( " " ) [ - 1 ] , 16 )
if extent_address is None :
raise ValueError ( " Could not find extent address " )
# run jemalloc extent_info command
result = gdb . execute (
f " jemalloc_extent_info { EXPECTED_EXTENT_ADDRESS } " , to_string = True
) . splitlines ( )
result = gdb . execute ( f " jemalloc_extent_info { extent_address } " , to_string = True ) . splitlines ( )
expected_output = [
" Jemalloc extent info " ,
@ -568,7 +571,6 @@ def test_jemalloc_extent_info(start_binary):
assert re . match ( expected_output [ i ] , result [ i ] )
@pytest.mark.skip ( reason = " Output is resulting in duplicate extents " )
def test_jemalloc_heap ( start_binary ) :
start_binary ( HEAP_JEMALLOC_HEAP )
gdb . execute ( " break break_here " )
@ -582,14 +584,8 @@ def test_jemalloc_heap(start_binary):
" This command was tested only for jemalloc 5.3.0 and does not support lower versions " ,
]
expected_output + = [
" " ,
" Allocated Address: " + re_match_valid_address ,
r " Extent Address: " + re_match_valid_address ,
" Size: 0x401000 " ,
" Small class: False " ,
]
# Extent sizes different depending on the system built (it would seem), so only check for the 0x8000 size,
# since it seems consistent. The output of an extent implies the rest of the command is working
expected_output + = [
" " ,
" Allocated Address: " + re_match_valid_address ,
@ -598,21 +594,5 @@ def test_jemalloc_heap(start_binary):
" Small class: False " ,
]
expected_output + = [
" " ,
" Allocated Address: " + re_match_valid_address ,
r " Extent Address: " + re_match_valid_address ,
" Size: 0x8000 " ,
" Small class: False " ,
]
expected_output + = [
" " ,
" Allocated Address: " + re_match_valid_address ,
r " Extent Address: " + re_match_valid_address ,
" Size: 0x1f7000 " ,
" Small class: False " ,
]
for i in range ( len ( expected_output ) ) :
assert re . match ( expected_output [ i ] , result [ i ] )