Echo cmd in string consistency test macros (#5052)

This commit is contained in:
Khairul Azhar Kasmiran 2025-03-30 18:42:01 +08:00 committed by GitHub
parent 9b64e0d71e
commit af39a3433b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 11 deletions

View file

@ -951,15 +951,14 @@ RUN
NAME=consistency btw /z and /x at 0x20k multiple
FILE=--
CMDS=<<EOF
. scripts/string-consistency-test.rz
$str=$abc+d
$bin=$malloc://0x40000+10
$setup=$"w `$str` @@=0x20000 0x40000"
. scripts/string-consistency-test.rz
.(search.show_progress "/z\ `$str`")
.(search.show_progress "/z `$str`")
echo ----
$bytes=%x `$str`
.(search.show_progress "/x\ `$bytes`")
.(search.show_progress "/x `$bytes`")
EOF
EXPECT=<<EOF
[0x0, 0x207ff): 1

View file

@ -128,15 +128,14 @@ RUN
NAME=consistency btw /z and /x
FILE=bins/elf/analysis/ls2
CMDS=<<EOF
. scripts/string-consistency-test.rz
$str=$lib
$bin=$bins/elf/analysis/ls2
$setup=$""
. scripts/string-consistency-test.rz
.(search.show_progress "/z\ `$str`")
.(search.show_progress "/z `$str`")
echo ----
$bytes=%x `$str`
.(search.show_progress "/x\ `$bytes`")
.(search.show_progress "/x `$bytes`")
echo ----
/z lib > /dev/null

View file

@ -1,5 +1,5 @@
# $setup and $bin need to be defined before running this script
# $setup and $bin need to be defined before calling this script's macros
(show_intervals cmd; !!rizin -qc "e search.show_progress=intervals; `$setup`; ${cmd}" -1 `$bin` | grep "^.*[[:punct:]]0x.*" | sed "s/^.*[[:cntrl:]]//"~$0)
(show_hits cmd; !!rizin -qc "`$setup`; ${cmd}" `$bin`)
(show_intervals cmd; !!rizin -qc "e search.show_progress=intervals; `$setup`; `echo ${cmd}`" -1 `$bin` | grep "^.*[[:punct:]]0x.*" | sed "s/^.*[[:cntrl:]]//"~$0)
(show_hits cmd; !!rizin -qc "`$setup`; `echo ${cmd}`" `$bin`)
(search.show_progress cmd; .(show_intervals ${cmd}); .(show_hits ${cmd}))