diff options
author | Paul N. Hilfinger <hilfinger@adacore.com> | 2004-10-02 09:55:15 +0000 |
---|---|---|
committer | Paul N. Hilfinger <hilfinger@adacore.com> | 2004-10-02 09:55:15 +0000 |
commit | 1f8173e6b8c0646de40ebfe5866b4cfc72a81dad (patch) | |
tree | d8fbae7cad8203ab28bb16c80187466ef079dae0 /gdb/symtab.c | |
parent | 7c1d09598d407e1f37cdbcc843c56359bc9b1a28 (diff) | |
download | gdb-1f8173e6b8c0646de40ebfe5866b4cfc72a81dad.zip gdb-1f8173e6b8c0646de40ebfe5866b4cfc72a81dad.tar.gz gdb-1f8173e6b8c0646de40ebfe5866b4cfc72a81dad.tar.bz2 |
Turn on initial Ada support (mainly expression evaluation).
* Makefile.in (SFILES): Remove ada-tasks.c.
(HFILES_NO_SRCDIR): Add ada-lang.h.
(COMMON_OBS): Add ada-lang.o, ada-typeprint.o, ada-valprint.o.
(YYOBJ): Add ada-exp.o.
(rule .l.c): Generalize to not mention ada.
* symtab.c: Include ada-lang.h.
(symbol_natural_name, symbol_demangled_name)
(symbol_search_name): Add Ada case.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 94b6081..8ed6d9e 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -41,6 +41,7 @@ #include "source.h" #include "filenames.h" /* for FILENAME_CMP */ #include "objc-lang.h" +#include "ada-lang.h" #include "hashtab.h" @@ -634,17 +635,24 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol, char * symbol_natural_name (const struct general_symbol_info *gsymbol) { - if ((gsymbol->language == language_cplus - || gsymbol->language == language_java - || gsymbol->language == language_objc) - && (gsymbol->language_specific.cplus_specific.demangled_name != NULL)) + switch (gsymbol->language) { - return gsymbol->language_specific.cplus_specific.demangled_name; - } - else - { - return gsymbol->name; + case language_cplus: + case language_java: + case language_objc: + if (gsymbol->language_specific.cplus_specific.demangled_name != NULL) + return gsymbol->language_specific.cplus_specific.demangled_name; + break; + case language_ada: + if (gsymbol->language_specific.cplus_specific.demangled_name != NULL) + return gsymbol->language_specific.cplus_specific.demangled_name; + else + return ada_decode_symbol (gsymbol); + break; + default: + break; } + return gsymbol->name; } /* Return the demangled name for a symbol based on the language for @@ -652,13 +660,24 @@ symbol_natural_name (const struct general_symbol_info *gsymbol) char * symbol_demangled_name (struct general_symbol_info *gsymbol) { - if (gsymbol->language == language_cplus - || gsymbol->language == language_java - || gsymbol->language == language_objc) - return gsymbol->language_specific.cplus_specific.demangled_name; - - else - return NULL; + switch (gsymbol->language) + { + case language_cplus: + case language_java: + case language_objc: + if (gsymbol->language_specific.cplus_specific.demangled_name != NULL) + return gsymbol->language_specific.cplus_specific.demangled_name; + break; + case language_ada: + if (gsymbol->language_specific.cplus_specific.demangled_name != NULL) + return gsymbol->language_specific.cplus_specific.demangled_name; + else + return ada_decode_symbol (gsymbol); + break; + default: + break; + } + return NULL; } /* Return the search name of a symbol---generally the demangled or @@ -666,7 +685,10 @@ symbol_demangled_name (struct general_symbol_info *gsymbol) If there is no distinct demangled name, then returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */ char *symbol_search_name (const struct general_symbol_info *gsymbol) { - return symbol_natural_name (gsymbol); + if (gsymbol->language == language_ada) + return gsymbol->name; + else + return symbol_natural_name (gsymbol); } /* Initialize the structure fields to zero values. */ |