Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@math.stanford.edu>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sources.redhat.com,
	Daniel Jacobowitz <drow@mvista.com>, Jim Blandy <jimb@redhat.com>
Subject: Re: [rfa] tweak sorting of partial symbols
Date: Mon, 24 Feb 2003 18:13:00 -0000	[thread overview]
Message-ID: <ro1u1et1r9w.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <15961.27129.867549.476640@localhost.redhat.com>

On Sun, 23 Feb 2003 19:40:25 -0500, Elena Zannoni <ezannoni@redhat.com> said:

> It seems innocuous enough, and intuitively it makes sense, but can you
> show me a case where it makes a difference? I.e some set of strings
> for which the order would change?

Sure, that's a good question; I should have included such examples
with my original message.

Whitespace example:

Partial symtab contains: "foo<char *>", "goo".

Then, if we try to do a search for "foo<char*>", strcmp will locate
this after "foo<char *>" and before "goo".  Then lookup_partial_symbol
will start looking at strings beginning with "goo", and will never see
the correct match of "foo<char *>".

Parenthesis example:

In practice, this is less like to be an issue, but I'll give it a
shot.  Let's assume that '$' is a legitimate character to occur in
symbols.  (Which may well even be the case on some systems.)  Then say
that the partial symbol table contains "foo$" and "foo(int)".  strcmp
will put them in this order, since '$' < '('.

Now, if the user searches for "foo", then strcmp will sort "foo"
before "foo$".  Then lookup_partial_symbol will notice that
strcmp_iw("foo$", "foo") is false, so it won't proceed to the actual
match of "foo(int)" with "foo".

David Carlton
carlton@math.stanford.edu


  reply	other threads:[~2003-02-24 18:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-22  1:55 David Carlton
2003-02-24  0:36 ` Elena Zannoni
2003-02-24 18:13   ` David Carlton [this message]
2003-02-24 21:36     ` Elena Zannoni
2003-02-24 23:39       ` 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=ro1u1et1r9w.fsf@jackfruit.Stanford.EDU \
    --to=carlton@math.stanford.edu \
    --cc=drow@mvista.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@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