Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [ppc64-linux]: skip linkage functions
Date: Fri, 06 Jun 2003 21:40:00 -0000	[thread overview]
Message-ID: <20030606214003.GA11393@nevyn.them.org> (raw)
In-Reply-To: <vt2n0gvvtfl.fsf@zenia.home>

On Fri, Jun 06, 2003 at 03:31:58PM -0500, Jim Blandy wrote:
> Daniel Jacobowitz <drow@mvista.com> writes:
> 
> > On Fri, Jun 06, 2003 at 03:10:09PM -0500, Jim Blandy wrote:
> > > Daniel Jacobowitz <drow@mvista.com> writes:
> > > 
> > > > On Fri, Jun 06, 2003 at 01:22:27AM -0500, Jim Blandy wrote:
> > > > > Daniel Jacobowitz <drow@mvista.com> writes:
> > > > > 
> > > > > > On Thu, Jun 05, 2003 at 06:54:57PM -0500, Jim Blandy wrote:
> > > > > > > 
> > > > > > > 2003-06-05  Jim Blandy  <jimb@redhat.com>
> > > > > > > 
> > > > > > > 	Recognize and skip 64-bit PowerPC Linux linkage functions.
> > > > > > > 	* ppc-linux-tdep.c (insn_d, insn_ds, insn_xfx, read_insn, struct
> > > > > > > 	insn_pattern, insns_match_pattern, d_field, ds_field): New
> > > > > > > 	functions, macros, and types for working with PPC instructions.
> > > > > > > 	(ppc64_standard_linkage, PPC64_STANDARD_LINKAGE_LEN,
> > > > > > > 	ppc64_in_solib_call_trampoline, ppc64_standard_linkage_target,
> > > > > > > 	ppc64_skip_trampoline_code): New functions, variables, and macros
> > > > > > > 	for recognizing and skipping linkage functions.
> > > > > > > 	(ppc_linux_init_abi): Use ppc64_in_solib_call_trampoline and
> > > > > > > 	ppc64_skip_trampoline_code for the 64-bit PowerPC Linux ABI.
> > > > > > 
> > > > > > Hmm.  Probably not good enough for our needs, but is the
> > > > > > DW_AT_trampoline attribute useful here?
> > > > > 
> > > > > I'll say it, so nobody else has to feel bad saying it: that patch is
> > > > > complete shite.  I just can't see any other way to do it with the info
> > > > > I have.
> > > > > 
> > > > > DW_AT_trampoline would allow me to implement in_solib_call_trampoline
> > > > > and skip_trampoline_code simply by consulting the debugging info,
> > > > > which would be eons better.  And in generic code, to boot.  The only
> > > > > thing is, the trampolines are generated by the linker, not the
> > > > > compiler.  Could the linker contribute its own Dwarf compilation unit
> > > > > to .debug_info and .debug_abbrev?  How should it decide which
> > > > > debugging format to use, and whether to emit anything at all?
> > > > > 
> > > > > If we could get this working, we could start using it on other
> > > > > architectures, too.
> > > > 
> > > > Hmm.  I believe it could be done.  It would probably require adding
> > > > a --gdwarf2 to the linker, matching the one added to GAS.  It's
> > > > certainly practical for the linker to add a CU.
> > > > 
> > > > As always, it wouldn't free us from the need to grub through assembly
> > > > trampolines by hand.  There's always something without debug info.  But
> > > > it would make that code a little less important...
> > > 
> > > I haven't been living with CFI long enough to know how these stories
> > > turn out, but my gut feeling is that replacing these heuristic
> > > techniques like prologue unwinding with real debug info has got to be
> > > the Right Thing.
> > 
> > The only problem is that DW_AT_trampoline doesn't live in the CFI - it
> > lives in the .debug_info section with the full debug info.  Some
> > architectures are moving to always providing CFI, but debug info is
> > more than we can count on.
> 
> Oh, I know where DW_AT_trampoline lives.  I was referring to the
> general trend of providing debug info for stuff GDB previously had to
> guess about, e.g., CFI and location lists replacing prologue analysis.
> You can never really get rid of the old heuristics, but since they
> won't be used every day any more, they're going to bit-rot.  Even if
> we included actual binaries in the test suite to make sure the
> prologue analyzers continued to recognize what we'd once taught them,
> compilers will continue to change the prologues they emit.  In the
> end, if it rots badly enough, is it worth keeping it at all?
> 
> > What blows up if we don't recognize the trampolines though?
> 
> On the PPC64, 'next' blows up.

Oh, I hit this problem on another platform recently.  And I had to do a
similar hack for trampolines.

It seems that there shold be a simpler solution than trying to parse
the trampoline...

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2003-06-06 21:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-05 23:54 Jim Blandy
2003-06-06  0:03 ` Daniel Jacobowitz
2003-06-06  6:22   ` Jim Blandy
2003-06-06 13:11     ` Daniel Jacobowitz
2003-06-06 20:09       ` Jim Blandy
2003-06-06 20:17         ` Daniel Jacobowitz
2003-06-06 20:31           ` Jim Blandy
2003-06-06 21:40             ` Daniel Jacobowitz [this message]
2003-06-06 22:47               ` Jim Blandy
2003-06-10  0:05 ` Kevin Buettner
2003-06-10 17:29   ` Jim Blandy

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=20030606214003.GA11393@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.com \
    /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