Issue 100504.1: Extensions for D arrays, associative arrays, and delegates

Author: Robert Clipsham
Champion: John Bishop
Date submitted: 2010-05-04
Date revised:
Date closed:
Type: Enhancement
Status: Rejected
DWARF Version: 5
Currently the D programming language (DW_LANG_D) uses extensions to the spec which conflict with DWARF 4,
I would like to propose their inclusion in DWARF 4 or above. The extensions are as follows:
  DW_TAG_darray_type - D dynamic array type
  DW_TAG_aarray_type - Associative array
  DW_TAG_delegate_type - Delegates (function pointers with context)

In D, these are currently implemented as follows (see
  DW_TAG_darray_type: This is a struct { size_t length; T* ptr; } where T is the type of the array. 
  This type is specified with a DW_AT_type.

  DW_TAG_aarray_type: An associative array, where DW_AT_type is element type and DW_AT_containing_type 
  is the key type.

  DW_TAG_delegate_type: A struct { T* ptr; U* funcptr; } Where T is the type of the context pointer, 
  and U is the type of the function. The context pointer can be a class this reference, a struct 
  this pointer, a pointer to a closure (nested functions) or a pointer to an enclosing function's 
  stack frame (nested functions). This is specified as DW_AT_type: the function type, 
  DW_AT_containing_type is 'this' (context pointer) type.

These details can be changed as required, but I believe it to be preferable to have these included 
in DWARF so extensions are not needed. Sorry if any of these can already be done, I have not had 
chance to check the specification fully.


Rejected -- April 18, 2012.

Preferred method would be adding attributes to existing types.  Unclear whether anyone
is using or still interested in these (or similar) extensions.