diff options
author | Eugene Syromyatnikov <evgsyr@gmail.com> | 2022-08-03 15:39:34 +0200 |
---|---|---|
committer | Eugene Syromyatnikov <evgsyr@gmail.com> | 2022-08-11 14:34:17 +0200 |
commit | 9fd4989f7d14f4213627d521626fbecdd52838eb (patch) | |
tree | 2c1745102a9057ec61e0e02a805c0d528840e34b | |
parent | e7ea1edfa490266bce7aeb47b33d0067b9233a43 (diff) | |
download | strace-9fd4989f7d14f4213627d521626fbecdd52838eb.tar.gz |
printsiginfo: print si_trapno for SIGFPE on alpha
* src/printsiginfo.c [ALPHA] (print_si_info) <case SIGFPE>: Print
si_trapno.
* tests/ptrace.c: Update expected output.
-rw-r--r-- | src/printsiginfo.c | 8 | ||||
-rw-r--r-- | tests/ptrace.c | 11 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/printsiginfo.c b/src/printsiginfo.c index 0623313db..d5b481d4f 100644 --- a/src/printsiginfo.c +++ b/src/printsiginfo.c @@ -184,6 +184,14 @@ print_si_info(struct tcb *tcp, const siginfo_t *sip) #endif /* SPARC || SPARC64 */ break; case SIGFPE: + tprint_struct_next(); + PRINT_FIELD_PTR(*sip, si_addr); +#ifdef ALPHA + tprint_struct_next(); + PRINT_FIELD_XVAL_D(*sip, si_trapno, alpha_trap_codes, + "GEN_???"); +#endif /* ALPHA */ + break; case SIGBUS: tprint_struct_next(); PRINT_FIELD_PTR(*sip, si_addr); diff --git a/tests/ptrace.c b/tests/ptrace.c index 0e4f17c06..9cbce64c5 100644 --- a/tests/ptrace.c +++ b/tests/ptrace.c @@ -1968,16 +1968,23 @@ main(void) XLAT_ARGS(SIGILL), XLAT_ARGS(ILL_ILLOPC), XLAT_ARGS(ENOENT), sip->si_addr, errstr); + /* SIGFPE */ memset(sip, -1, sizeof(*sip)); sip->si_signo = SIGFPE; sip->si_code = 1; sip->si_errno = ENOENT; sip->si_addr = (void *) (unsigned long) 0xfacefeeddeadbeefULL; +#ifdef si_trapno + sip->si_trapno = -7; +#endif 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}" - ") = %s\n", + ", si_code=" XLAT_FMT ", si_errno=" XLAT_FMT_U ", si_addr=%p" +#ifdef __alpha__ + ", si_trapno=" XLAT_KNOWN(-7, "GEN_FLTINE") +#endif + "}) = %s\n", XLAT_ARGS(PTRACE_SETSIGINFO), pid, bad_request, XLAT_ARGS(SIGFPE), XLAT_ARGS(FPE_INTDIV), XLAT_ARGS(ENOENT), sip->si_addr, errstr); |