Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa] revert my previous search_symbols change, add comment
@ 2003-02-05  0:24 David Carlton
  2003-02-20 20:43 ` Elena Zannoni
  0 siblings, 1 reply; 3+ messages in thread
From: David Carlton @ 2003-02-05  0:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Elena Zannoni

In my patch from 2002-12-23, I changed some code in search_symbols
from a call to lookup_symbol to a call to lookup_symbol_aux_minsyms.
At that time, I didn't understand exactly what
lookup_symbol_aux_minsyms did; now that I understand that function
better, I don't think that change was a good idea.

So this patch reverts that change.  At Andrew's suggestion, I've added
a comment as well, saying what I'd really like to replace the call to
lookup_symbol with.

In my next patch, I'll change lookup_symbol_aux_minsyms to actually do
something correct (now that Daniel has been kind enough to demangle
partial symbols for me), but I wanted to get this part of the change
out of the way first.

Tested on i686-pc-linux-gnu/GCC3.1/DWARF-2; OK to apply?

David Carlton
carlton@math.stanford.edu

2003-02-04  David Carlton  <carlton@math.stanford.edu>

	* symtab.c (search_symbols): Revert the search_symbols part of my
	2002-12-23 patch.  Add comment.

Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.87
diff -u -p -r1.87 symtab.c
--- symtab.c	4 Feb 2003 18:07:01 -0000	1.87
+++ symtab.c	4 Feb 2003 23:55:02 -0000
@@ -2967,31 +2967,18 @@ search_symbols (char *regexp, namespace_
 	      {
 		if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)))
 		  {
-		    if (kind == FUNCTIONS_NAMESPACE)
-		      {
-			found_misc = 1;
-		      }
-		    else
-		      {
-			struct symbol *sym;
-
-			if (SYMBOL_DEMANGLED_NAME (msymbol) != NULL)
-			  sym
-			    = lookup_symbol_aux_minsyms (SYMBOL_DEMANGLED_NAME
-							 (msymbol),
-							 SYMBOL_NAME (msymbol),
-							 VAR_NAMESPACE,
-							 NULL, NULL);
-			else
-			  sym
-			    = lookup_symbol_aux_minsyms (SYMBOL_NAME (msymbol),
-							 NULL,
-							 VAR_NAMESPACE,
-							 NULL, NULL);
-
-			if (sym == NULL)
-			  found_misc = 1;
-		      }
+		    /* FIXME: carlton/2003-02-04: Given that the
+		       semantics of lookup_symbol keeps on changing
+		       slightly, it would be a nice idea if we had a
+		       function lookup_symbol_minsym that found the
+		       symbol associated to a given minimal symbol (if
+		       any).  */
+		    if (kind == FUNCTIONS_NAMESPACE
+			|| lookup_symbol (SYMBOL_NAME (msymbol),
+					  (struct block *) NULL,
+					  VAR_NAMESPACE,
+					0, (struct symtab **) NULL) == NULL)
+		      found_misc = 1;
 		  }
 	      }
 	  }


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

* Re: [rfa] revert my previous search_symbols change, add comment
  2003-02-05  0:24 [rfa] revert my previous search_symbols change, add comment David Carlton
@ 2003-02-20 20:43 ` Elena Zannoni
  2003-02-20 21:03   ` David Carlton
  0 siblings, 1 reply; 3+ messages in thread
From: Elena Zannoni @ 2003-02-20 20:43 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches, Elena Zannoni

David Carlton writes:
 > In my patch from 2002-12-23, I changed some code in search_symbols
 > from a call to lookup_symbol to a call to lookup_symbol_aux_minsyms.
 > At that time, I didn't understand exactly what
 > lookup_symbol_aux_minsyms did; now that I understand that function
 > better, I don't think that change was a good idea.
 > 
 > So this patch reverts that change.  At Andrew's suggestion, I've added
 > a comment as well, saying what I'd really like to replace the call to
 > lookup_symbol with.

OK

 > 
 > In my next patch, I'll change lookup_symbol_aux_minsyms to actually do
 > something correct (now that Daniel has been kind enough to demangle
 > partial symbols for me), but I wanted to get this part of the change
 > out of the way first.
 >

Question, where does the other patch I just replied to stand wrt to this?
Should we forget about the old patch? 

elena

 
 > Tested on i686-pc-linux-gnu/GCC3.1/DWARF-2; OK to apply?
 > 
 > David Carlton
 > carlton@math.stanford.edu
 > 
 > 2003-02-04  David Carlton  <carlton@math.stanford.edu>
 > 
 > 	* symtab.c (search_symbols): Revert the search_symbols part of my
 > 	2002-12-23 patch.  Add comment.
 > 
 > Index: symtab.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/symtab.c,v
 > retrieving revision 1.87
 > diff -u -p -r1.87 symtab.c
 > --- symtab.c	4 Feb 2003 18:07:01 -0000	1.87
 > +++ symtab.c	4 Feb 2003 23:55:02 -0000
 > @@ -2967,31 +2967,18 @@ search_symbols (char *regexp, namespace_
 >  	      {
 >  		if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)))
 >  		  {
 > -		    if (kind == FUNCTIONS_NAMESPACE)
 > -		      {
 > -			found_misc = 1;
 > -		      }
 > -		    else
 > -		      {
 > -			struct symbol *sym;
 > -
 > -			if (SYMBOL_DEMANGLED_NAME (msymbol) != NULL)
 > -			  sym
 > -			    = lookup_symbol_aux_minsyms (SYMBOL_DEMANGLED_NAME
 > -							 (msymbol),
 > -							 SYMBOL_NAME (msymbol),
 > -							 VAR_NAMESPACE,
 > -							 NULL, NULL);
 > -			else
 > -			  sym
 > -			    = lookup_symbol_aux_minsyms (SYMBOL_NAME (msymbol),
 > -							 NULL,
 > -							 VAR_NAMESPACE,
 > -							 NULL, NULL);
 > -
 > -			if (sym == NULL)
 > -			  found_misc = 1;
 > -		      }
 > +		    /* FIXME: carlton/2003-02-04: Given that the
 > +		       semantics of lookup_symbol keeps on changing
 > +		       slightly, it would be a nice idea if we had a
 > +		       function lookup_symbol_minsym that found the
 > +		       symbol associated to a given minimal symbol (if
 > +		       any).  */
 > +		    if (kind == FUNCTIONS_NAMESPACE
 > +			|| lookup_symbol (SYMBOL_NAME (msymbol),
 > +					  (struct block *) NULL,
 > +					  VAR_NAMESPACE,
 > +					0, (struct symtab **) NULL) == NULL)
 > +		      found_misc = 1;
 >  		  }
 >  	      }
 >  	  }


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

* Re: [rfa] revert my previous search_symbols change, add comment
  2003-02-20 20:43 ` Elena Zannoni
