/* GDB routines for manipulating the minimal symbol tables.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
#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
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, '/');
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)
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))
}
}
}
+
+ if (needtofreename)
+ xfree ((void *) modified_name);
+
/* External symbols are best. */
if (found_symbol)
return found_symbol;
triggered by a special mst_abs_or_lib or some
such. */
- if (msymbol[hi].type == mst_abs)
+ if (MSYMBOL_TYPE (&msymbol[hi]) == mst_abs)
{
hi--;
continue;