Prepare for the check of strace -k symbol names demangling.
* tests/strace-k.test: Parametrize $test_prog and $expected.
* tests/stack-fcall.h: New file.
* tests/stack-fcall.c: Include "stack-fcall.h"
* tests/stack-fcall-0.c: Likewise.
* tests/stack-fcall-1.c: Likewise.
* tests/stack-fcall-2.c: Likewise.
* tests/stack-fcall-3.c: Likewise.
* tests/Makefile.am (EXTRA_DIST): Add stack-fcall.h.
setugid.c \
sigaltstack.expected \
sockname.c \
+ stack-fcall.h \
strace-C.expected \
strace-E.expected \
strace-T.expected \
-int f1(int i);
+#include "stack-fcall.h"
int f0(int i)
{
-int f2(int i);
+#include "stack-fcall.h"
int f1(int i)
{
-int f3(int i);
+#include "stack-fcall.h"
int f2(int i)
{
#include <unistd.h>
+#include "stack-fcall.h"
int f3(int i)
{
-int f0(int i);
+#include "stack-fcall.h"
int main(int argc, char **argv)
{
--- /dev/null
+int f0(int i);
+int f1(int i);
+int f2(int i);
+int f3(int i);
check_prog sed
check_prog tr
-run_prog ../stack-fcall
+: ${test_prog=../stack-fcall}
+: ${expected='getpid f3 f2 f1 f0 main '}
+
+run_prog "$test_prog"
run_strace -e getpid -k $args
-expected='getpid f3 f2 f1 f0 main '
result=$(sed -r -n '1,/\(main\+0x[a-f0-9]+\) .*/ s/^.*\(([^+]+)\+0x[a-f0-9]+\) .*/\1/p' "$LOG" |
tr '\n' ' ')
echo "result: \"$result\""
dump_log_and_fail_with "$STRACE $args output mismatch"
}
-
-exit 0