- struct obstack tempbuf;
- char *result;
-
- if ((symbol == NULL) || (*symbol == '\0'))
- return NULL;
- else if (strcmp (symbol, "_Dmain") == 0)
- return xstrdup ("D main");
-
- obstack_init (&tempbuf);
-
- if (strncmp (symbol, "_D", 2) == 0)
- symbol += 2;
- else
- {
- obstack_free (&tempbuf, NULL);
- return NULL;
- }
-
- if (d_parse_symbol (&tempbuf, symbol) != NULL)
- {
- obstack_grow_str0 (&tempbuf, "");
- result = xstrdup (obstack_finish (&tempbuf));
- obstack_free (&tempbuf, NULL);
- }
- else
- {
- obstack_free (&tempbuf, NULL);
- return NULL;
- }
-
- return result;
+ return gdb_demangle (symbol, options | DMGL_DLANG);
+}
+
+/* la_sniff_from_mangled_name implementation for D. */
+
+static int
+d_sniff_from_mangled_name (const char *mangled, char **demangled)
+{
+ *demangled = d_demangle (mangled, 0);
+ return *demangled != NULL;