From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13574 invoked by alias); 29 Apr 2003 20:45:31 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13553 invoked from network); 29 Apr 2003 20:45:31 -0000 Received: from unknown (HELO cygnus.equallogic.com) (65.170.102.10) by sources.redhat.com with SMTP; 29 Apr 2003 20:45:30 -0000 Received: from cygnus.equallogic.com (localhost.localdomain [127.0.0.1]) by cygnus.equallogic.com (8.11.6/8.11.6) with ESMTP id h3TKjUt13360 for ; Tue, 29 Apr 2003 16:45:30 -0400 Received: from deneb.dev.equallogic.com (deneb.dev.equallogic.com [172.16.1.99]) by cygnus.equallogic.com (8.11.6/8.11.6) with ESMTP id h3TKjTr13348; Tue, 29 Apr 2003 16:45:29 -0400 Received: from pkoning.dev.equallogic.com.equallogic.com (localhost.localdomain [127.0.0.1]) by deneb.dev.equallogic.com (8.11.6/8.11.6) with ESMTP id h3TKjTg19254; Tue, 29 Apr 2003 16:45:29 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16046.58450.847887.962016@pkoning.dev.equallogic.com> Date: Tue, 29 Apr 2003 20:45:00 -0000 From: Paul Koning To: drow@mvista.com Cc: carlton@bactrian.org, gdb@sources.redhat.com Subject: Re: breakpoints in constructors References: <20030424145034.GA14226@nevyn.them.org> X-SW-Source: 2003-04/txt/msg00336.txt.bz2 >>>>> "Daniel" == Daniel Jacobowitz writes: Daniel> On Fri, Apr 18, 2003 at 01:04:46PM -0700, David Carlton Daniel> wrote: >> I might have some time over the next few weeks (/months) to work >> on the "breakpoints in constructors" issue. Daniel: clearly >> you've thought about this already, so if you happen to have time >> to do a bit of a brain dump on the issue at some point, I'd >> appreciate it. Daniel> Sure. First of all, a rough overview of the problem; might Daniel> as well keep everything in one place. Daniel> With the new GCC 3.x multi-vendor C++ ABI, constructors are Daniel> implemented as multiple functions: C1, the complete object Daniel> constructor [in-charge] C2, the base object constructor Daniel> [not-in-charge] C3, the allocating constructor [not currently Daniel> used] Daniel> Similarly for destructors - most of the rest of this message Daniel> applies to destructors too. The base constructor is Daniel> generally called for the base objects of a derived class, Daniel> esp. with virtual inheritance; it's been a while since I Daniel> looked at exactly when. Daniel> GCC has chosen to implement this by duplicating the function, Daniel> including any user-provided code and any compiler-added code. Daniel> A better implementation would have one copy and labels for Daniel> multiple entry points, on systems where that is supported; Daniel> that's temporarily tabled pending a better description of the Daniel> GCC tree structure to describe multiple entry points. I looked at a few examples to see how they differ. Didn't see any where the two constructors that gcc generates differ at all. Ditto for the two (in charge vs. not in charge) destructors. The "deleting" constructor does what the name suggests, it frees the item at the end. Since the difference is at the end, that doesn't sound like a case where multiple entry points can help. Couldn't one constructor/destructor call another, so that there one "bottom level" constructor or destructor where all three variants eventually end up? Then that would be the one you'd want to match when you set a breakpoint by name or by line. The only drawback I can see is that you'd see an extraneous frame in the callstack. paul