This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] bug in symtab.c:lookup_block_symbol()'s search method


Jason Molenda writes:
 > 
 > 
 > This patch fixes a bug introduced in October, 2000.  Discussion and
 > history
 > are here:
 > 	http://sources.redhat.com/ml/gdb-patches/2001-09/msg00076.html
 > 
 > Analysis of performance impact is here:
 > 	http://sources.redhat.com/ml/gdb-patches/2001-09/msg00084.html
 > 
 > This patch should be approved for both the mainline and the 5.1 branch.
 > It adds no new testsuite failures.
 > 

After pondering on this for a while and discussing it with others in
the gdb group, I am inclined to accept this patch into the main line
but not 5.1.

The possibility that there is an identifier that start with a
isspace() char is quite remote. And as Jason points out the rest
of the code in the function wouldn't be able to deal with it either.

Jason, if you can check this in, please go ahead.

Looking at this function I also noticed an outdated comment. Will fix
in a follow up patch.

Elena

 > Jason
 > 
 > 2001-09-07  Jason Molenda  (jmolenda@apple.com)
 > 
 >         * symtab.c (lookup_block_symbol):  Break out of linear search
 >         if we're past the range of possible matches.
 > 
 > Index: symtab.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/symtab.c,v
 > retrieving revision 1.42
 > diff -u -p -r1.42 symtab.c
 > --- symtab.c	2001/07/07 17:19:50	1.42
 > +++ symtab.c	2001/09/09 14:17:25
 > @@ -1249,6 +1249,10 @@ lookup_block_symbol (register const stru
 >  	    {
 >  	      return sym;
 >  	    }
 > +          if (SYMBOL_SOURCE_NAME (sym)[0] > name[0])
 > +            {
 > +              break;
 > +            }
 >  	  bot++;
 >  	}
 >      }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]