From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27241 invoked by alias); 24 Feb 2003 21:36:20 -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 27234 invoked from network); 24 Feb 2003 21:36:20 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 24 Feb 2003 21:36:20 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h1OLaJe04938 for ; Mon, 24 Feb 2003 16:36:19 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h1OLaJq14767 for ; Mon, 24 Feb 2003 16:36:19 -0500 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h1OLaHI11601; Mon, 24 Feb 2003 16:36:17 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id 4A4AEFF79; Mon, 24 Feb 2003 16:40:22 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15962.37190.175867.404806@localhost.redhat.com> Date: Mon, 24 Feb 2003 21:36:00 -0000 To: David Carlton Cc: Elena Zannoni , gdb-patches@sources.redhat.com, Daniel Jacobowitz , Jim Blandy Subject: Re: [rfa] tweak sorting of partial symbols In-Reply-To: References: <15961.27129.867549.476640@localhost.redhat.com> X-SW-Source: 2003-02/txt/msg00606.txt.bz2 David Carlton writes: > On Sun, 23 Feb 2003 19:40:25 -0500, Elena Zannoni 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", "goo". > > Then, if we try to do a search for "foo", strcmp will locate > this after "foo" and before "goo". Then lookup_partial_symbol > will start looking at strings beginning with "goo", and will never see > the correct match of "foo". > > 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". Ah, yes. I was trying with some dumber examples, like foo, foo(int). Ok, approved, but could you find a place to put some of the examples above in comments? elena > > David Carlton > carlton@math.stanford.edu