diff options
author | Helge Deller <deller@gmx.de> | 2023-01-29 22:08:53 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-01-29 21:08:53 +0000 |
commit | 1b828bb0f48ad7b9a87027f52ecdd4107f4c02c6 (patch) | |
tree | ef242e4d7f8a81a8e4201c47efe350cdd608e426 | |
parent | ef726bcfb45148dea50872133cc5fe1f40072945 (diff) | |
download | strace-1b828bb0f48ad7b9a87027f52ecdd4107f4c02c6.tar.gz |
hppa: Fix pc.test testcase on hppa architecture
On hppa the lowest 2 bits of an address encodes the (parisc-specific)
address space in which a program runs. For userspace processes the space
number is 3, which is why an instruction at e.g. 0x100 shows up in the
address registers as 0x103.
This behaviour is different than on other architectures, which is
why the pc.test testcase fails on hppa.
Fix the testcase by simply dropping the last nibble of the address
when comparing the output, e.g. search for "0x10?" instead of "0x100".
Signed-off-by: Helge Deller <deller@gmx.de>
-rwxr-xr-x | tests/pc.test | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/pc.test b/tests/pc.test index 5ac432131..7da0d6b0c 100755 --- a/tests/pc.test +++ b/tests/pc.test @@ -24,14 +24,15 @@ pid="$(sed -r -n 's/^\[[[:xdigit:]]{'"$len"'}\] --- SIGCHLD \{si_signo=SIGCHLD, [ -n "$pid" ] && ip="$(sed -r -n 's/^\[pid +'"$pid"'\] \[([[:xdigit:]]{'"$len"'})] --- SIGSEGV \{.*\} ---$/\1/p' "$LOG")" && [ -n "$ip" ] && -addr="$(echo "$ip" |sed -r 's/^0+//')" && +# strip the last nibble of the address. On hppa the lowest 2 bits encode the address space. +addr="$(echo "$ip" |sed -r 's/^0+//')" && addr=${addr%?} && [ -n "$addr" ] || dump_log_and_fail_with cat > "$EXP" << __EOF__ \\[[[:xdigit:]]{$len}\\] munmap\\(0x[[:xdigit:]]+, 0\\) += -1 .* -\\[pid +$pid\\] \\[$ip\\] --- SIGSEGV \\{si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x$addr\\} --- \\[pid +$pid\\] \\[\\?{$len}\\] \\+\\+\\+ killed by SIGSEGV( \\(core dumped\\))? \\+\\+\\+ +\\[pid +$pid\\] \\[$ip\\] --- SIGSEGV \\{si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x$addr[[:xdigit:]]\\} --- \\[\\?{$len}\\] \\+\\+\\+ exited with 0 \\+\\+\\+ __EOF__ |