From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21625 invoked by alias); 17 Jul 2004 10:30:34 -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 21606 invoked from network); 17 Jul 2004 10:30:33 -0000 Received: from unknown (HELO aragorn.inter.net.il) (192.114.186.23) by sourceware.org with SMTP; 17 Jul 2004 10:30:33 -0000 Received: from zaretski ([80.230.154.144]) by aragorn.inter.net.il (MOS 3.4.6-GR) with ESMTP id DUH86409; Sat, 17 Jul 2004 13:29:58 +0300 (IDT) Date: Sat, 17 Jul 2004 14:30:00 -0000 From: "Eli Zaretskii" To: mec.gnu@mindspring.com (Michael Elizabeth Chastain) Message-Id: <5567-Sat17Jul2004132833+0300-eliz@gnu.org> CC: drow@false.org, gdb@sources.redhat.com, rolandz@poczta.fm In-reply-to: <20040716193117.EFE514B104@berman.michael-chastain.com> (mec.gnu@mindspring.com) Subject: Re: How to setup a breakpoint on constructor Reply-to: Eli Zaretskii References: <20040716193117.EFE514B104@berman.michael-chastain.com> X-SW-Source: 2004-07/txt/msg00223.txt.bz2 > Date: Fri, 16 Jul 2004 15:31:17 -0400 (EDT) > From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) > > To take the points in reverse order, > > > (B) It exposes the difference between complete and base constructors, > > which is an implementation detail of the C++ ABI that most users don't > > understand. > > That is reality. Yes. > The reality is that g++ emits two functions in the object code. In > my opinion, if we try to gloss over that, then we'll just create > more confusion for commands such as 'disassemble' and 'tbreak'. We could perhaps help users who are oblivious to this (or just forgot) by showing them the possible places where GDB could put the breakpoint, including the more self-explaining names, and asking them what to do. For example: (gdb) break 'A::A()' The constructor 'A::A()' has two code instances: Address Mangled Name Name Description 08048544 _ZN1AC1Ev A::A()$base() Base constructor for A 080486e2 _ZN1AC2Ev A::A()$allocate() Allocating constructor for A Where do you want to put your breakpoint? Type `1' for the first instance, `2' for the second, `A' for all of them: 1 <==== user response Breakpoint 1 at 0x8048544: file derivation.cc, line 7.