go/src/cmd/internal
Than McIntosh 5e1dcb7a04 cmd/compile: workaround for inconsistent receiver param srcpos
Given an inlinable method M in package P:

   func (r *MyStruct) M(...) {

When M is compiled within its home package, the source position that
the compiler records for 'r' (receiver parameter variable) is
accurate, whereas if M is built as part of the compilation of some
other package (body read from export data), the declaration line
assigned to 'r' will be the line number of the 'import' directive, not
the source line from M's source file.

This inconsistency can cause differences in the size of abstract
parameter DIEs (due to variable-length encoding), which can then in
turn result in bad abstract origin offsets, which in turn triggers
build failures on iOS (dsymutil crashes when it encounters an
incorrect abstract origin reference).

Work around the problem by removing the "declaration line number"
attribute within the abstract parameter abbreviation table entry. The
decl line attribute doesn't contribute a whole lot to the debugging
experience, and it gets rid of the inconsistencies that trigger the
dsymutil crashes.

Updates #23374.

Change-Id: I0fdc8e19a48db0ccd938ceadf85103936f89ce9f
Reviewed-on: https://go-review.googlesource.com/87055
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2018-01-10 19:11:35 +00:00
..
bio cmd/internal/obj: remove use of package bio 2016-04-14 17:58:33 +00:00
browser cmd/internal/browser: fix typo 2017-02-24 20:49:10 +00:00
buildid cmd/go: add support for build IDs with gccgo 2018-01-05 22:41:35 +00:00
dwarf cmd/compile: workaround for inconsistent receiver param srcpos 2018-01-10 19:11:35 +00:00
edit cmd/cover: modify source as text, not as AST 2017-11-13 14:59:26 +00:00
gcprog cmd/{asm,compile/internal}: delete dead code 2016-08-25 12:20:29 +00:00
goobj cmd/go: implement per-package asmflags, gcflags, ldflags, gccgoflags 2017-11-09 15:04:04 +00:00
obj cmd/internal/obj/arm: fix wrong encoding of NMULAF/NMULAD/NMULSF/NMULSD 2017-12-21 16:30:51 +00:00
objabi cmd/link: set runtime.GOROOT default during link 2018-01-09 21:46:18 +00:00
objfile cmd/internal/objfile: make lookupFunc an alias type 2017-11-29 22:22:38 +00:00
src cmd/compile: record original and absolute file names for line directives 2017-11-13 16:47:41 +00:00
sys cmd: remove IntSize and Widthint 2017-04-22 17:43:43 +00:00
test2json cmd/test2json: emit Benchmark name output early 2018-01-09 01:53:38 +00:00