Make debug tests work with Ubuntu 22.04 (#5473)

This commit is contained in:
Khairul Azhar Kasmiran 2025-10-21 17:59:53 +08:00 committed by GitHub
parent ee254f0f5d
commit 4bbf4408f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 11 deletions

View file

@ -13,7 +13,8 @@ NAME=dbg.maps.count
FILE=bins/elf/analysis/elf-nx
ARGS=-d
CMDS=<<EOF
dm~?
. scripts/alt_count.rz
.(alt_count `dm~?` 9 10)
EOF
EXPECT=<<EOF
10
@ -24,8 +25,9 @@ NAME=debug map flags count
FILE=bins/elf/analysis/elf-nx
ARGS=-d
CMDS=<<EOF
fl@F:maps~?
dm*~?
. scripts/alt_count.rz
.(alt_count `fl@F:maps~?` 9 10)
.(alt_count `dm*~?` 11 12)
EOF
EXPECT=<<EOF
10
@ -37,18 +39,16 @@ NAME=dbg.maps.count.after.map
FILE=bins/elf/analysis/x86-helloworld-gcc
ARGS=-d
CMDS=<<EOF
dm~?
. scripts/alt_count.rz
.(alt_count `dm~?` 9 10)
db @ sym.imp.puts
dc~?
echo ----
$dm=%b64- `dm | base64 -w 0`
$dm~x86-helloworld-gcc~?
$libc_count=$`$dm~/usr/lib32/libc.so.6~?`
%= `$libc_count`-6
%! %vi 5
%% $libc_count
.(alt_count `$dm~/usr/lib32/libc.so.6~?` 6 5)
$dm~unk~?
$dm~[v~?
.(alt_count `$dm~[v~?` 2 3)
$dm~/usr/lib32/ld-linux.so.2~?
$dm~[stack~?
echo ----

View file

@ -96,9 +96,10 @@ NAME=dm flags after ood
FILE=bins/elf/analysis/x86-helloworld-gcc
ARGS=-e log.level=4
CMDS=<<EOF
. scripts/alt_count.rz
ood
fl@F:maps~?
dm*~?
.(alt_count `fl@F:maps~?` 9 10)
.(alt_count `dm*~?` 11 12)
EOF
EXPECT=<<EOF
10

View file

@ -0,0 +1,2 @@
# If `result` is `alt_count`, print `count`
(alt_count result alt_count count; $count=$${result}; %= `$count`-${alt_count}; %! %vi ${count}; %% $count)