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]
Other format: [Raw text]

[dictionary] commit for 2003-03-05


Here's today's commits.  The main activity for today was auditing uses
of lookup_minimal_symbol; after doing that, it seems pretty clear that
most uses only want to match on linkage name but that there are some
uses that want to match either on linkage names or on natural names.
(But I don't see anybody who wants to only match on natural names.)
So this reorganizes the code to reflect that; now it provides
lookup_minimal_symbol (which only searches on linkage names) and
lookup_minimal_symbol_linkage_or_natural (which matches on both).
(Hmm: now that I think about it, I think I should change linespec.c to
use the latter instead of the former; right now, it doesn't matter for
that file, but it's still probably the right thing to do.)

There are some other cleanups, too: SYMBOL_MATCHES_NATURAL_NAME is
gone, a few DEPRECATED_SYMBOL_NAMEs are replaced by
SYMBOL_LINKAGE_NAMEs.

David Carlton
carlton at math dot stanford dot edu

2003-03-07  David Carlton  <carlton at math dot stanford dot edu>

	* symtab.c (lookup_partial_symbol): Replace uses of
	SYMBOL_MATCHES_NATURAL_NAME by equivalent uses of
	SYMBOL_NATURAL_NAME, strcmp_iw.
	* symtab.h (SYMBOL_MATCHES_NATURAL_NAME): Delete.
	* minsyms.c (lookup_minimal_symbol_linkage): Make static.
	(lookup_minimal_symbol_natural): Ditto.
	(lookup_minimal_symbol): Only search on linkage names; rename
	first argument to 'linkage_name'.
	(lookup_minimal_symbol_linkage): Delete.
	(lookup_minimal_symbol_natural): Delete.
	(add_minsym_to_demangled_hash_table): Go back to using
	SYMBOL_DEMANGLED_NAME instead of SYMBOL_NATURAL_NAME.
	(lookup_minimal_symbol_aux): Don't use
	SYMBOL_MATCHES_NATURAL_NAME: do a strcmp_iw on
	SYMBOL_DEMANGLED_NAME instead.  Add comment.
	(build_minimal_symbol_hash_tables): Go back to only adding to
	demangled has table if SYMBOL_DEMANGLED_NAME is non-NULL.
	* symtab.h: Delete declarations for lookup_minimal_symbol_linkage
	and lookup_minimal_symbol_natural.
	* valops.c (find_function_in_inferior): Use lookup_symbol_linkage
	instead of lookup_symbol.  Change comment.
	* remote.c (remote_check_symbols): Use
	lookup_minimal_symbol_linkage_or_natural instead of
	lookup_minimal_symbol, but add FIXME comment as well.
	* objc-lang.c: Ditto.
	* c-exp.y: Use lookup_minimal_symbol_linkage_or_natural instead of
	lookup_minimal_symbol.
	* p-exp.y: Ditto.
	* objc-exp.y: Ditto.
	* m2-exp.y: Ditto.
	* jv-exp.y (push_expression_name): Ditto.
	* f-exp.y: Ditto.
	* printcmd.c (address_info): Ditto.
	* symtab.h: Declare lookup_minimal_symbol_linkage_or_natural.
	* minsyms.c (lookup_minimal_symbol_linkage_or_natural): New.
	* ax-gdb.c (gen_var_ref): Use SYMBOL_LINKAGE_NAME instead of
	DEPRECATED_SYMBOL_NAME.
	* tracepoint.c (scope_info): Ditto.
	* symtab.c (find_pc_sect_line): Ditto.
	* stabsread.c (define_symbol): Ditto.
	* sol-thread.c (info_cb): Ditto.
	* printcmd.c (address_info): Ditto.
	* hppa-tdep.c (hppa_fix_call_dummy): Ditto.
	(hppa_in_solib_call_trampoline): Ditto.
	* findvar.c (read_var_value): Ditto.

Index: ax-gdb.c
===================================================================
RCS file: /cvs/src/src/gdb/ax-gdb.c,v
retrieving revision 1.14.4.5
diff -u -p -r1.14.4.5 ax-gdb.c
--- ax-gdb.c	6 Mar 2003 00:56:23 -0000	1.14.4.5
+++ ax-gdb.c	7 Mar 2003 22:47:30 -0000
@@ -609,7 +609,7 @@ gen_var_ref (struct agent_expr *ax, stru
     case LOC_UNRESOLVED:
       {
 	struct minimal_symbol *msym
-	= lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL);
+	= lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
 	if (!msym)
 	  error ("Couldn't resolve symbol `%s'.", SYMBOL_PRINT_NAME (var));
 
Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.15.2.8
diff -u -p -r1.15.2.8 c-exp.y
--- c-exp.y	6 Mar 2003 00:56:24 -0000	1.15.2.8
+++ c-exp.y	7 Mar 2003 22:47:30 -0000
@@ -655,7 +655,8 @@ variable:	qualified_name
 			      break;
 			    }
 
-			  msymbol = lookup_minimal_symbol (name, NULL, NULL);
+			  msymbol
+			    = lookup_minimal_symbol_linkage_or_natural (name);
 			  if (msymbol != NULL)
 			    {
 			      write_exp_msymbol (msymbol,
@@ -711,7 +712,7 @@ variable:	name_not_typename
 			      register char *arg = copy_name ($1.stoken);
 
 			      msymbol =
-				lookup_minimal_symbol (arg, NULL, NULL);
+				lookup_minimal_symbol_linkage_or_natural (arg);
 			      if (msymbol != NULL)
 				{
 				  write_exp_msymbol (msymbol,
Index: f-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/f-exp.y,v
retrieving revision 1.8.4.4
diff -u -p -r1.8.4.4 f-exp.y
--- f-exp.y	6 Mar 2003 00:56:27 -0000	1.8.4.4
+++ f-exp.y	7 Mar 2003 22:47:31 -0000
@@ -479,7 +479,7 @@ variable:	name_not_typename
 			      register char *arg = copy_name ($1.stoken);
 
 			      msymbol =
-				lookup_minimal_symbol (arg, NULL, NULL);
+				lookup_minimal_symbol_linkage_or_natural (arg);
 			      if (msymbol != NULL)
 				{
 				  write_exp_msymbol (msymbol,
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.35.8.8
diff -u -p -r1.35.8.8 findvar.c
--- findvar.c	6 Mar 2003 00:56:27 -0000	1.35.8.8
+++ findvar.c	7 Mar 2003 22:47:31 -0000
@@ -629,7 +629,7 @@ addresses have not been bound by the dyn
       {
 	struct minimal_symbol *msym;
 
-	msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (var), NULL, NULL);
+	msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
 	if (msym == NULL)
 	  return 0;
 	if (overlay_debugging)
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.27.14.6
diff -u -p -r1.27.14.6 hppa-tdep.c
--- hppa-tdep.c	6 Mar 2003 00:56:29 -0000	1.27.14.6
+++ hppa-tdep.c	7 Mar 2003 22:47:32 -0000
@@ -2234,10 +2234,10 @@ hppa_fix_call_dummy (char *dummy, CORE_A
 	  {
 	    stub_symbol
 	      = lookup_minimal_symbol_solib_trampoline
-	      (DEPRECATED_SYMBOL_NAME (funsymbol), NULL, objfile);
+	      (SYMBOL_LINKAGE_NAME (funsymbol), NULL, objfile);
 
 	    if (!stub_symbol)
-	      stub_symbol = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (funsymbol),
+	      stub_symbol = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (funsymbol),
 						   NULL, objfile);
 
 	    /* Found a symbol with the right name.  */
@@ -3014,7 +3014,7 @@ hppa_in_solib_call_trampoline (CORE_ADDR
     return 1;
 
   minsym = lookup_minimal_symbol_by_pc (pc);
-  if (minsym && strcmp (DEPRECATED_SYMBOL_NAME (minsym), ".stub") == 0)
+  if (minsym && strcmp (SYMBOL_LINKAGE_NAME (minsym), ".stub") == 0)
     return 1;
 
   /* Get the unwind descriptor corresponding to PC, return zero
@@ -3352,7 +3352,7 @@ hppa_skip_trampoline_code (CORE_ADDR pc)
 	      return orig_pc == pc ? 0 : pc & ~0x3;
 	    }
 
-	  libsym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (stubsym), NULL, NULL);
+	  libsym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (stubsym), NULL, NULL);
 	  if (libsym == NULL)
 	    {
 	      warning ("Unable to find library symbol for %s\n",
Index: jv-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/jv-exp.y,v
retrieving revision 1.11.2.4
diff -u -p -r1.11.2.4 jv-exp.y
--- jv-exp.y	6 Mar 2003 00:56:30 -0000	1.11.2.4
+++ jv-exp.y	7 Mar 2003 22:47:32 -0000
@@ -1405,7 +1405,7 @@ push_expression_name (name)
     {
       struct minimal_symbol *msymbol;
 
-      msymbol = lookup_minimal_symbol (tmp, NULL, NULL);
+      msymbol = lookup_minimal_symbol_linkage_or_natural (tmp);
       if (msymbol != NULL)
 	{
 	  write_exp_msymbol (msymbol,
Index: m2-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/m2-exp.y,v
retrieving revision 1.6.4.4
diff -u -p -r1.6.4.4 m2-exp.y
--- m2-exp.y	6 Mar 2003 00:56:30 -0000	1.6.4.4
+++ m2-exp.y	7 Mar 2003 22:47:32 -0000
@@ -621,7 +621,7 @@ variable:	NAME
 			      register char *arg = copy_name ($1);
 
 			      msymbol =
-				lookup_minimal_symbol (arg, NULL, NULL);
+				lookup_minimal_symbol_linkage_or_natural (arg);
 			      if (msymbol != NULL)
 				{
 				  write_exp_msymbol
Index: minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.22.8.5
diff -u -p -r1.22.8.5 minsyms.c
--- minsyms.c	7 Mar 2003 00:31:44 -0000	1.22.8.5
+++ minsyms.c	7 Mar 2003 22:47:33 -0000
@@ -76,6 +76,16 @@ static int msym_bunch_index;
 
 static int msym_count;
 
+static struct minimal_symbol *lookup_minimal_symbol_linkage (const char *name,
+							     const char *sfile,
+							     struct objfile
+							     *objf);
+
+static struct minimal_symbol *lookup_minimal_symbol_natural (const char *name,
+							     const char *sfile,
+							     struct objfile
+							     *objf);
+
 static struct minimal_symbol *lookup_minimal_symbol_aux (const char *name,
 							 int linkage,
 							 const char *sfile,
@@ -134,7 +144,7 @@ add_minsym_to_demangled_hash_table (stru
   if (sym->demangled_hash_next == NULL)
     {
       unsigned int hash
-	= (msymbol_hash_iw (SYMBOL_NATURAL_NAME (sym))
+	= (msymbol_hash_iw (SYMBOL_DEMANGLED_NAME (sym))
 	   % MINIMAL_SYMBOL_HASH_SIZE);
       sym->demangled_hash_next = table[hash];
       table[hash] = sym;
@@ -143,58 +153,66 @@ add_minsym_to_demangled_hash_table (stru
 
 
 /* Look through all the current minimal symbol tables and find the
-   first minimal symbol that matches NAME.  If OBJF is non-NULL, limit
-   the search to that objfile.  If SFILE is non-NULL, the only file-scope
-   symbols considered will be from that source file (global symbols are
-   still preferred).  Returns a pointer to the minimal symbol that
-   matches, or NULL if no match is found.
+   first minimal symbol whose linkage name is LINKAGE_NAME.  If OBJF
+   is non-NULL, limit the search to that objfile.  If SFILE is
+   non-NULL, the only file-scope symbols considered will be from that
+   source file (global symbols are still preferred).  Returns a
+   pointer to the minimal symbol that matches, or NULL if no match is
+   found.
 
    Note:  One instance where there may be duplicate minimal symbols with
    the same name is when the symbol tables for a shared library and the
    symbol tables for an executable contain global symbols with the same
-   names (the dynamic linker deals with the duplication).
+   names (the dynamic linker deals with the duplication).  */
 
-   This function first searches for matches via linkage names; if it
-   doesn't find a match there, it then searches via natural names.  */
+/* NOTE: carlton/2003-03-07: This function used to match on natural
+   names as well; if you want that behavior, call
+   lookup_minimal_symbol_linkage_or_natural.  */
 
 struct minimal_symbol *
-lookup_minimal_symbol (register const char *name, const char *sfile,
+lookup_minimal_symbol (register const char *linkage_name, const char *sfile,
 		       struct objfile *objf)
 {
-  struct minimal_symbol *msymbol;
-
-  msymbol = lookup_minimal_symbol_linkage (name, sfile, objf);
-
-  if (msymbol != NULL)
-    return msymbol;
-  else
-    return lookup_minimal_symbol_natural (name, sfile, objf);
+  return lookup_minimal_symbol_aux (linkage_name, 1, sfile, objf);
 }
 
-/* Search for a minimal symbol via linkage names; args are as in
-   lookup_minimal_symbol.  */
+/* Search for a minimal symbol named NAME.  Search for that name as
+   either a linkage name or a natural name.  */
+
+/* NOTE: carlton/2003-03-07: I normally strongly dislike functions
+   that accept either linkage names or natural names, but I'm making
+   an exception here: callers of this function derive NAME from user
+   input, and do so in situations where using a linkage name might be
+   necessary as a workaround for some of GDB's C++ bugs.  */
+
+/* NOTE: carlton/2003-03-07: This never searches on all natural names
+   at once: it searches on linkage names via strcmp, and on demangled
+   names via strcmp_iw.  However, for natural names that turn out to
+   be linkage names of minimal symbols, using strcmp in place of
+   strcmp_iw is safe.  (You have to be more careful if the name isn't
+   associated to a minimal symbol: see PR gdb/33.)  */
 
 struct minimal_symbol *
-lookup_minimal_symbol_linkage (const char *name, const char *sfile,
-			       struct objfile *objf)
+lookup_minimal_symbol_linkage_or_natural (const char *name)
 {
-  return lookup_minimal_symbol_aux (name, 1, sfile, objf);
-}
+  struct minimal_symbol *msymbol;
 
-/* Search for a minimal symbol via natural names; args are as in
-   lookup_minimal_symbol.  */
+  msymbol = lookup_minimal_symbol_aux (name, 1, NULL, NULL);
 
-struct minimal_symbol *
-lookup_minimal_symbol_natural (const char *name, const char *sfile,
-			       struct objfile *objf)
-{
-  return lookup_minimal_symbol_aux (name, 0, sfile, objf);
+  if (msymbol != NULL)
+    return msymbol;
+  else
+    return lookup_minimal_symbol_aux (name, 0, NULL, NULL);
 }
 
 /* Helper function for lookup_minimal_symbol and friends, which only
    searches for matches via linkage names or natural names but not
    both.  Args are in lookup_minimal_symbol; if LINKAGE is non-zero,
-   search in linkage names, if zero, search in natural names.  */
+   search in linkage names via strcmp, and if zero, search in
+   demangled names via strcmp_iw.  */
+
+/* NOTE: carlton/2003-03-07: If non-zero, it really only searches in
+   demangled names, not in all natural names.  Be careful.  */
 
 static struct minimal_symbol *
 lookup_minimal_symbol_aux (const char *name, int linkage,
@@ -237,7 +255,7 @@ lookup_minimal_symbol_aux (const char *n
 	    {
 	      if (linkage
 		  ? strcmp (SYMBOL_LINKAGE_NAME (msymbol), name) == 0
-		  : SYMBOL_MATCHES_NATURAL_NAME (msymbol, name))
+		  : strcmp_iw (SYMBOL_DEMANGLED_NAME (msymbol), name) == 0)
 		{
 		  switch (MSYMBOL_TYPE (msymbol))
 		    {
@@ -845,8 +863,9 @@ build_minimal_symbol_hash_tables (struct
       add_minsym_to_hash_table (msym, objfile->msymbol_hash);
 
       msym->demangled_hash_next = 0;
-      add_minsym_to_demangled_hash_table (msym,
-					  objfile->msymbol_demangled_hash);
+      if (SYMBOL_DEMANGLED_NAME (msym) != NULL)
+	add_minsym_to_demangled_hash_table (msym,
+					    objfile->msymbol_demangled_hash);
     }
 }
 
Index: objc-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/objc-exp.y,v
retrieving revision 1.3.2.8
diff -u -p -r1.3.2.8 objc-exp.y
--- objc-exp.y	6 Mar 2003 00:56:31 -0000	1.3.2.8
+++ objc-exp.y	7 Mar 2003 22:47:33 -0000
@@ -716,7 +716,8 @@ variable:	qualified_name
 			      break;
 			    }
 
-			  msymbol = lookup_minimal_symbol (name, NULL, NULL);
+			  msymbol
+			    = lookup_minimal_symbol_linkage_or_natural (name);
 			  if (msymbol != NULL)
 			    {
 			      write_exp_msymbol (msymbol,
@@ -772,7 +773,7 @@ variable:	name_not_typename
 			      register char *arg = copy_name ($1.stoken);
 
 			      msymbol =
-				lookup_minimal_symbol (arg, NULL, NULL);
+				lookup_minimal_symbol_linkage_or_natural (arg);
 			      if (msymbol != NULL)
 				{
 				  write_exp_msymbol (msymbol,
Index: objc-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/objc-lang.c,v
retrieving revision 1.3.2.9
diff -u -p -r1.3.2.9 objc-lang.c
--- objc-lang.c	6 Mar 2003 00:56:31 -0000	1.3.2.9
+++ objc-lang.c	7 Mar 2003 22:47:34 -0000
@@ -1446,7 +1446,11 @@ char *find_imps (struct symtab *symtab, 
       }
 
     if (sym == NULL)
-      msym = lookup_minimal_symbol (selector, 0, 0);
+      {
+	/* FIXME: carlton/2003-03-07: I don't know what SELECTOR looks
+	   like: is it a linkage name or a natural name?  I'll accept
+	   natural names for now, to be on the safe side.  */
+      msym = lookup_minimal_symbol_linkage_or_natural (selector);
 
     if (msym != NULL) 
       {
Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.15.2.7
diff -u -p -r1.15.2.7 p-exp.y
--- p-exp.y	6 Mar 2003 00:56:31 -0000	1.15.2.7
+++ p-exp.y	7 Mar 2003 22:47:34 -0000
@@ -620,7 +620,8 @@ variable:	qualified_name
 			      break;
 			    }
 
-			  msymbol = lookup_minimal_symbol (name, NULL, NULL);
+			  msymbol
+			    = lookup_minimal_symbol_linkage_or_natural (name);
 			  if (msymbol != NULL)
 			    {
 			      write_exp_msymbol (msymbol,
@@ -690,7 +691,7 @@ variable:	name_not_typename
 			      register char *arg = copy_name ($1.stoken);
 
 			      msymbol =
-				lookup_minimal_symbol (arg, NULL, NULL);
+				lookup_minimal_symbol_linkage_or_natural (arg);
 			      if (msymbol != NULL)
 				{
 				  write_exp_msymbol (msymbol,
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.43.2.10
diff -u -p -r1.43.2.10 printcmd.c
--- printcmd.c	6 Mar 2003 00:56:31 -0000	1.43.2.10
+++ printcmd.c	7 Mar 2003 22:47:37 -0000
@@ -1096,7 +1096,7 @@ address_info (char *exp, int from_tty)
 	  return;
 	}
 
-      msymbol = lookup_minimal_symbol (exp, NULL, NULL);
+      msymbol = lookup_minimal_symbol_linkage_or_natural (exp);
 
       if (msymbol != NULL)
 	{
@@ -1242,7 +1242,7 @@ address_info (char *exp, int from_tty)
       {
 	struct minimal_symbol *msym;
 
-	msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL);
+	msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, NULL);
 	if (msym == NULL)
 	  printf_filtered ("unresolved");
 	else
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.93.8.2
diff -u -p -r1.93.8.2 remote.c
--- remote.c	6 Mar 2003 00:56:31 -0000	1.93.8.2
+++ remote.c	7 Mar 2003 22:47:39 -0000
@@ -2227,7 +2227,10 @@ remote_check_symbols (struct objfile *ob
       tmp = &reply[8];
       end = hex2bin (tmp, msg, strlen (tmp) / 2);
       msg[end] = '\0';
-      sym = lookup_minimal_symbol (msg, NULL, NULL);
+      /* FIXME: carlton/2003-03-07: I have no idea if natural names
+	 are allowed here; allowing them is safest.  Somebody else
+	 should look at this.  */
+      sym = lookup_minimal_symbol_linkage_or_natural (msg);
       if (sym == NULL)
 	sprintf (msg, "qSymbol::%s", &reply[8]);
       else
Index: sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.30.4.3
diff -u -p -r1.30.4.3 sol-thread.c
--- sol-thread.c	6 Mar 2003 00:56:31 -0000	1.30.4.3
+++ sol-thread.c	7 Mar 2003 22:47:39 -0000
@@ -1476,7 +1476,7 @@ info_cb (const td_thrhandle_t *th, void 
 	  struct minimal_symbol *msym;
 	  msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc);
 	  if (msym)
-	    printf_filtered ("   startfunc: %s\n", DEPRECATED_SYMBOL_NAME (msym));
+	    printf_filtered ("   startfunc: %s\n", SYMBOL_LINKAGE_NAME (msym));
 	  else
 	    printf_filtered ("   startfunc: 0x%s\n", paddr (ti.ti_startfunc));
 	}
Index: stabsread.c
===================================================================
RCS file: /cvs/src/src/gdb/stabsread.c,v
retrieving revision 1.41.2.8
diff -u -p -r1.41.2.8 stabsread.c
--- stabsread.c	6 Mar 2003 00:56:32 -0000	1.41.2.8
+++ stabsread.c	7 Mar 2003 22:47:40 -0000
@@ -1801,13 +1801,13 @@ define_symbol (CORE_ADDR valu, char *str
       SYMBOL_CLASS (sym) = LOC_STATIC;
       SYMBOL_VALUE_ADDRESS (sym) = valu;
 #ifdef STATIC_TRANSFORM_NAME
-      if (IS_STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym)))
+      if (IS_STATIC_TRANSFORM_NAME (SYMBOL_LINKAGE_NAME (sym)))
 	{
 	  struct minimal_symbol *msym;
-	  msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, objfile);
+	  msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, objfile);
 	  if (msym != NULL)
 	    {
-	      DEPRECATED_SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym));
+	      SYMBOL_LINKAGE_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_LINKAGE_NAME (sym));
 	      SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
 	    }
 	}
@@ -1959,10 +1959,10 @@ define_symbol (CORE_ADDR valu, char *str
       if (IS_STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym)))
 	{
 	  struct minimal_symbol *msym;
-	  msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, objfile);
+	  msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, objfile);
 	  if (msym != NULL)
 	    {
-	      DEPRECATED_SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (DEPRECATED_SYMBOL_NAME (sym));
+	      SYMBOL_LINKAGE_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_LINKAGE_NAME (sym));
 	      SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym);
 	    }
 	}
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.70.2.34
diff -u -p -r1.70.2.34 symtab.c
--- symtab.c	6 Mar 2003 00:56:32 -0000	1.70.2.34
+++ symtab.c	7 Mar 2003 22:47:41 -0000
@@ -1538,7 +1538,7 @@ lookup_partial_symbol (struct partial_sy
       while (top <= real_top
 	     && (linkage_name != NULL
 		 ? strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0
-		 : SYMBOL_MATCHES_NATURAL_NAME (*top,name)))
+		 : strcmp_iw (SYMBOL_NATURAL_NAME (*top), name) == 0))
 	{
 	  if (SYMBOL_NAMESPACE (*top) == namespace)
 	    {
@@ -1559,7 +1559,7 @@ lookup_partial_symbol (struct partial_sy
 	    {
 	      if (linkage_name != NULL
 		  ? strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0
-		  : SYMBOL_MATCHES_NATURAL_NAME (*psym, name))
+		  : strcmp_iw (SYMBOL_NATURAL_NAME (*psym), name) == 0)
 		{
 		  return (*psym);
 		}
@@ -2065,7 +2065,7 @@ find_pc_sect_line (CORE_ADDR pc, struct 
   if (msymbol != NULL)
     if (MSYMBOL_TYPE (msymbol) == mst_solib_trampoline)
       {
-	mfunsym = lookup_minimal_symbol_text (DEPRECATED_SYMBOL_NAME (msymbol), NULL, NULL);
+	mfunsym = lookup_minimal_symbol_text (SYMBOL_LINKAGE_NAME (msymbol), NULL, NULL);
 	if (mfunsym == NULL)
 	  /* I eliminated this warning since it is coming out
 	   * in the following situation:
Index: symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.42.2.23
diff -u -p -r1.42.2.23 symtab.h
--- symtab.h	7 Mar 2003 00:31:44 -0000	1.42.2.23
+++ symtab.h	7 Mar 2003 22:47:42 -0000
@@ -211,14 +211,6 @@ extern const char *symbol_demangled_name
 #define SYMBOL_PRINT_NAME(symbol)					\
   (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol))
 
-/* Macro that tests a symbol for a match against a specified name
-   string.  It tests against SYMBOL_NATURAL_NAME, and it ignores
-   whitespace and trailing parentheses.  (See strcmp_iw for details
-   about its behavior.)  */
-
-#define SYMBOL_MATCHES_NATURAL_NAME(symbol, name)			\
-  (strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0)
-
 /* Define a simple structure used to hold some very basic information about
    all defined global symbols (text, data, bss, abs, etc).  The only required
    information is the general_symbol_info.
@@ -1124,13 +1116,8 @@ extern struct minimal_symbol *lookup_min
 						     const char *,
 						     struct objfile *);
 
-extern struct minimal_symbol *lookup_minimal_symbol_linkage (const char *,
-							     const char *,
-							     struct objfile *);
-
-extern struct minimal_symbol *lookup_minimal_symbol_natural (const char *,
-							     const char *,
-							     struct objfile *);
+extern struct
+minimal_symbol *lookup_minimal_symbol_linkage_or_natural (const char *);
 
 extern struct minimal_symbol *lookup_minimal_symbol_text (const char *,
 							  const char *,
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.41.2.7
diff -u -p -r1.41.2.7 tracepoint.c
--- tracepoint.c	6 Mar 2003 00:56:33 -0000	1.41.2.7
+++ tracepoint.c	7 Mar 2003 22:47:42 -0000
@@ -2435,7 +2435,7 @@ scope_info (char *args, int from_tty)
 			       REGISTER_NAME (SYMBOL_BASEREG (sym)));
 	      break;
 	    case LOC_UNRESOLVED:
-	      msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL);
+	      msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym), NULL, NULL);
 	      if (msym == NULL)
 		printf_filtered ("Unresolved Static");
 	      else
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.75.2.17
diff -u -p -r1.75.2.17 valops.c
--- valops.c	6 Mar 2003 00:56:33 -0000	1.75.2.17
+++ valops.c	7 Mar 2003 22:47:43 -0000
@@ -161,13 +161,14 @@ int unwind_on_signal_p = 0;
 static int coerce_float_to_double;
 
 
-/* Find the address of function name NAME in the inferior.  */
+/* Find the address of function whose linkage name is NAME in the
+   inferior.  */
 
 struct value *
 find_function_in_inferior (const char *name)
 {
   register struct symbol *sym;
-  sym = lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);
+  sym = lookup_symbol_linkage (name);
   if (sym != NULL)
     {
       if (SYMBOL_CLASS (sym) != LOC_BLOCK)


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