From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10607 invoked by alias); 4 Dec 2001 09:09:20 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10569 invoked from network); 4 Dec 2001 09:09:18 -0000 Received: from unknown (HELO duracef.shout.net) (204.253.184.12) by sources.redhat.com with SMTP; 4 Dec 2001 09:09:18 -0000 Received: (from mec@localhost) by duracef.shout.net (8.8.7/8.8.7) id DAA30310; Tue, 4 Dec 2001 03:09:17 -0600 Date: Tue, 04 Dec 2001 01:09:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200112040909.DAA30310@duracef.shout.net> To: gdb-patches@sources.redhat.com, jason@redhat.com Subject: Re: [RFA/stabs reader] Fix v3 duplicate constructors problem Cc: gcc@gcc.gnu.org X-SW-Source: 2001-12/txt/msg00113.txt.bz2 Jason Merrill writes: > The thing is, we want the debugger to treat them as the same function, so > that setting a breakpoint on the signature actually sets one on each and > the like. I for one do not want that to happen at all! There really are two bodies of code in the target program code. The compiler emits two bodies of code; the linker recognizes two bodies of code with different names. Consider this code: class C1 { public: C1::C1(); }; C1::C1 () { foo(); bar(); bletch(); } Suppose the user sets a breakpoint in foo(), looks at the stack, and sees the name C1::C1(). They decide they want to read the machine language instructions for the constructor, so they type "disass C1::C1". What do you want gdb to do? I would like gdb to demangle different names differently. Perhaps: (gdb) ptype C1 ... C1::C1 ... ... C1::C1$base ... ... where the first line is for the in-charge constructor, and the second line is for the not-in-charge constructor. Then the user can disassemble, breakpoint, and call whichever function they want (they better know what they are doing if they call a not-in-charge constructor by hand though). If they don't know what C1::C1$base is, they can read a document, where they can learn that each constructor and destructor in the source code is compiled to multiple object functions in the object code, with different interfaces and purposes. As to how this relates onto symbol handling, I don't know. I just know that I want names that reflect reality in ptype, disassmble, break, and backtrace. Michael C