Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: David Carlton <carlton@kealia.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa] partial fix for PR gdb/1245
Date: Sun, 29 Jun 2003 21:06:00 -0000	[thread overview]
Message-ID: <20030629210642.GA11680@nevyn.them.org> (raw)
In-Reply-To: <m3y8zp3cpu.fsf@coconut.kealia.com>

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


  reply	other threads:[~2003-06-29 21:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-26  1:04 David Carlton
2003-06-29 21:06 ` Daniel Jacobowitz [this message]
2003-06-29 21:54   ` Andrew Cagney
2003-06-30 16:25   ` David Carlton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030629210642.GA11680@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=carlton@kealia.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox