diff options
author | Tom Tromey <tromey@redhat.com> | 2013-04-08 19:56:03 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-04-08 19:56:03 +0000 |
commit | f85f34ede85d0c306e689736c6694caa2f0a0f78 (patch) | |
tree | ee949d9e14ec31108f42d2aaea4113f6d4972943 /gdb/symtab.c | |
parent | ccde22c0a47c50f54635b7b9fcbf5ddc19cdf9ca (diff) | |
download | gdb-f85f34ede85d0c306e689736c6694caa2f0a0f78.zip gdb-f85f34ede85d0c306e689736c6694caa2f0a0f78.tar.gz gdb-f85f34ede85d0c306e689736c6694caa2f0a0f78.tar.bz2 |
* ada-lang.c (ada_decode_symbol): Check and set 'ada_mangled'.
Use symbol's obstack, not an objfile.
* coffread.c (process_coff_symbol): Update.
* dwarf2read.c (fixup_go_packaging, new_symbol_full): Update.
* jv-lang.c (add_class_symbol): Update.
* mdebugread.c (new_symbol): Update.
* minsyms.c (prim_record_minimal_symbol_full)
(terminate_minimal_symbol_table): Update.
* psymtab.c (add_psymbol_to_bcache): Clear entire symbol. Update.
* stabsread.c (define_symbol, read_enum_type): Update.
* symtab.c (symbol_set_demangled_name, symbol_get_demangled_name):
Handle Ada specially.
(symbol_set_language): Add 'obstack' argument.
(symbol_set_names): Update.
(symbol_natural_name, symbol_demangled_name): Always use
ada_decode_symbol.
* symtab.h (struct general_symbol_info)
<language_specific::obstack>: New field.
<ada_mangled>: New field.
(SYMBOL_SET_LANGUAGE): Add 'obstack' argument.
(symbol_set_language): Update.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index d56faa6..8ef3966 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -448,6 +448,19 @@ symbol_set_demangled_name (struct general_symbol_info *gsymbol, gsymbol->language_specific.cplus_specific->demangled_name = name; } + else if (gsymbol->language == language_ada) + { + if (name == NULL) + { + gsymbol->ada_mangled = 0; + gsymbol->language_specific.obstack = obstack; + } + else + { + gsymbol->ada_mangled = 1; + gsymbol->language_specific.mangled_lang.demangled_name = name; + } + } else gsymbol->language_specific.mangled_lang.demangled_name = name; } @@ -464,8 +477,14 @@ symbol_get_demangled_name (const struct general_symbol_info *gsymbol) else return NULL; } - else - return gsymbol->language_specific.mangled_lang.demangled_name; + else if (gsymbol->language == language_ada) + { + if (!gsymbol->ada_mangled) + return NULL; + /* Fall through. */ + } + + return gsymbol->language_specific.mangled_lang.demangled_name; } @@ -474,7 +493,8 @@ symbol_get_demangled_name (const struct general_symbol_info *gsymbol) void symbol_set_language (struct general_symbol_info *gsymbol, - enum language language) + enum language language, + struct obstack *obstack) { gsymbol->language = language; if (gsymbol->language == language_d @@ -483,7 +503,12 @@ symbol_set_language (struct general_symbol_info *gsymbol, || gsymbol->language == language_objc || gsymbol->language == language_fortran) { - symbol_set_demangled_name (gsymbol, NULL, NULL); + symbol_set_demangled_name (gsymbol, NULL, obstack); + } + else if (gsymbol->language == language_ada) + { + gdb_assert (gsymbol->ada_mangled == 0); + gsymbol->language_specific.obstack = obstack; } else if (gsymbol->language == language_cplus) gsymbol->language_specific.cplus_specific = NULL; @@ -688,7 +713,7 @@ symbol_set_names (struct general_symbol_info *gsymbol, name[len] = '\0'; gsymbol->name = name; } - symbol_set_demangled_name (gsymbol, NULL, NULL); + symbol_set_demangled_name (gsymbol, NULL, &objfile->objfile_obstack); return; } @@ -815,11 +840,7 @@ symbol_natural_name (const struct general_symbol_info *gsymbol) return symbol_get_demangled_name (gsymbol); break; case language_ada: - if (symbol_get_demangled_name (gsymbol) != NULL) - return symbol_get_demangled_name (gsymbol); - else - return ada_decode_symbol (gsymbol); - break; + return ada_decode_symbol (gsymbol); default: break; } @@ -845,9 +866,7 @@ symbol_demangled_name (const struct general_symbol_info *gsymbol) dem_name = symbol_get_demangled_name (gsymbol); break; case language_ada: - dem_name = symbol_get_demangled_name (gsymbol); - if (dem_name == NULL) - dem_name = ada_decode_symbol (gsymbol); + dem_name = ada_decode_symbol (gsymbol); break; default: break; |