Skip to content

proposal: debug/dwarf: define Go-specific attributes #73752

@ajwerner

Description

@ajwerner

Proposal Details

The Go compiler emits dwarf entries with Go-specific attributes. You can find below:

// Go-specific type attributes.
const (
DW_AT_go_kind = 0x2900
DW_AT_go_key = 0x2901
DW_AT_go_elem = 0x2902
// Attribute for DW_TAG_member of a struct type.
// Nonzero value indicates the struct field is an embedded field.
DW_AT_go_embedded_field = 0x2903
DW_AT_go_runtime_type = 0x2904
DW_AT_go_package_name = 0x2905 // Attribute for DW_TAG_compile_unit
DW_AT_go_dict_index = 0x2906 // Attribute for DW_TAG_typedef_type, index of the dictionary entry describing the real type of this type shape
DW_AT_go_closure_offset = 0x2907 // Attribute for DW_TAG_variable, offset in the closure struct where this captured variable resides

The Go stdlib also happens to include a library for parsing and analyzing DWARF in debug/dwarf. Unfortunately, the Go-specific attributes are not supported by that library.

This proposal suggests that the debug/dwarf package be aware of these attributes by including them here. Technically this is part of the public API, hence the proposal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions