From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2356 invoked by alias); 24 Feb 2003 18:13:14 -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 2349 invoked from network); 24 Feb 2003 18:13:13 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 24 Feb 2003 18:13:13 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h1OICxD18257; Mon, 24 Feb 2003 10:12:59 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Elena Zannoni Cc: gdb-patches@sources.redhat.com, Daniel Jacobowitz , Jim Blandy Subject: Re: [rfa] tweak sorting of partial symbols References: <15961.27129.867549.476640@localhost.redhat.com> From: David Carlton Date: Mon, 24 Feb 2003 18:13:00 -0000 In-Reply-To: <15961.27129.867549.476640@localhost.redhat.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00591.txt.bz2 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". David Carlton carlton@math.stanford.edu