From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30583 invoked by alias); 11 Dec 2005 19:17:46 -0000 Received: (qmail 30564 invoked by uid 22791); 11 Dec 2005 19:17:45 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 11 Dec 2005 19:17:42 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id jBBJHdJE000153; Sun, 11 Dec 2005 20:17:39 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id jBBJHdFS014186; Sun, 11 Dec 2005 20:17:39 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id jBBJHciL007616; Sun, 11 Dec 2005 20:17:38 +0100 (CET) Date: Tue, 13 Dec 2005 20:20:00 -0000 Message-Id: <200512111917.jBBJHciL007616@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: randolph@tausq.org CC: gdb-patches@sources.redhat.com In-reply-to: <439C3A10.8090103@tausq.org> (message from Randolph Chung on Sun, 11 Dec 2005 22:39:12 +0800) Subject: Re: [hpux] Improve sigtramp frame identification References: <437F1F25.6040104@tausq.org> <200512062139.jB6LdRX4029666@elgar.sibelius.xs4all.nl> <43961F34.9020701@tausq.org> <200512111112.jBBBCR6P004287@elgar.sibelius.xs4all.nl> <439C3A10.8090103@tausq.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00208.txt.bz2 > Date: Sun, 11 Dec 2005 22:39:12 +0800 > From: Randolph Chung > > > Hmm, here's an alternative approach: if we're in an export stub, look > > if the stub leads us to a function that has HP_UX_interrupt_marker set > > in its unwind record. This makes us read an instruction from the > > inferior, but it should be pretty robust. > > > > ok? > > Hrm, this seems to assume that you are sitting at a specific insn of the > export stub when doing unwinding. We should be able to unwind from any > insn in the export stub, right? Uh, yes, you're right. The attached patch works indeed better. That bit ok now? > > Now that signal trampolines get detected again on HP-UX 10.20, I > > noticed another recent change that seems to have broken things. Your > > recent overhaul of hppa_hpux_sigtramp_frame_unwind_cache added these > > two lines: > > > > info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].addr = > > info->saved_regs[HPPA_RP_REGNUM].addr; > > > > This breaks stuff, since at least on HP-UX 10.20 %pcoqh as read from > > the signal state is correct. And I have a hard time believing that > > this would be different on HP-UX 11.xx. Can you explain why you added > > this? > > You are right, I shouldn't have added that. I thought this fixed a > problem with signal frame unwinding when I was looking at > hppa64-hp-hpux11.11, but actually I think something else is broken. > Sorry for not testing this more thoroughly before committing. I'll back > out that change tomorrow. Thanks! Mark Index: hppa-hpux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v retrieving revision 1.45 diff -u -p -r1.45 hppa-hpux-tdep.c --- hppa-hpux-tdep.c 19 Nov 2005 12:55:55 -0000 1.45 +++ hppa-hpux-tdep.c 11 Dec 2005 19:14:14 -0000 @@ -1233,9 +1233,6 @@ hppa_hpux_sigtramp_frame_unwind_cache (s /* TODO: fp regs */ - info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].addr = - info->saved_regs[HPPA_RP_REGNUM].addr; - info->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM); return info; @@ -1279,6 +1276,22 @@ hppa_hpux_sigtramp_unwind_sniffer (struc u = find_unwind_entry (pc); + /* If this is an export stub, try to get the unwind descriptor for + the actual function itself. */ + if (u && u->stub_unwind.stub_type == EXPORT) + { + gdb_byte buf[HPPA_INSN_SIZE]; + unsigned long insn; + + if (!safe_frame_unwind_memory (next_frame, u->region_start, + buf, sizeof buf)) + return NULL; + + insn = extract_unsigned_integer (buf, sizeof buf); + if ((insn & 0xffe0e000) == 0xe8400000) + u = find_unwind_entry(u->region_start + hppa_extract_17 (insn) + 8); + } + if (u && u->HP_UX_interrupt_marker) return &hppa_hpux_sigtramp_frame_unwind;