From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5579 invoked by alias); 5 Nov 2002 01:25:47 -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 5572 invoked from network); 5 Nov 2002 01:25:45 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 5 Nov 2002 01:25:45 -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 gA513Iw21551 for ; Mon, 4 Nov 2002 20:03:18 -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 gA51Pjf20358 for ; Mon, 4 Nov 2002 20:25:45 -0500 Received: from localhost.redhat.com (IDENT:zXda+KZayQUbBL/WuXjiY2bcrWFiEuYe@tooth.toronto.redhat.com [172.16.14.29]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gA51PfT23224; Mon, 4 Nov 2002 20:25:42 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id C1E22FF79; Mon, 4 Nov 2002 20:21:32 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15815.7452.182072.127565@localhost.redhat.com> Date: Mon, 04 Nov 2002 17:25:00 -0000 To: David Carlton Cc: Elena Zannoni , gdb-patches@sources.redhat.com, Jim Blandy Subject: Re: [rfa] clean up lookup_symbol_aux In-Reply-To: References: <15813.47315.184918.420735@localhost.redhat.com> X-SW-Source: 2002-11/txt/msg00037.txt.bz2 David Carlton writes: > On Sun, 3 Nov 2002 19:01:23 -0500, Elena Zannoni said: > > David Carlton writes: > >> On 02 Oct 2002 14:50:34 -0700, David Carlton > >> said: > > >> > * The part of lookup_symbol_aux that never gets run and that is > >> > prefaced by 17 lines of comments being bemused at its existence > >> > has been deleted. > > > Could it be if deffed 0 for a bit, to see if we get some weird > > behaviors? We can delete it later. Make sure you add a comment with > > a date. > > Sure, I can do that. Having said that, I don't really think this is > necessary: it's pretty clear that the code isn't being run; it's > prefaced by multiple comments that point out that it isn't being run, > that can't figure out what the code is supposed to do, and that are, I > think, a few years old (the more recent one seems to date from the HP > merge). So ifdeffing it out won't change the behavior of GDB at all, > it'll just preserve another one of GDB's mysteries for that much > longer. But ifdeffing it won't hurt anything, either, so I can > certainly do it if you'd be happier. > Yes, please. It wouldn't be the first time that weird things happen because of apparently insignificant changes. (see the old proverbial wait_for_inferior). > >> > * The two cases for searching minimal symbols (i.e. whether or not > >> > you're in HPUXHPPA) turned out to be slightly different. I went > >> > through those differences and picked whichever variant seemed to > >> > me to be better; as far as I can tell, there's no reason for the > >> > code to differ in the two cases. I also threw in a bug fix: > >> > fixup_symbol_section had the wrong second argument in the variant > >> > where it was present. > > > This one I am a bit worried about. For the bugfix, I would prefer > > that a separate patch is submitted, I cannot spot the fix in the > > patch. > > Yeah, I probably should have done that first. I'll include a patch > just for that after my signature; the point of the patch is that the > minsym code refers to 'block' and 'objfile', but those variables don't > actually point at anything useful in the minsym code. (They're > pointing at whatever they happened to point at at the end of the > symtab search.) So the patch replaces 'objfile' by something correct, Right. s->objfile will have 's' always non-null. > and replaces 'block' by NULL. (There are other possible bugfixes, but > they would all result from situations where the HP and non-HP > currently do different things: those can wait.) > Ah yes, these two would be in the 'else' which is taken if s == NULL and block is not going to be assigned to. > > I would check in the functions except the minsyms one, ifdeffing the > > code that was deleted. Separately submit a patch for the bugfix, and > > one just for the minsyms changes so that it can be tested > > independentely. > > Great, I'll do that. If you can look at the bugfix one first, I'd > appreciate it, because I don't want to move out the > local/symtab/psymtab stuff before having that bugfix patch accepted. > (If the bugfix patch isn't accepted, moving out the other parts of the > code might lead to bizarre consequences.) > Ok approved. Good catch. Elena > David Carlton > carlton@math.stanford.edu > > 2002-11-04 David Carlton > > * symtab.c (lookup_symbol_aux): In minsym sections, don't use the > previous values of 'objfile' and 'block'. > > Index: symtab.c > =================================================================== > RCS file: /cvs/src/src/gdb/symtab.c,v > retrieving revision 1.75 > diff -u -p -r1.75 symtab.c > --- symtab.c 28 Oct 2002 17:05:56 -0000 1.75 > +++ symtab.c 4 Nov 2002 23:59:05 -0000 > @@ -929,7 +929,7 @@ lookup_symbol_aux (const char *name, con > > if (symtab != NULL) > *symtab = s; > - return fixup_symbol_section (sym, objfile); > + return fixup_symbol_section (sym, s->objfile); > } > else if (MSYMBOL_TYPE (msymbol) != mst_text > && MSYMBOL_TYPE (msymbol) != mst_file_text > @@ -937,7 +937,7 @@ lookup_symbol_aux (const char *name, con > { > /* This is a mangled variable, look it up by its > mangled name. */ > - return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name, block, > + return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name, NULL, > namespace, is_a_field_of_this, symtab); > } > /* There are no debug symbols for this file, or we are looking > @@ -1120,7 +1120,7 @@ lookup_symbol_aux (const char *name, con > && !STREQ (name, SYMBOL_NAME (msymbol))) > { > return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name, > - block, namespace, is_a_field_of_this, > + NULL, namespace, is_a_field_of_this, > symtab); > } > }