Commit 125d1e92 authored by Rob Pike's avatar Rob Pike

ld: change DWARF output for structs

The debug/dwarf package cannot parse the format generated here,
but the format can be changed so it does.
After this edit, tweaking the expression defining the offset
of a struct field, the dwarf package can parse the tables (again?).

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/105710043
parent 5c2f01f3
......@@ -835,11 +835,8 @@ newmemberoffsetattr(DWDie *die, int32 offs)
int i;
i = 0;
if (offs != 0) {
block[i++] = DW_OP_consts;
i += sleb128enc(offs, block+i);
block[i++] = DW_OP_plus;
}
block[i++] = DW_OP_plus_uconst;
i += uleb128enc(offs, block+i);
newattr(die, DW_AT_data_member_location, DW_CLS_BLOCK, i, mal(i));
memmove(die->attr->data, block, i);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment