From: Dmitry V. Levin Date: Wed, 4 Mar 2015 20:04:02 +0000 (+0000) Subject: mips o32: fix sigreturn decoding X-Git-Tag: v4.10~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd6d2072b1a7241f7a2ce12d8ac1da37da063349;p=strace mips o32: fix sigreturn decoding * signal.c (sys_sigreturn) [LINUX_MIPSO32]: Fix the address of signal mask. [MIPS] Use print_sigset_addr_len to print signal mask. --- diff --git a/signal.c b/signal.c index f084772a..b3a8a20e 100644 --- a/signal.c +++ b/signal.c @@ -900,23 +900,28 @@ sys_sigreturn(struct tcb *tcp) tprintsigmask_val("", mask); } } -#elif defined(LINUX_MIPSN32) || defined(LINUX_MIPSN64) - /* This decodes rt_sigreturn. The 64-bit ABIs do not have - sigreturn. */ +#elif defined MIPS if (entering(tcp)) { - struct ucontext uc; - /* There are six words followed by a 128-byte siginfo. */ - long sp = mips_REG_SP + 6 * 4 + 128; - if (umove(tcp, sp, &uc) < 0) - return 0; - tprintsigmask_val(") (mask ", uc.uc_sigmask); - } -#elif defined(LINUX_MIPSO32) - if (entering(tcp)) { - m_siginfo_t si; - if (umove(tcp, mips_REG_SP, &si) < 0) - return 0; - tprintsigmask_val(") (mask ", si.si_mask); +# if defined LINUX_MIPSO32 + /* + * offsetof(struct sigframe, sf_mask) == + * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct sigcontext) + */ + const long addr = mips_REG_SP + 6 * 4 + + sizeof(struct sigcontext); +# else + /* + * This decodes rt_sigreturn. + * The 64-bit ABIs do not have sigreturn. + * + * offsetof(struct rt_sigframe, rs_uc) == + * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct siginfo) + */ + const long addr = mips_REG_SP + 6 * 4 + 128 + + offsetof(struct ucontext, uc_sigmask); +# endif + tprints(") (mask "); + print_sigset_addr_len(tcp, addr, NSIG / 8); } #elif defined(CRISV10) || defined(CRISV32) if (entering(tcp)) {