Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit] remove DEPRECATED_SYMBOL_NAME uses from symtab.c
@ 2003-06-12 15:55 David Carlton
  2003-06-12 16:57 ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: David Carlton @ 2003-06-12 15:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: ezannoni, jimb

This patch gets rid of the uses of DEPRECATED_SYMBOL_NAME in
symtab.c.  Tested on GCC 3.2, DWARF 2, i686-pc-linux-gnu; committed as
obvious.

David Carlton
carlton@kealia.com

2003-06-12  David Carlton  <carlton@kealia.com>

	* symtab.c (lookup_symbol_aux_minsyms): Replace
	DEPRECATED_SYMBOL_NAME by SYMBOL_LINKAGE_NAME.
	(find_pc_sect_line, search_symbols, rbreak_command): Ditto.
	(COMPLETION_LIST_ADD_SYMBOL): Rewrite in terms of
	SYMBOL_NATURAL_NAME.

Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.112
diff -u -p -r1.112 symtab.c
--- symtab.c	12 Jun 2003 15:33:45 -0000	1.112
+++ symtab.c	12 Jun 2003 15:44:52 -0000
@@ -1227,7 +1227,7 @@ lookup_symbol_aux_minsyms (const char *n
 	      bv = BLOCKVECTOR (s);
 	      block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
 
-	      /* This call used to pass `DEPRECATED_SYMBOL_NAME (msymbol)' as the
+	      /* This call used to pass `SYMBOL_LINKAGE_NAME (msymbol)' as the
 	         `name' argument to lookup_block_symbol.  But the name
 	         of a minimal symbol is always mangled, so that seems
 	         to be clearly the wrong thing to pass as the
@@ -1961,7 +1961,8 @@ 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:
@@ -1972,12 +1973,12 @@ find_pc_sect_line (CORE_ADDR pc, struct 
 	   * so of course we can't find the real func/line info,
 	   * but the "break" still works, and the warning is annoying.
 	   * So I commented out the warning. RT */
-	  /* warning ("In stub for %s; unable to find real function/line info", DEPRECATED_SYMBOL_NAME (msymbol)) */ ;
+	  /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_LINKAGE_NAME (msymbol)) */ ;
 	/* fall through */
 	else if (SYMBOL_VALUE (mfunsym) == SYMBOL_VALUE (msymbol))
 	  /* Avoid infinite recursion */
 	  /* See above comment about why warning is commented out */
-	  /* warning ("In stub for %s; unable to find real function/line info", DEPRECATED_SYMBOL_NAME (msymbol)) */ ;
+	  /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_LINKAGE_NAME (msymbol)) */ ;
 	/* fall through */
 	else
 	  return find_pc_line (SYMBOL_VALUE (mfunsym), 0);
@@ -2911,7 +2912,7 @@ search_symbols (char *regexp, domain_enu
 		       symbol associated to a given minimal symbol (if
 		       any).  */
 		    if (kind == FUNCTIONS_DOMAIN
-			|| lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol),
+			|| lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol),
 					  (struct block *) NULL,
 					  VAR_DOMAIN,
 					0, (struct symtab **) NULL) == NULL)
