diff options
author | Dmitry V. Levin <ldv@strace.io> | 2023-02-24 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-02-24 08:00:00 +0000 |
commit | 7ef922a485f89103ef693d0a9465aa3bfeb99ebc (patch) | |
tree | fdf69b65fbe6ee8018c9f3ce43a83cbb1af37765 /tests | |
parent | e88e5e9ae6da68f22d15f9be3193b1412ac9aa02 (diff) | |
download | strace-7ef922a485f89103ef693d0a9465aa3bfeb99ebc.tar.gz |
Fix build on alpha
Workaround a bug in glibc headers that fail to provide
si_trapno field in their definition of siginfo_t on alpha.
Link: https://sourceware.org/bugzilla/show_bug.cgi?id=30173
Resolves: https://github.com/strace/strace/issues/220
* configure.ac (AC_CHECK_MEMBERS): Add siginfo_t.si_trapno.
* src/printsiginfo.c [ALPHA]: Guard use of si_trapno with
HAVE_SIGINFO_T_SI_TRAPNO.
* tests/ptrace.c [ALPHA]: Likewise.
* NEWS: Mention this fix.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ptrace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/ptrace.c b/tests/ptrace.c index d6bc03773..be7ef64fa 100644 --- a/tests/ptrace.c +++ b/tests/ptrace.c @@ -1836,7 +1836,7 @@ main(void) { ARG_XLAT_KNOWN(0x4, "TRAP_HWBKPT") }, #endif { ARG_XLAT_KNOWN(0x5, "TRAP_UNK"), "" -#ifdef __alpha__ +#if defined __alpha__ && defined HAVE_SIGINFO_T_SI_TRAPNO ", si_trapno=0 /* GEN_??? */" }, { ARG_XLAT_KNOWN(0x5, "TRAP_UNK"), @@ -1847,7 +1847,7 @@ main(void) ", si_trapno=-26 /* GEN_??? */" }, { ARG_XLAT_KNOWN(0x5, "TRAP_UNK"), "" ", si_trapno=-1234567890 /* GEN_??? */" -#endif /* __alpha__ */ +#endif /* __alpha__ && HAVE_SIGINFO_T_SI_TRAPNO */ }, { ARG_XLAT_KNOWN(0x6, "TRAP_PERF"), "" #ifdef HAVE_SIGINFO_T_SI_PERF_DATA @@ -1917,7 +1917,7 @@ main(void) switch (sip->si_code) { case 5: /* TRAP_UNK */ -#ifdef __alpha__ +#if defined __alpha__ && defined HAVE_SIGINFO_T_SI_TRAPNO sip->si_trapno = trap_unk_vecs[trap_unk_pos]; #endif trap_unk_pos = (trap_unk_pos + 1) @@ -1981,7 +1981,7 @@ main(void) do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (uintptr_t) sip); printf("ptrace(" XLAT_FMT ", %d, %#lx, {si_signo=" XLAT_FMT_U ", si_code=" XLAT_FMT ", si_errno=" XLAT_FMT_U ", si_addr=%p" -#ifdef __alpha__ +#if defined __alpha__ && defined HAVE_SIGINFO_T_SI_TRAPNO ", si_trapno=" XLAT_KNOWN(-7, "GEN_FLTINE") #endif "}) = %s\n", |