Skip to content

debuginfo: Generate DW_TAG_template_type_parameter DIEs for generic types #9224

Description

@michaelwoerister

Section 5.5.8 Class Template Instantiations of the DWARF 4 standard says:

A class template instantiation is represented by a debugging information entry with the tag DW_TAG_class_type, DW_TAG_structure_type or DW_TAG_union_type. With five exceptions, such an entry will contain the same attributes and have the same types of child entries as would an entry for a class type defined explicitly using the instantiation types and values.

and later (two of the five mentioned exceptions):

Each formal parameterized type declaration appearing in the template definition is
represented by a debugging information entry with the tag DW_TAG_template_type_parameter. [...]

The class type entry and each of its child entries references a template type parameter entry in any circumstance where the source template definition references a formal parameterized type. [...]

These things are not done yet: For generic types we describe their monomorphized version, losing the information that they stem from a generic definition. In order to fix this issue, the following two things need to be done:

  1. Create DW_TAG_template_type_parameter metadata entries for each generic parameter like already done for generic functions.
  2. Reference these metadata entries where they are use in the type definition---instead of directly referencing the type they have been substituted by.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-enhancementCategory: An issue proposing an enhancement or a PR with one.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions