Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa] delete 'force_return' from lookup_symbol_aux_minsyms
@ 2002-12-05 15:44 David Carlton
  2002-12-09 13:35 ` Elena Zannoni
  0 siblings, 1 reply; 18+ messages in thread
From: David Carlton @ 2002-12-05 15:44 UTC (permalink / raw)
  To: gdb-patches; +Cc: Elena Zannoni, Jim Blandy

This patch is a short one: it deletes the 'force_return' argument of
lookup_symbol_aux_minsyms.  That argument was there because, when the
code in lookup_symbol_aux_minsyms was part of lookup_symbol_aux, the
return statements would sometimes cause lookup_symbol_aux to return a
NULL value without checking the psymtabs first.

I don't think that behavior was either intentional or desirable.
There's not much rhyme or reason to when this happens: in particular,
it doesn't happen every time lookup_symbol_aux_minsyms finds a minsym.
Instead, it is necessary, in addition, either for there to be a symtab at
the appropriate address or for the symtab to be NULL but for the
following test to hold:

          else if (MSYMBOL_TYPE (msymbol) != mst_text
                   && MSYMBOL_TYPE (msymbol) != mst_file_text
                   && !STREQ (name, SYMBOL_NAME (msymbol)))

(I actually experimented with trying to have lookup_symbol _always_
return NULL if a minsym was found without a corresponding symbol, and
that breaks GDB.)  I can't imagine that there are callers of
lookup_symbol that depend on having it return NULL in these particular
circumstances; it's certainly not documented anywhere.  And I suspect
that this issue is what caused the #ifdef HPUXHPPA to be added to
lookup_symbol_aux: as a relevant comment says,

  For HP-generated symbol tables, this check was causing a premature
  exit from lookup_symbol with NULL return, and thus messing up symbol
  lookups of things like "c::f".

When I asked about this issue earlier, Jim Blandy came to more or less
the same conclusion, I think: see
<http://sources.redhat.com/ml/gdb/2002-11/msg00045.html>.

David Carlton
carlton@math.stanford.edu

2002-12-05  David Carlton  <carlton@math.stanford.edu>

	* symtab.c (lookup_symbol_aux): Delete 'force_return' variable.
	(lookup_symbol_aux_minsyms): Delete 'force_return' argument.

Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.81
diff -u -p -r1.81 symtab.c
--- symtab.c	5 Dec 2002 21:26:57 -0000	1.81
+++ symtab.c	5 Dec 2002 22:23:55 -0000
@@ -117,8 +117,7 @@ struct symbol *lookup_symbol_aux_minsyms
 					  const char *mangled_name,
 					  const namespace_enum namespace,
 					  int *is_a_field_of_this,
-					  struct symtab **symtab,
-					  int *force_return);
+					  struct symtab **symtab);
 
 static struct symbol *find_active_alias (struct symbol *sym, CORE_ADDR addr);
 
@@ -805,14 +804,6 @@ lookup_symbol_aux (const char *name, con
   struct symbol *sym;
   const struct block *static_block;
 
-  /* FIXME: carlton/2002-11-05: This variable is here so that
-     lookup_symbol_aux will sometimes return NULL after receiving a
-     NULL return value from lookup_symbol_aux_minsyms, without
-     proceeding on to the partial symtab and static variable tests.  I
-     suspect that that's a bad idea.  */
-  
-  int force_return;
-
   /* Search specified block and its superiors.  Don't search
      STATIC_BLOCK or GLOBAL_BLOCK.  */
 
@@ -931,13 +922,11 @@ lookup_symbol_aux (const char *name, con
      a mangled variable that is stored in one of the minimal symbol tables.
      Eventually, all global symbols might be resolved in this way.  */
 
-  force_return = 0;
-
   sym = lookup_symbol_aux_minsyms (name, mangled_name,
 				   namespace, is_a_field_of_this,
-				   symtab, &force_return);
+				   symtab);
   
-  if (sym != NULL || force_return == 1)
+  if (sym != NULL)
     return sym;
 
 #endif
@@ -981,13 +970,11 @@ lookup_symbol_aux (const char *name, con
    */
 
 
-  force_return = 0;
-
   sym = lookup_symbol_aux_minsyms (name, mangled_name,
 				   namespace, is_a_field_of_this,
-				   symtab, &force_return);
+				   symtab);
   
-  if (sym != NULL || force_return == 1)
+  if (sym != NULL)
     return sym;
 
 #endif
@@ -1172,13 +1159,20 @@ lookup_symbol_aux_psymtabs (int block_in
    tables.  Eventually, all global symbols might be resolved in this
    way.  */
 
+/* NOTE: carlton/2002-12-05: At one point, this function was part of
+   lookup_symbol_aux, and what are now 'return' statements within
+   lookup_symbol_aux_minsyms returned from lookup_symbol_aux, even if
+   sym was NULL.  As far as I can tell, this was basically accidental;
+   it didn't happen every time that msymbol was non-NULL, but only if
+   some additional conditions held as well, and it caused problems
+   with HP-generated symbol tables.  */
+
 static struct symbol *
 lookup_symbol_aux_minsyms (const char *name,
 			   const char *mangled_name,
 			   const namespace_enum namespace,
 			   int *is_a_field_of_this,
-			   struct symtab **symtab,
-			   int *force_return)
+			   struct symtab **symtab)
 {
   struct symbol *sym;
   struct blockvector *bv;
@@ -1271,7 +1265,6 @@ lookup_symbol_aux_minsyms (const char *n
 
 	      if (symtab != NULL && sym != NULL)
 		*symtab = s;
-	      *force_return = 1;
 	      return fixup_symbol_section (sym, s->objfile);
 	    }
 	  else if (MSYMBOL_TYPE (msymbol) != mst_text
@@ -1280,7 +1273,6 @@ lookup_symbol_aux_minsyms (const char *n
 	    {
 	      /* This is a mangled variable, look it up by its
 	         mangled name.  */
-	      *force_return = 1;
 	      return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name,
 					NULL, namespace, is_a_field_of_this,
 					symtab);


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [rfa] delete 'force_return' from lookup_symbol_aux_minsyms
@ 2002-12-21 10:54 Michael Elizabeth Chastain
  2002-12-21 11:59 ` Elena Zannoni
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-21 10:54 UTC (permalink / raw)
  To: carlton, ezannoni; +Cc: gdb-patches, jimb

