This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa] partial fix for PR gdb/1245


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<<foo>".  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]