@@ -3003,7 +3004,7 @@ search_symbols (char *regexp, domain_enu
 		    (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))))
 		  {
 		    /* Variables/Absolutes:  Look up by name */
-		    if (lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol),
+		    if (lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol),
 				       (struct block *) NULL, VAR_DOMAIN,
 				       0, (struct symtab **) NULL) == NULL)
 		      {
@@ -3183,12 +3184,12 @@ rbreak_command (char *regexp, int from_t
     {
       if (p->msymbol == NULL)
 	{
-	  char *string = (char *) alloca (strlen (p->symtab->filename)
-					  + strlen (DEPRECATED_SYMBOL_NAME (p->symbol))
-					  + 4);
+	  char *string = alloca (strlen (p->symtab->filename)
+				 + strlen (SYMBOL_LINKAGE_NAME (p->symbol))
+				 + 4);
 	  strcpy (string, p->symtab->filename);
 	  strcat (string, ":'");
-	  strcat (string, DEPRECATED_SYMBOL_NAME (p->symbol));
+	  strcat (string, SYMBOL_LINKAGE_NAME (p->symbol));
 	  strcat (string, "'");
 	  break_command (string, from_tty);
 	  print_symbol_info (FUNCTIONS_DOMAIN,
@@ -3199,7 +3200,7 @@ rbreak_command (char *regexp, int from_t
 	}
       else
 	{
-	  break_command (DEPRECATED_SYMBOL_NAME (p->msymbol), from_tty);
+	  break_command (SYMBOL_LINKAGE_NAME (p->msymbol), from_tty);
 	  printf_filtered ("<function, no debug info> %s;\n",
 			   SYMBOL_PRINT_NAME (p->msymbol));
 	}
@@ -3216,17 +3217,8 @@ static int return_val_index;
 static char **return_val;
 
 #define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \
-  do { \
-    if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) \
-      /* Put only the mangled name on the list.  */ \
-      /* Advantage:  "b foo<TAB>" completes to "b foo(int, int)" */ \
-      /* Disadvantage:  "b foo__i<TAB>" doesn't complete.  */ \
       completion_list_add_name \
-	(SYMBOL_DEMANGLED_NAME (symbol), (sym_text), (len), (text), (word)); \
-    else \
-      completion_list_add_name \
-	(DEPRECATED_SYMBOL_NAME (symbol), (sym_text), (len), (text), (word)); \
-  } while (0)
+	(SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))
 
 /*  Test to see if the symbol specified by SYMNAME (which is already
    demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN


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

* Re: [commit] remove DEPRECATED_SYMBOL_NAME uses from symtab.c
  2003-06-12 15:55 [commit] remove DEPRECATED_SYMBOL_NAME uses from symtab.c David Carlton
@ 2003-06-12 16:57 ` Andrew Cagney
  2003-06-12 17:01   ` Daniel Jacobowitz
  2003-06-12 17:05   ` David Carlton
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Cagney @ 2003-06-12 16:57 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches, ezannoni, jimb

Does this:

>  #define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \
> -  do { \
> -    if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) \
> -      /* Put only the mangled name on the list.  */ \
> -      /* Advantage:  "b foo<TAB>" completes to "b foo(int, int)" */ \
> -      /* Disadvantage:  "b foo__i<TAB>" doesn't complete.  */ \
>        completion_list_add_name \
> -	(SYMBOL_DEMANGLED_NAME (symbol), (sym_text), (len), (text), (word)); \
> -    else \
> -      completion_list_add_name \
> -	(DEPRECATED_SYMBOL_NAME (symbol), (sym_text), (len), (text), (word)); \
> -  } while (0)
> +	(SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))

mean that COMPLETION_LIST_ADD_SYMBOL is also dead?  (I have trouble 
reading unified diffs :-)

Andrew


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

* Re: [commit] remove DEPRECATED_SYMBOL_NAME uses from symtab.c
  2003-06-12 16:57 ` Andrew Cagney
@ 2003-06-12 17:01   ` Daniel Jacobowitz
  2003-06-12 17:05   ` David Carlton
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-06-12 17:01 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: David Carlton, gdb-patches, ezannoni, jimb

On Thu, Jun 12, 2003 at 12:57:44PM -0400, Andrew Cagney wrote:
> Does this:
> 
> > #define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \
> >-  do { \
> >-    if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) \
> >-      /* Put only the mangled name on the list.  */ \
> >-      /* Advantage:  "b foo<TAB>" completes to "b foo(int, int)" */ \
> >-      /* Disadvantage:  "b foo__i<TAB>" doesn't complete.  */ \
> >       completion_list_add_name \
> >-	(SYMBOL_DEMANGLED_NAME (symbol), (sym_text), (len), (text), (word)); 
> >\
> >-    else \
> >-      completion_list_add_name \
> >-	(DEPRECATED_SYMBOL_NAME (symbol), (sym_text), (len), (text), 
> >(word)); \
> >-  } while (0)
> >+	(SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))
> 
> mean that COMPLETION_LIST_ADD_SYMBOL is also dead?  (I have trouble 
> reading unified diffs :-)

I guess so - it's still there, but it looks to me like it's a
transparent function call now.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [commit] remove DEPRECATED_SYMBOL_NAME uses from symtab.c
  2003-06-12 16:57 ` Andrew Cagney
  2003-06-12 17:01   ` Daniel Jacobowitz
@ 2003-06-12 17:05   ` David Carlton
  2003-06-12 17:12     ` Andrew Cagney
  1 sibling, 1 reply; 5+ messages in thread
From: David Carlton @ 2003-06-12 17:05 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches, ezannoni, jimb

On Thu, 12 Jun 2003 12:57:44 -0400, Andrew Cagney <ac131313@redhat.com> said:

> Does this:
>> #define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \
>> -  do { \
>> -    if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) \
>> -      /* Put only the mangled name on the list.  */ \
>> -      /* Advantage:  "b foo<TAB>" completes to "b foo(int, int)" */ \
>> -      /* Disadvantage:  "b foo__i<TAB>" doesn't complete.  */ \
>> completion_list_add_name \
>> -	(SYMBOL_DEMANGLED_NAME (symbol), (sym_text), (len), (text), (word)); \
>> -    else \
>> -      completion_list_add_name \
>> -	(DEPRECATED_SYMBOL_NAME (symbol), (sym_text), (len), (text), (word)); \
>> -  } while (0)
>> +	(SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))

> mean that COMPLETION_LIST_ADD_SYMBOL is also dead?  (I have trouble
> reading unified diffs :-)

No, it's still there, it's just defined as follows now:

#define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \
      completion_list_add_name \
	(SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))

One could argue the wisdom of keeping it around as a separate macro,
but that's a separate issue: all I wanted to do with that patch was
clean up deprecated stuff.

David Carlton
carlton@math.stanford.edu


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

* Re: [commit] remove DEPRECATED_SYMBOL_NAME uses from symtab.c
  2003-06-12 17:05   ` David Carlton
@ 2003-06-12 17:12     ` Andrew Cagney
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2003-06-12 17:12 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches, ezannoni, jimb


> No, it's still there, it's just defined as follows now:
> 
> #define COMPLETION_LIST_ADD_SYMBOL(symbol, sym_text, len, text, word) \
>       completion_list_add_name \
> 	(SYMBOL_NATURAL_NAME (symbol), (sym_text), (len), (text), (word))
> 
> One could argue the wisdom of keeping it around as a separate macro,
> but that's a separate issue: all I wanted to do with that patch was
> clean up deprecated stuff.

Ah, thanks.  I told you I had trouble reading unified diffs :-^

Andrew



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

end of thread, other threads:[~2003-06-12 17:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-12 15:55 [commit] remove DEPRECATED_SYMBOL_NAME uses from symtab.c David Carlton
2003-06-12 16:57 ` Andrew Cagney
2003-06-12 17:01   ` Daniel Jacobowitz
2003-06-12 17:05   ` David Carlton
2003-06-12 17:12     ` Andrew Cagney

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