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.
Proposal Details
The Go compiler emits dwarf entries with Go-specific attributes. You can find below:
go/src/cmd/internal/dwarf/dwarf.go
Lines 308 to 320 in 8097cf1
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/dwarfpackage be aware of these attributes by including them here. Technically this is part of the public API, hence the proposal.