mirror of https://github.com/pwndbg/pwndbg.git
Re-enable archlinux tests (#3478)
* reenable arch tests * fix dt and dedup gdb/dt. fix elf * fix 32-bit tests * fix go code (and thus test)pull/3482/head^2
parent
32085bda12
commit
0cdc2db4c4
@ -1,43 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
import gdb
|
||||
|
||||
from . import get_binary
|
||||
|
||||
HEAP_MALLOC_CHUNK = get_binary("heap_malloc_chunk.native.out")
|
||||
|
||||
|
||||
def test_command_dt_works_with_address(start_binary):
|
||||
start_binary(HEAP_MALLOC_CHUNK)
|
||||
gdb.execute("break break_here")
|
||||
gdb.execute("continue")
|
||||
|
||||
tcache = gdb.execute("print tcache", to_string=True)
|
||||
|
||||
tcache_addr = tcache.split()[-1]
|
||||
|
||||
out = gdb.execute(f'dt "struct tcache_perthread_struct" {tcache_addr}', to_string=True)
|
||||
|
||||
exp_regex = (
|
||||
"struct tcache_perthread_struct @ 0x[0-9a-f]+\n"
|
||||
" 0x[0-9a-f]+ \\+0x0000 counts : \\{[0-9]+, [0-9]+ <repeats 63 times>\\}\n"
|
||||
" 0x[0-9a-f]+ \\+0x[0-9a-f]{4} entries : \\{0x[0-9a-f]+, 0x[0-9a-f]+ <repeats 63 times>\\}\n"
|
||||
)
|
||||
assert re.match(exp_regex, out)
|
||||
|
||||
|
||||
def test_command_dt_works_with_no_address(start_binary):
|
||||
start_binary(HEAP_MALLOC_CHUNK)
|
||||
gdb.execute("break break_here")
|
||||
gdb.execute("continue")
|
||||
|
||||
out = gdb.execute('dt "struct tcache_perthread_struct"', to_string=True)
|
||||
|
||||
exp_regex = (
|
||||
"struct tcache_perthread_struct\n"
|
||||
" \\+0x0000 counts : uint16_t \\[64\\]\n"
|
||||
" \\+0x[0-9a-f]{4} entries : tcache_entry \\*\\[64\\]\n"
|
||||
)
|
||||
assert re.match(exp_regex, out)
|
||||
Loading…
Reference in new issue