@ 2003-02-20 21:03   ` David Carlton
  0 siblings, 0 replies; 3+ messages in thread
From: David Carlton @ 2003-02-20 21:03 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

On Thu, 20 Feb 2003 15:47:20 -0500, Elena Zannoni <ezannoni@redhat.com> said:
> David Carlton writes:

>> In my patch from 2002-12-23, I changed some code in search_symbols
>> from a call to lookup_symbol to a call to lookup_symbol_aux_minsyms.
>> At that time, I didn't understand exactly what
>> lookup_symbol_aux_minsyms did; now that I understand that function
>> better, I don't think that change was a good idea.
>> 
>> So this patch reverts that change.  At Andrew's suggestion, I've added
>> a comment as well, saying what I'd really like to replace the call to
>> lookup_symbol with.

> OK

Thanks; I'll commit it in a sec.

>> In my next patch, I'll change lookup_symbol_aux_minsyms to actually do
>> something correct (now that Daniel has been kind enough to demangle
>> partial symbols for me), but I wanted to get this part of the change
>> out of the way first.
>> 

> Question, where does the other patch I just replied to stand wrt to this?
> Should we forget about the old patch? 

Crossing e-mails; by now, you've gotten the e-mail where I explain
that, or will in a sec.

David Carlton
carlton@math.stanford.edu


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

end of thread, other threads:[~2003-02-20 21:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-05  0:24 [rfa] revert my previous search_symbols change, add comment David Carlton
2003-02-20 20:43 ` Elena Zannoni
2003-02-20 21:03   ` David Carlton

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