diff options
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r-- | gdb/dbxread.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 115bdef..d520266 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, |