From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22075 invoked by alias); 14 Feb 2006 17:47:48 -0000 Received: (qmail 22063 invoked by uid 22791); 14 Feb 2006 17:47:47 -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; Tue, 14 Feb 2006 17:47:45 +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 k1EHlAHV027197; Tue, 14 Feb 2006 18:47:10 +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 k1EHl9xh010371; Tue, 14 Feb 2006 18:47:09 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id k1EHl93X028377; Tue, 14 Feb 2006 18:47:09 +0100 (CET) Date: Tue, 14 Feb 2006 17:47:00 -0000 Message-Id: <200602141747.k1EHl93X028377@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: mark.kettenis@xs4all.nl, f.hackenberger@chello.at, gdb@sourceware.org In-reply-to: <20060214173107.GA27548@nevyn.them.org> (message from Daniel Jacobowitz on Tue, 14 Feb 2006 12:31:07 -0500) Subject: Re: breakpoints in shared libraries References: <200602141729.09355.f.hackenberger@chello.at> <20060214170031.GA26297@nevyn.them.org> <200602141721.k1EHL7R0015198@elgar.sibelius.xs4all.nl> <20060214173107.GA27548@nevyn.them.org> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00139.txt.bz2 > Date: Tue, 14 Feb 2006 12:31:07 -0500 > From: Daniel Jacobowitz > > 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: > > ::= 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