From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: drow@false.org
Cc: mark.kettenis@xs4all.nl, f.hackenberger@chello.at, gdb@sourceware.org
Subject: Re: breakpoints in shared libraries
Date: Tue, 14 Feb 2006 17:47:00 -0000 [thread overview]
Message-ID: <200602141747.k1EHl93X028377@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <20060214173107.GA27548@nevyn.them.org> (message from Daniel Jacobowitz on Tue, 14 Feb 2006 12:31:07 -0500)
> Date: Tue, 14 Feb 2006 12:31:07 -0500
> From: Daniel Jacobowitz <drow@false.org>
>
> Take a look at the "Itanium C++ ABI", which has some Itanium-specific
> language in it but is actually widely adopted for non-Itanium platforms
> by multiple compilers, GNU and otherwise. Here it is:
>
> http://www.codesourcery.com/cxx-abi/abi.html
>
> It's got this to say about constructors:
>
> <ctor-dtor-name> ::= C1 # complete object constructor
> ::= C2 # base object constructor
> ::= C3 # complete object allocating constructor
> ::= D0 # deleting destructor
> ::= D1 # complete object destructor
> ::= D2 # base object destructor
>
> The relevant section is 2.6. When constructing a virtual base class,
> the C2 constructor is called instead of the C1 constructor.
>
> Now, in theory, a compiler can generate one of these as a tiny
> trampoline that jumps to the other, and only emit debug information for
> the real one, and things will work. But GCC doesn't do this and
> attempts to get it to do so have, so far, met with failure. So there's
> two functions for every single constructor, and GDB tends to breakpoint
> one of them more or less at random.
>
> I maintain that the two right things to do here are (A) fix GCC to
> support functions with multiple entry points, or at least something
> that can give a good impression of it, and (B) set breakpoints by
> function name or line number at all copies.
>
> An astute observer will notice that both (A) and (B) are hard :-)
> I've been working on (B) as I can find the time, and some cleanups
> for it have already been done, and I posted an early prototype.
> But I never got back to it. The Ada folks expressed some interested,
> and I think Fred did too, but so far nothing's come of it.
Thanks for the explanation Daniel. The complexity of C++ continues to
amaze me.
Mark
next prev parent reply other threads:[~2006-02-14 17:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 16:29 Florian Hackenberger
2006-02-14 17:00 ` Daniel Jacobowitz
2006-02-14 17:10 ` Florian Hackenberger
2006-02-14 17:13 ` Daniel Jacobowitz
2006-02-14 17:52 ` Paul Koning
2006-02-14 18:00 ` Florian Hackenberger
2006-02-14 17:21 ` Mark Kettenis
2006-02-14 17:23 ` Bob Rossi
2006-02-14 17:31 ` Daniel Jacobowitz
2006-02-14 17:47 ` Mark Kettenis [this message]
2006-02-14 17:08 ` Mark Kettenis
2006-02-14 17:20 ` Florian Hackenberger
-- strict thread matches above, loose matches on Subject: below --
2001-11-13 9:05 Tom Tromey
2001-11-13 9:41 ` Daniel Jacobowitz
2001-11-13 10:11 ` Tom Tromey
2001-11-13 10:20 ` Per Bothner
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=200602141747.k1EHl93X028377@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=drow@false.org \
--cc=f.hackenberger@chello.at \
--cc=gdb@sourceware.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