From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: randolph@tausq.org
Cc: gdb-patches@sources.redhat.com
Subject: Re: [hpux] Improve sigtramp frame identification
Date: Tue, 13 Dec 2005 10:00:00 -0000 [thread overview]
Message-ID: <200512111112.jBBBCR6P004287@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <43961F34.9020701@tausq.org> (message from Randolph Chung on Wed, 07 Dec 2005 07:31:00 +0800)
> Date: Wed, 07 Dec 2005 07:31:00 +0800
> From: Randolph Chung <randolph@tausq.org>
>
> > Bleah, this seems to have broken sigtramp detection on HP-UX 10.20.
> > Problem is that if we go up one frame from the signal handler we end
> > up in the export stub for _sigreturn, and not _sigreturn itself. The
> > export stub doesn't have the HP_UX_interrupt_marker bit set in the
> > unwind record.
> >
> > Did you make this change to fix a specific problem? If not I'd like
> > to add the strcmp() back in...
>
> sigh, ok, please add the strcmp back (with a comment).
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?
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?
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 11:04:03 -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,21 @@ 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, pc, buf, sizeof buf))
+ return NULL;
+
+ insn = extract_unsigned_integer (buf, sizeof buf);
+ if ((insn & 0xffe0e000) == 0xe8400000)
+ u = find_unwind_entry(pc + hppa_extract_17 (insn) + 8);
+ }
+
if (u && u->HP_UX_interrupt_marker)
return &hppa_hpux_sigtramp_frame_unwind;
next prev parent reply other threads:[~2005-12-11 11:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-19 16:06 Randolph Chung
2005-12-07 1:18 ` Mark Kettenis
2005-12-07 17:54 ` Randolph Chung
2005-12-13 10:00 ` Mark Kettenis [this message]
2005-12-13 10:06 ` Randolph Chung
2005-12-13 20:20 ` Mark Kettenis
2005-12-13 20:35 ` Randolph Chung
2005-12-07 19:31 ` Randolph Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200512111112.jBBBCR6P004287@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb-patches@sources.redhat.com \
--cc=randolph@tausq.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox