aboutsummaryrefslogtreecommitdiff
path: root/gdb/minsyms.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-03-31 20:21:08 +0000
committerTom Tromey <tromey@redhat.com>2009-03-31 20:21:08 +0000
commit71c25deab3d61e4cfbaffc7006704a27d1bc0737 (patch)
tree197ec5630b7db57b6f8d1cf23309bed4047417c2 /gdb/minsyms.c
parent45ac276db3f6ee73f955254e5ef055c673b5fbb3 (diff)
downloadgdb-71c25deab3d61e4cfbaffc7006704a27d1bc0737.zip
gdb-71c25deab3d61e4cfbaffc7006704a27d1bc0737.tar.gz
gdb-71c25deab3d61e4cfbaffc7006704a27d1bc0737.tar.bz2
gdb
2009-03-31 Daniel Jacobowitz <dan@codesourcery.com> Keith Seitz <keiths@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/6817 * Makefile.in (dbxread.o): Update. * dbxread.c (read_dbx_symtab): Use cp_canonicalize_string. * dwarf2read.c (GDB_FORM_cached_string): New. (read_partial_die): Use dwarf2_canonicalize_name. (dwarf2_linkage_name): Use dwarf2_name. (dwarf2_canonicalize_name): New. (dwarf2_name): Use dwarf2_canonicalize_name. (dwarf_form_name, dump_die): Handle GDB_FORM_cached_string. * stabsread.c (define_symbol, read_type): Use cp_canonicalize_string. * symtab.c (lookup_symbol_in_language): Canonicalize input before searching. * cp-name-parser.y: operator() requires two parameters, according to libiberty. * minsyms.c (lookup_minimal_symbol): Canonicalize input before searching. * NEWS: Update. gdb/testsuite 2009-03-31 Daniel Jacobowitz <dan@codesourcery.com> Jan Kratochvil <jan.kratochvil@redhat.com> PR gdb/931 * gdb.cp/gdb1355.exp (f_li, f_lui, f_si, f_sui): Allow canonical output. * gdb.cp/templates.exp: Allow canonical output. Remove KFAILs for gdb/931. * dw2-strp.S (DW_AT_language): Change to C++. (DW_TAG_variable (name ""), Abbrev code 7, .Lemptyname): New.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r--gdb/minsyms.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index bf776b3..e4b0f31 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -48,6 +48,8 @@
#include "value.h"
#include "cp-abi.h"
#include "target.h"
+#include "cp-support.h"
+#include "language.h"
/* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
At the end, copy them all into one newly allocated location on an objfile's
@@ -187,6 +189,9 @@ lookup_minimal_symbol (const char *name, const char *sfile,
unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE;
unsigned int dem_hash = msymbol_hash_iw (name) % MINIMAL_SYMBOL_HASH_SIZE;
+ int needtofreename = 0;
+ const char *modified_name;
+
if (sfile != NULL)
{
char *p = strrchr (sfile, '/');
@@ -194,6 +199,18 @@ lookup_minimal_symbol (const char *name, const char *sfile,
sfile = p + 1;
}
+ /* For C++, canonicalize the input name. */
+ modified_name = name;
+ if (current_language->la_language == language_cplus)
+ {
+ char *cname = cp_canonicalize_string (name);
+ if (cname)
+ {
+ modified_name = cname;
+ needtofreename = 1;
+ }
+ }
+
for (objfile = object_files;
objfile != NULL && found_symbol == NULL;
objfile = objfile->next)
@@ -218,9 +235,16 @@ lookup_minimal_symbol (const char *name, const char *sfile,
int match;
if (pass == 1)
- match = strcmp (SYMBOL_LINKAGE_NAME (msymbol), name) == 0;
+ {
+ match = strcmp (SYMBOL_LINKAGE_NAME (msymbol),
+ modified_name) == 0;
+ }
else
- match = SYMBOL_MATCHES_SEARCH_NAME (msymbol, name);
+ {
+ match = SYMBOL_MATCHES_SEARCH_NAME (msymbol,
+ modified_name);
+ }
+
if (match)
{
switch (MSYMBOL_TYPE (msymbol))
@@ -259,6 +283,10 @@ lookup_minimal_symbol (const char *name, const char *sfile,
}
}
}
+
+ if (needtofreename)
+ xfree ((void *) modified_name);
+
/* External symbols are best. */
if (found_symbol)
return found_symbol;