From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7097 invoked by alias); 29 Jun 2003 21:06:57 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7085 invoked from network); 29 Jun 2003 21:06:56 -0000 Received: from unknown (HELO crack.them.org) (146.82.138.56) by sources.redhat.com with SMTP; 29 Jun 2003 21:06:56 -0000 Received: from dsl093-172-017.pit1.dsl.speakeasy.net ([66.93.172.17] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 19WjOn-00042F-00; Sun, 29 Jun 2003 16:07:49 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19WjNj-00033G-00; Sun, 29 Jun 2003 17:06:43 -0400 Date: Sun, 29 Jun 2003 21:06:00 -0000 From: Daniel Jacobowitz To: David Carlton Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa] partial fix for PR gdb/1245 Message-ID: <20030629210642.GA11680@nevyn.them.org> Mail-Followup-To: David Carlton , gdb-patches@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2003-06/txt/msg00870.txt.bz2 On Wed, Jun 25, 2003 at 05:27:09PM -0700, David Carlton wrote: > Here's a partial fix for PR gdb/1245, the one about an assertion > failure coming from a demangled name like "int operator<". The > best fix there would be to fix the demangler to put a space betwen the > two <'s, but given that this is the second time we've run into that > assertion failure, it's probably best to change it into a complaint, > because demangled name weirdness really shouldn't leave GDB in an > unusable state. > > So that's what this patch does. It ensures that components found by > cp_find_first_component either end in a colon or are the entire > string. If something else happens, it complains and returns the > entire string. > > With this change to the function, some other gdb_asserts (e.g. the one > in cp_entire_prefix_len) become necessary. I'm ambivalent about > removing correct assertions; I'm happy to either do so or not in this > case, depending on how you see fit. > > The next question is: do we want to go any further with a fix for PR > gdb/1245? On the one hand, the demangler's output really is > incorrect. On the other hand, even if we fix the demangler's output, > GDB will never do anything useful with the output in this particular > situation, I think: it only occurs in the context of templated > functions, and the fact that their demangled names include the return > value means that the prefixes that we get from them aren't correct in > the first place. Being a lazy person who has never submitted a patch > to libiberty, I'm inclined to put a real fix for this issue on the > back burner. > > Tested on GCC 3.2, DWARF 2, i686-pc-linux-gnu; no new regressions. OK > to commit on mainline and branch? Yes, this is OK as a bandaid. As I explained in the PR, we can correctly handle this, but not asserting is good enough for the moment. If you fix the two style nits, you can check this in: > +unsigned int cp_find_first_component (const char *name) Line break there. > case ')': > + if (permissive) > + { > + return index; > + } Please drop the useless pair of braces. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer