aboutsummaryrefslogtreecommitdiff
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/dbxread.c
parent * gdb.texinfo (Ada Tasks): Add documentation about task-specific (diff)
downloadbinutils-gdb-71c25deab3d61e4cfbaffc7006704a27d1bc0737.tar.gz
binutils-gdb-71c25deab3d61e4cfbaffc7006704a27d1bc0737.tar.bz2
binutils-gdb-71c25deab3d61e4cfbaffc7006704a27d1bc0737.zip
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/dbxread.c')
-rw-r--r--gdb/dbxread.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 115bdef32cd..d520266d54c 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1188,6 +1188,8 @@ read_dbx_symtab (struct objfile *objfile)
struct internal_nlist nlist;
CORE_ADDR text_addr;
int text_size;
+ char *sym_name;
+ int sym_len;
char *namestring;
int nsl;
@@ -1681,6 +1683,28 @@ pos %d"),
if (!p)
continue; /* Not a debugging symbol. */
+ sym_len = 0;
+ if (psymtab_language == language_cplus)
+ {
+ char *new_name, *name = alloca (p - namestring + 1);
+ memcpy (name, namestring, p - namestring);
+ name[p - namestring] = '\0';
+ new_name = cp_canonicalize_string (name);
+ if (new_name != NULL)
+ {
+ sym_len = strlen (new_name);
+ sym_name = obsavestring (new_name, sym_len,
+ &objfile->objfile_obstack);
+ xfree (new_name);
+ }
+ }
+
+ if (sym_len == 0)
+ {
+ sym_name = namestring;
+ sym_len = p - namestring;
+ }
+
/* Main processing section for debugging symbols which
the initial read through the symbol tables needs to worry
about. If we reach this point, the symbol which we are
@@ -1698,7 +1722,7 @@ pos %d"),
namestring = gdbarch_static_transform_name (gdbarch,
namestring);
- add_psymbol_to_list (namestring, p - namestring,
+ add_psymbol_to_list (sym_name, sym_len,
VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
0, nlist.n_value,
@@ -1710,7 +1734,7 @@ pos %d"),
data_sect_index);
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
- add_psymbol_to_list (namestring, p - namestring,
+ add_psymbol_to_list (sym_name, sym_len,
VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
0, nlist.n_value,
@@ -1728,7 +1752,7 @@ pos %d"),
|| (p == namestring + 1
&& namestring[0] != ' '))
{
- add_psymbol_to_list (namestring, p - namestring,
+ add_psymbol_to_list (sym_name, sym_len,
STRUCT_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
nlist.n_value, 0,
@@ -1736,7 +1760,7 @@ pos %d"),
if (p[2] == 't')
{
/* Also a typedef with the same name. */
- add_psymbol_to_list (namestring, p - namestring,
+ add_psymbol_to_list (sym_name, sym_len,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
nlist.n_value, 0,
@@ -1749,7 +1773,7 @@ pos %d"),
case 't':
if (p != namestring) /* a name is there, not just :T... */
{
- add_psymbol_to_list (namestring, p - namestring,
+ add_psymbol_to_list (sym_name, sym_len,
VAR_DOMAIN, LOC_TYPEDEF,
&objfile->static_psymbols,
nlist.n_value, 0,
@@ -1829,7 +1853,7 @@ pos %d"),
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- add_psymbol_to_list (namestring, p - namestring,
+ add_psymbol_to_list (sym_name, sym_len,
VAR_DOMAIN, LOC_CONST,
&objfile->static_psymbols, nlist.n_value,
0, psymtab_language, objfile);
@@ -1893,7 +1917,7 @@ pos %d"),
pst->textlow = nlist.n_value;
textlow_not_set = 0;
}
- add_psymbol_to_list (namestring, p - namestring,
+ add_psymbol_to_list (sym_name, sym_len,
VAR_DOMAIN, LOC_BLOCK,
&objfile->static_psymbols,
0, nlist.n_value,
@@ -1961,7 +1985,7 @@ pos %d"),
pst->textlow = nlist.n_value;
textlow_not_set = 0;
}
- add_psymbol_to_list (namestring, p - namestring,
+ add_psymbol_to_list (sym_name, sym_len,
VAR_DOMAIN, LOC_BLOCK,
&objfile->global_psymbols,
0, nlist.n_value,