From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23453 invoked by alias); 12 Feb 2010 11:37:14 -0000 Received: (qmail 23440 invoked by uid 22791); 12 Feb 2010 11:37:13 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Feb 2010 11:37:09 +0000 Received: (qmail 10690 invoked from network); 12 Feb 2010 11:37:07 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Feb 2010 11:37:07 -0000 From: Pedro Alves To: Joel Brobecker Subject: Re: [gdb-7.1] 10 days to branching... Date: Fri, 12 Feb 2010 11:37:00 -0000 User-Agent: KMail/1.9.10 Cc: Tom Tromey , gdb@sourceware.org, Kai Tietz , Chris Sutcliffe References: <20100201081928.GA9204@adacore.com> <20100212051007.GI2919@adacore.com> <20100212061558.GA6205@adacore.com> In-Reply-To: <20100212061558.GA6205@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201002121137.05102.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00090.txt.bz2 Thanks for taking care of this. On Friday 12 February 2010 06:15:58, Joel Brobecker wrote: > > | sym_arr[i1] = lookup_symbol_in_language (phys_name, > > | NULL, FUNCTIONS_DOMAIN, > > | language, > > | (int *) NULL); > > | - if (sym_arr[i1]) > > | + /* See PR10966. Remove check on symbol domain and class when > > | + we stop using (bad) linkage names on constructors. */ > > | + if (sym_arr[i1] && (SYMBOL_DOMAIN (sym_arr[i1]) == VAR_DOMAIN > > | + && SYMBOL_CLASS (sym_arr[i1]) == LOC_BLOCK)) > > | i1++; > > Tested with no regression on my end. Regarding my C++ compiler quality, > I looked at gdb.sum, and I have 32 KFAILs and 20 FAILs in gdb.cp. > However, upon further testing, it appears that the patches does not > have the desired effect (or I applied it at the wrong location?): > > (gdb) b Foo::Foo > the class Foo does not have any method named Foo > Hint: try 'Foo::Foo or 'Foo::Foo > (Note leading single quote.) > Make breakpoint pending on future shared library load? (y or [n]) n > This is what I'd expect. In previous GDBs, if there's only one contructor, like, say: struct Foo { Foo() {} }; Foo foo; int main (int argc, char **argv) { return 0; } GDB would just do nothing in response to that command. (gdb) b Foo::Foo (gdb) If you had multiple constructors, say: struct Foo { Foo() {} Foo(const char *foo) {} }; Foo foo; Foo bar("bar"); int main (int argc, char **argv) { return 0; } GDB would create broken breakpoints for them at address 0... (gdb) b Foo::Foo [0] cancel [1] all ?HERE ?HERE > "?HERE" was never supposed to be visible to the user, and should have been replaced by the proper name for the function (the constructors), but since GDB found the wrong symbol... > 1 Breakpoint 2 at 0x0 Breakpoint 3 at 0x0 warning: Multiple breakpoints were set. Use the "delete" command to delete unwanted breakpoints. (gdb) info breakpoints Num Type Disp Enb Address What 2 breakpoint keep y 0x0000000000000000 3 breakpoint keep y 0x0000000000000000 Not very useful either. That happens is that the wrong symbols are found, and a broken sal escapes to the breakpoints module. Nowadays, there's an assertion that catches this (without the assertion, we'd crash instead). Note that even with the workaround, this still works: (gdb) b 'Foo::Foo()' Breakpoint 2 at 0x8048455: file foo.cc, line 3. (gdb) b 'Foo::Foo(const char *)' Breakpoint 3 at 0x804845b: file foo.cc, line 5. It's the Foo::Foo form that's been broken for ages: (gdb) p Foo::Foo Cannot look up value of a typedef I just tried GDB 5.3 and 6.0, and they seem to get it right though, so this was a regression at some point. :-) -- Pedro Alves