From: Roland McGrath <roland@redhat.com>
To: Andrew Cagney <cagney@gnu.org>
Cc: Mark Kettenis <kettenis@chello.nl>,
drow@false.org, gdb-patches@sources.redhat.com
Subject: Re: Revamp sniffer; Was: [obish?sym;rfa:doc] Wire up vsyscall
Date: Wed, 16 Jun 2004 23:07:00 -0000 [thread overview]
Message-ID: <200406162307.i5GN7NfB025917@magilla.sf.frob.com> (raw)
In-Reply-To: Andrew Cagney's message of Tuesday, 15 June 2004 16:16:53 -0400 <40CF5935.70007@gnu.org>
I don't have all the background on gdb internals here, but I think I
understand what you've described.
On the x86, the same issue has been considered. The signal trampoline code
provided by the kernel in the vsyscall DSO (which is what gets used with
current glibc on kernels supporting it) has CFI that starts one byte before
the actual trampoline code. This comment is from the
arch/i386/kernel/vsyscall-sigreturn.S, which supplies the handwritten CFI
data in Linux 2.6 kernels:
/* HACK: The dwarf2 unwind routines will subtract 1 from the
return address to get an address in the middle of the
presumed call instruction. Since we didn't get here via
a call, we need to include the nop before the real start
to make up for it. */
In the x86-64 case, there is no kernel-supplied trampoline and current
glibc supplies one and gives it CFI. OTOH, on the x86 on kernels that do
not supply the vsyscall DSO, glibc supplies the trampoline and it provides
no CFI for it, so whatever traditional name-matching or disassembly magic
gdb does takes place instead.
If I understood your description correctly, the source of the current
problem scenario is that glibc supplies CFI for the trampoline code
(__restore_rt), but that CFI is not written to match how the peculiar frame
will look. So, glibc could change its CFI to use the same hack that the
x86 kernel CFI uses for the analogous code, or it could omit that CFI
entirely and expect gdb to recognize the name and/or instruction sequence.
My inclination is to omit the CFI because that's how it is on x86 in the
analogous case. (If in future x86-64 has kernel-supplied trampoline code,
we expect it will be in the form of a vsyscall DSO that supplies CFI via
existing glibc support, as on x86. In that case, the CFI will use the same
sort of hack as the x86 CFI does.) Would that make things better?
Thanks,
Roland
next prev parent reply other threads:[~2004-06-16 23:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-07 1:19 Andrew Cagney
2004-05-07 0:48 ` Roland McGrath
2004-05-07 1:31 ` Daniel Jacobowitz
2004-05-10 21:39 ` Andrew Cagney
2004-05-07 1:19 ` Andrew Cagney
2004-05-07 1:25 ` Daniel Jacobowitz
2004-05-10 21:27 ` Andrew Cagney
2004-05-11 5:15 ` Mark Kettenis
2004-05-11 14:49 ` Andrew Cagney
2004-05-11 14:53 ` Daniel Jacobowitz
[not found] ` <40A0FFB1.8030407@gnu.org>
2004-05-11 17:26 ` Daniel Jacobowitz
2004-05-12 0:28 ` Andrew Cagney
2004-05-15 20:58 ` Mark Kettenis
2004-05-17 17:14 ` Revamp sniffer; Was: " Andrew Cagney
2004-05-25 22:55 ` Andrew Cagney
2004-06-11 17:32 ` Andrew Cagney
2004-06-15 20:17 ` Andrew Cagney
2004-06-16 23:07 ` Roland McGrath [this message]
2004-06-24 18:10 ` Andrew Cagney
2004-06-24 20:59 ` Roland McGrath
2004-06-24 21:20 ` Mark Kettenis
2004-05-17 20:10 ` Andrew Cagney
[not found] ` <20040517131914.332fa347@saguaro>
2004-05-18 5:59 ` Eli Zaretskii
2004-05-18 20:09 ` Andrew Cagney
2004-05-19 5:50 ` Eli Zaretskii
2004-05-19 14:47 ` Andrew Cagney
2004-05-19 21:10 ` Eli Zaretskii
2004-05-20 5:33 ` Eli Zaretskii
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=200406162307.i5GN7NfB025917@magilla.sf.frob.com \
--to=roland@redhat.com \
--cc=cagney@gnu.org \
--cc=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=kettenis@chello.nl \
/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