From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfa] Signal trampoline unwinder for hppa-hpux Date: Fri, 21 May 2004 17:41:00 -0000 Message-id: <40AE3F20.2030205@gnu.org> References: <20040520041746.GW566@tausq.org> X-SW-Source: 2004-05/msg00640.html +/* Signal frames. */ + +static CORE_ADDR +hppa_hpux_sigtramp_find_sigcontext (CORE_ADDR sp, CORE_ADDR pc) +{ + unsigned int insns[5]; + + read_memory_nobpt (pc, (char *)insns, sizeof(insns)); + + /* This comes from _sigreturn: + 379a0000 ldo 0(%r28), %r26 + 6bd33fc9 stw %r19, -28(%sp) + 20200801 ldil -40000000, %r1 + e420e008 be,l 4(%sr7, %rr1), %sr0, %r31 + 34160116 ldi 139, %r22 */ + + if (extract_unsigned_integer (&insns[0], 4) != 0x379a0000 + || extract_unsigned_integer (&insns[1], 4) != 0x6bd33fc9 + || extract_unsigned_integer (&insns[2], 4) != 0x20200801 + || extract_unsigned_integer (&insns[3], 4) != 0xe420e008 + || extract_unsigned_integer (&insns[4], 4) != 0x34160116) + return 0; + + /* We can find a ucontext_t 1352 bytes above the stack. The first + element of the ucontext_t is a mcontext_t (save_state_t), which + contains the registers we want. */ + return sp - 1352; +} Can this make use of tramp-frame for the pattern match? For single stepping through trampolines to work, this code needs to be able to match the tramp when part way through it (what sigstep is testing). Andrew