+2015-07-14 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * dwarf2read.c (find_slot_in_mapped_hash): Extend language support to
+ also test for language_d.
+ (dwarf2_compute_name): Likewise.
+ (read_func_scope): Likewise.
+ (read_structure_type): Likewise.
+ (new_symbol_full): Likewise.
+ (determine_prefix): Likewise.
+ (read_import_statement): Use dot as the separator for language_d.
+ (typename_concat): Likewise, but don't prefix the D main function.
+
2015-07-14 Peter Bergner <bergner@vnet.ibm.com>
* nat/linux-namespaces.c (setns): Rename from this ...
if (current_language->la_language == language_cplus
|| current_language->la_language == language_java
- || current_language->la_language == language_fortran)
+ || current_language->la_language == language_fortran
+ || current_language->la_language == language_d)
{
/* NAME is already canonical. Drop any qualifiers as .gdb_index does
not contain any. */
/* These are the only languages we know how to qualify names in. */
if (name != NULL
&& (cu->language == language_cplus || cu->language == language_java
- || cu->language == language_fortran))
+ || cu->language == language_fortran || cu->language == language_d))
{
if (die_needs_namespace (die, cu))
{
}
else if (strlen (imported_name_prefix) > 0)
canonical_name = obconcat (&objfile->objfile_obstack,
- imported_name_prefix, "::", imported_name,
- (char *) NULL);
+ imported_name_prefix,
+ (cu->language == language_d ? "." : "::"),
+ imported_name, (char *) NULL);
else
canonical_name = imported_name;
lowpc, highpc);
/* For C++, set the block's scope. */
- if ((cu->language == language_cplus || cu->language == language_fortran)
+ if ((cu->language == language_cplus
+ || cu->language == language_fortran
+ || cu->language == language_d)
&& cu->processing_has_namespace_info)
block_set_scope (block, determine_prefix (die, cu),
&objfile->objfile_obstack);
if (name != NULL)
{
if (cu->language == language_cplus
- || cu->language == language_java)
+ || cu->language == language_java
+ || cu->language == language_d)
{
const char *full_name = dwarf2_full_name (name, die, cu);
class. */
if (cu->language == language_cplus
|| cu->language == language_java
- || cu->language == language_ada)
+ || cu->language == language_ada
+ || cu->language == language_d)
{
/* The symbol's name is already allocated along
with this objfile, so we don't need to
char *retval;
if (cu->language != language_cplus && cu->language != language_java
- && cu->language != language_fortran)
+ && cu->language != language_fortran && cu->language != language_d)
return "";
retval = anonymous_struct_prefix (die, cu);
sep = "";
else if (cu->language == language_java)
sep = ".";
+ else if (cu->language == language_d)
+ {
+ /* For D, the 'main' function could be defined in any module, but it
+ should never be prefixed. */
+ if (strcmp (suffix, "D main") == 0)
+ {
+ prefix = "";
+ sep = "";
+ }
+ else
+ sep = ".";
+ }
else if (cu->language == language_fortran && physname)
{
/* This is gfortran specific mangling. Normally DW_AT_linkage_name or