#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"
{
gsymbol->language = language;
if (gsymbol->language == language_cplus
+ || gsymbol->language == language_d
|| gsymbol->language == language_java
|| gsymbol->language == language_objc)
{
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;
}
switch (gsymbol->language)
{
case language_cplus:
+ case language_d:
case language_java:
case language_objc:
if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
switch (gsymbol->language)
{
case language_cplus:
+ case language_d:
case language_java:
case language_objc:
if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
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)
{
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)
{
/* Look up OBJFILE to BLOCK. */
-static struct objfile *
+struct objfile *
lookup_objfile_from_block (const struct block *block)
{
struct objfile *obj;
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)
{
struct cleanup *old_chain;
char *string = NULL;
int len = 0;
+ char **files = NULL;
+ int nfiles = 0;
+
+ if (regexp)
+ {
+ char *colon = strchr (regexp, ':');
+ if (colon && *(colon + 1) != ':')
+ {
+ int colon_index;
+ char * file_name;
+
+ colon_index = colon - regexp;
+ file_name = alloca (colon_index + 1);
+ memcpy (file_name, regexp, colon_index);
+ file_name[colon_index--] = 0;
+ while (isspace (file_name[colon_index]))
+ file_name[colon_index--] = 0;
+ files = &file_name;
+ nfiles = 1;
+ regexp = colon + 1;
+ while (isspace (*regexp)) regexp++;
+ }
+ }
- search_symbols (regexp, FUNCTIONS_DOMAIN, 0, (char **) NULL, &ss);
+ search_symbols (regexp, FUNCTIONS_DOMAIN, nfiles, files, &ss);
old_chain = make_cleanup_free_search_symbols (ss);
make_cleanup (free_current_contents, &string);