summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-02-24 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2023-02-24 08:00:00 +0000
commit7ef922a485f89103ef693d0a9465aa3bfeb99ebc (patch)
treefdf69b65fbe6ee8018c9f3ce43a83cbb1af37765 /src
parente88e5e9ae6da68f22d15f9be3193b1412ac9aa02 (diff)
downloadstrace-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 'src')
-rw-r--r--src/printsiginfo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/printsiginfo.c b/src/printsiginfo.c
index 3923b9045..49b31fc05 100644
--- a/src/printsiginfo.c
+++ b/src/printsiginfo.c
@@ -168,7 +168,7 @@ print_si_info(struct tcb *tcp, const siginfo_t *sip)
case SIGFPE:
tprint_struct_next();
PRINT_FIELD_PTR(*sip, si_addr);
-#ifdef ALPHA
+#if defined ALPHA && defined HAVE_SIGINFO_T_SI_TRAPNO
tprint_struct_next();
PRINT_FIELD_XVAL_D(*sip, si_trapno, alpha_trap_codes,
"GEN_???");
@@ -214,15 +214,16 @@ print_si_info(struct tcb *tcp, const siginfo_t *sip)
case SIGTRAP:
tprint_struct_next();
PRINT_FIELD_PTR(*sip, si_addr);
-#if defined(ALPHA) || defined(HAVE_SIGINFO_T_SI_PERF_DATA)
+#if (defined ALPHA && defined HAVE_SIGINFO_T_SI_TRAPNO) \
+ || defined HAVE_SIGINFO_T_SI_PERF_DATA
switch (sip->si_code) {
-# ifdef ALPHA
+# if defined ALPHA && defined HAVE_SIGINFO_T_SI_TRAPNO
case TRAP_UNK:
tprint_struct_next();
PRINT_FIELD_XVAL_D(*sip, si_trapno,
alpha_trap_codes, "GEN_???");
break;
-# endif /* ALPHA */
+# endif /* ALPHA && HAVE_SIGINFO_T_SI_TRAPNO */
# ifdef HAVE_SIGINFO_T_SI_PERF_DATA
case TRAP_PERF:
tprint_struct_next();