This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] convert some SYMBOL_PRINT_NAMEs
- From: David Carlton <carlton at math dot stanford dot edu>
- To: gdb-patches at sources dot redhat dot com
- Cc: Elena Zannoni <ezannoni at redhat dot com>, Jim Blandy <jimb at redhat dot com>
- Date: 26 Feb 2003 11:35:38 -0800
- Subject: [patch] convert some SYMBOL_PRINT_NAMEs
This patch converts some uses of SYMBOL_PRINT_NAME into
SYMBOL_NATURAL_NAME. The uses in question are for internal sorting
functions, where we shouldn't pay attention to the 'demangle'
variable.
Tested on i686-pc-linux-gnu/GCC3.1/DWARF-2; no new regressions. I'm
planning to commit it tomorrow as obvious. (Making things like this
obvious is the whole point of these new macros, after all! :-) )
David Carlton
carlton at math dot stanford dot edu
2003-02-26 David Carlton <carlton at math dot stanford dot edu>
* symfile.c (compare_symbols): Use SYMBOL_NATURAL_NAME, not
SYMBOL_PRINT_NAME.
(compare_psymbols): Ditto.
* symtab.c (lookup_partial_symbol, lookup_block_symbol): Ditto.
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.91
diff -u -p -r1.91 symfile.c
--- symfile.c 25 Feb 2003 21:36:20 -0000 1.91
+++ symfile.c 26 Feb 2003 18:32:52 -0000
@@ -210,7 +210,7 @@ compare_symbols (const void *s1p, const
s1 = (struct symbol **) s1p;
s2 = (struct symbol **) s2p;
- return (strcmp (SYMBOL_PRINT_NAME (*s1), SYMBOL_PRINT_NAME (*s2)));
+ return (strcmp (SYMBOL_NATURAL_NAME (*s1), SYMBOL_NATURAL_NAME (*s2)));
}
/* This compares two partial symbols by names, using strcmp_iw_ordered
@@ -222,8 +222,8 @@ compare_psymbols (const void *s1p, const
struct partial_symbol *const *s1 = s1p;
struct partial_symbol *const *s2 = s2p;
- return strcmp_iw_ordered (SYMBOL_PRINT_NAME (*s1),
- SYMBOL_PRINT_NAME (*s2));
+ return strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*s1),
+ SYMBOL_NATURAL_NAME (*s2));
}
void
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.95
diff -u -p -r1.95 symtab.c
--- symtab.c 25 Feb 2003 21:36:20 -0000 1.95
+++ symtab.c 26 Feb 2003 18:32:45 -0000
@@ -1411,7 +1411,7 @@ lookup_partial_symbol (struct partial_sy
{
do_linear_search = 1;
}
- if (strcmp_iw_ordered (SYMBOL_PRINT_NAME (*center), name) >= 0)
+ if (strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*center), name) >= 0)
{
top = center;
}
@@ -1657,15 +1657,15 @@ lookup_block_symbol (register const stru
{
do_linear_search = 1;
}
- if (SYMBOL_PRINT_NAME (sym)[0] < name[0])
+ if (SYMBOL_NATURAL_NAME (sym)[0] < name[0])
{
bot = inc;
}
- else if (SYMBOL_PRINT_NAME (sym)[0] > name[0])
+ else if (SYMBOL_NATURAL_NAME (sym)[0] > name[0])
{
top = inc;
}
- else if (strcmp (SYMBOL_PRINT_NAME (sym), name) < 0)
+ else if (strcmp (SYMBOL_NATURAL_NAME (sym), name) < 0)
{
bot = inc;
}