I'm not following the thread so I'm not sure what patch you're referring
to.  But if you want to give me a URL for a patch, any time this weekend
or the beginning of next week is a good time for testbedding.

It takes roughly 5 hours to test all configurations on one version of
gdb now -- I am not in a position to testbed lots of patches.  The big
time sink is that I test (all gdb) * (all binutils) and there are lots
of each of them.  It's much faster if I run just one test script, but
for a symbol table lookup patch, I want to run the whole suite.

The build time for gcc is increasing even worse than Gate's Law, also.
(Gates' Law: every 18 months, the speed of software halves).

Michael C
Gripe, gripe.


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [rfa] delete 'force_return' from lookup_symbol_aux_minsyms
@ 2002-12-21 22:16 Michael Elizabeth Chastain
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-21 22:16 UTC (permalink / raw)
  To: carlton, ezannoni; +Cc: gdb-patches, jimb

David Carlton writes:
> I committed it yesterday.

Cool, I started another spin for my own purposes this morning.  If the
Perl gods smile on me it will finish tommorow.  I might as well go all
the way and write an analysis report for it.

In my dream world, developers add some "<Test-Request> ... </Test-Request>"
XML mumbo-jumbo to their gdb-patches mail, and 1000 gnutest@home
clients rip through the regression tests.

Michael C


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [rfa] delete 'force_return' from lookup_symbol_aux_minsyms
@ 2002-12-22 16:01 Michael Elizabeth Chastain
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-22 16:01 UTC (permalink / raw)
  To: ezannoni; +Cc: carlton, gdb-patches, jimb

Elena Z wrote:

> I am not sure if David committed it yet, but the patch it at the
> bottom of:
> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00560.html
> Maybe you already tested it!

I am having some problems analyzing this.  I see 3 regressions from
2002-12-18 to 2002-12-21, but I can't tell if they are gcc problems
or gdb problems.

I've got one set of runs with:

  gdb HEAD 2002-12-18
  gcc HEAD 2002-12-18

And another set of runs with:

  gdb HEAD 2002-12-21
  gcc HEAD 2002-12-21

It would be great if I kept the install directories from 2002-12-18
for a few days, but I already recycled the disk space.  :(  I do have
all the executable files from gdb/testsuite though, so I can try the
new gdb on all the executables built with gcc HEAD 2002-12-18.

For the curious, the 3 regressions are:

(1) gcc ICE when compiling gdb.c++/anon-union.exp with gcc HEAD 2002-12-21.
    and dwarf-2.  This is obviously a gcc problem and I will follow the
    gcc reporting procedures for it.  I think the problem is related to
    the special status of C++ "main", which must be return type int,
    but are not required to return a value (the compiler is required to
    synthesize a value if control falls off the end, which is special
    code in gcc, which has problems getting the debug information right).

(2) New problems near the end of gdb.c++/anon-union.exp with gcc HEAD
    and stabs+.  Probably gcc, might be gdb (unlikely).

(3) Problems with gdb.c++/casts.exp.

I'll go do some QA sleuthing and file bug reports and stuff.

Michael C


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [rfa] delete 'force_return' from lookup_symbol_aux_minsyms
@ 2002-12-23  0:46 Michael Elizabeth Chastain
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-23  0:46 UTC (permalink / raw)
  To: ezannoni; +Cc: carlton, gdb-patches, jimb

More news ...

> I am not sure if David committed it yet, but the patch it at the
> bottom of:
> http://sources.redhat.com/ml/gdb-patches/2002-12/msg00560.html
> Maybe you already tested it!

After grubbing around in three unrelated regressions, I can say that
this patch is cool and not causing any visible regressions.  There are
no problems in gdb from 2002-12-18 to 2002-12-21.  gcc broke anonymous
unions though.

Next up is JimB's patch submission for gdb.c++/local.exp.

Michael C


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2002-12-23 16:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-05 15:44 [rfa] delete 'force_return' from lookup_symbol_aux_minsyms David Carlton
2002-12-09 13:35 ` Elena Zannoni
2002-12-10 11:28   ` David Carlton
2002-12-10 11:37     ` Daniel Jacobowitz
2002-12-10 11:56       ` Elena Zannoni
2002-12-19  8:54     ` Elena Zannoni
2002-12-19 11:47       ` David Carlton
2002-12-19 15:39         ` Elena Zannoni
2002-12-19 15:41           ` David Carlton
2002-12-19 16:06             ` Elena Zannoni
2002-12-20 13:02               ` David Carlton
2002-12-21 10:54 Michael Elizabeth Chastain
2002-12-21 11:59 ` Elena Zannoni
2002-12-21 20:20   ` David Carlton
2002-12-23  8:55     ` David Carlton
2002-12-21 22:16 Michael Elizabeth Chastain
2002-12-22 16:01 Michael Elizabeth Chastain
2002-12-23  0:46 Michael Elizabeth Chastain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox