aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-04-29 14:45:39 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-04-29 14:45:39 +0000
commit6aecb9c22867107c03be7d1650fd4d2483f7e380 (patch)
tree53b891fe3b0e1a3778af88c4c03b4cd219aab26e /gdb/symtab.c
parent77db8e2e96ba37bb1915261d21f7287f15b67bf8 (diff)
downloadgdb-6aecb9c22867107c03be7d1650fd4d2483f7e380.zip
gdb-6aecb9c22867107c03be7d1650fd4d2483f7e380.tar.gz
gdb-6aecb9c22867107c03be7d1650fd4d2483f7e380.tar.bz2
D language support.
gdb/ChangeLog: D language support. * Makefile.in (SFILES): Add d-lang.c d-valprint.c. (COMMON_OBS): Add d-lang.o d-valprint.o. (HFILES_NO_SRCDIR): Add d-lang.h. * NEWS: Mention D language support. * c-lang.c (c_emit_char, exp_descriptor_c): Make public. * c-lang.h (c_emit_char, exp_descriptor_c): Add declaration. * d-lang.c: New file. * d-lang.h: New file. * d-valprint.c: New file. * defs.h (enum language): Add language_d. * dwarf2read.c (set_cu_language): Add DW_LANG_D. * language.c (binop_result_type, integral_type, character_type) (string_type, boolean_type, structured_type): Add language_d. * symfile.c (init_filename_language_table): Add language_d. * symtab.c: Include d-lang.h. (symbol_init_language_specific, symbol_find_demangled_name) (symbol_natural_name, lookup_symbol_in_language) (symbol_demangled_name, symbol_matches_domain): Add language_d. gdb/doc/ChangeLog: * gdb.texinfo: (Summary) Add mention about D language support. (Filenames): Add D suffixes. (D): New node. gdb/testsuite/ChangeLog: * gdb.base/default.exp: Fix "set language" test.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 1d6b648..67a784b 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -39,6 +39,7 @@
#include "source.h"
#include "filenames.h" /* for FILENAME_CMP */
#include "objc-lang.h"
+#include "d-lang.h"
#include "ada-lang.h"
#include "p-lang.h"
#include "addrmap.h"
@@ -346,6 +347,7 @@ symbol_init_language_specific (struct general_symbol_info *gsymbol,
{
gsymbol->language = language;
if (gsymbol->language == language_cplus
+ || gsymbol->language == language_d
|| gsymbol->language == language_java
|| gsymbol->language == language_objc)
{
@@ -449,6 +451,16 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
return demangled;
}
}
+ if (gsymbol->language == language_d
+ || gsymbol->language == language_auto)
+ {
+ demangled = d_demangle(mangled, 0);
+ if (demangled != NULL)
+ {
+ gsymbol->language = language_d;
+ return demangled;
+ }
+ }
return NULL;
}
@@ -626,6 +638,7 @@ symbol_natural_name (const struct general_symbol_info *gsymbol)
switch (gsymbol->language)
{
case language_cplus:
+ case language_d:
case language_java:
case language_objc:
if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
@@ -651,6 +664,7 @@ symbol_demangled_name (const struct general_symbol_info *gsymbol)
switch (gsymbol->language)
{
case language_cplus:
+ case language_d:
case language_java:
case language_objc:
if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
@@ -940,7 +954,7 @@ lookup_symbol_in_language (const char *name, const struct block *block,
modified_name = name;
- /* If we are using C++ or Java, demangle the name before doing a lookup, so
+ /* If we are using C++, D, or Java, demangle the name before doing a lookup, so
we can always binary search. */
if (lang == language_cplus)
{
@@ -972,6 +986,15 @@ lookup_symbol_in_language (const char *name, const struct block *block,
make_cleanup (xfree, demangled_name);
}
}
+ else if (lang == language_d)
+ {
+ demangled_name = d_demangle (name, 0);
+ if (demangled_name)
+ {
+ modified_name = demangled_name;
+ make_cleanup (xfree, demangled_name);
+ }
+ }
if (case_sensitivity == case_sensitive_off)
{
@@ -1412,6 +1435,7 @@ symbol_matches_domain (enum language symbol_language,
A Java class declaration also defines a typedef for the class.
Similarly, any Ada type declaration implicitly defines a typedef. */
if (symbol_language == language_cplus
+ || symbol_language == language_d
|| symbol_language == language_java
|| symbol_language == language_ada)
{