]> Cypherpunks repositories - gostls13.git/commit
cmd/ld: don't generate DW_AT_type attr for unsafe.Pointer to match gcc behavior
authorShenghou Ma <minux.ma@gmail.com>
Thu, 21 Mar 2013 19:58:35 +0000 (03:58 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Thu, 21 Mar 2013 19:58:35 +0000 (03:58 +0800)
commita891b916bd6d284fba0349804da46ad2135e370c
treeb91e370d18f237da5656e082e22543bb060d05d4
parentf74b4d3de3e39fe066c9bc0109122156b273d5f8
cmd/ld: don't generate DW_AT_type attr for unsafe.Pointer to match gcc behavior
gcc generates only attr DW_AT_byte_size for DW_TAG_pointer_type of "void *",
but we used to also generate DW_AT_type pointing to imaginary unspecified
type "void", which confuses some gdb.
This change makes old Apple gdb 6.x (specifically, Apple version gdb-1515)
accepts our binary without issue like this:
(gdb) b 'main.main'
Die: DW_TAG_unspecified_type (abbrev = 10, offset = 47079)
    has children: FALSE
    attributes:
        DW_AT_name (DW_FORM_string) string: "void"
Dwarf Error: Cannot find type of die [in module /Users/minux/go/go2.hg/bin/go]

Special thanks to Russ Cox for pointing out the problem in comment #6 of
CL 7891044.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7744051
src/cmd/ld/dwarf.c