When cover is used with cgo packages, the coverage profile is produced
from the cgo-generated Go source files, so the profile will reference
line and column numbers from that generated source, even though it names
the original file.
This is okay in general because the cgo-generated Go source files are
very similar to the original, with one significant exception:
the original source may refer to C identifiers such as C.foo(), but the
cgo tool generates source that rewrites these mentions to something like
_Cfunc_foo.
This means that column numbers in coverage profiles might be higher than
they should be, so be lenient when interpreting them.
Update golang/go#9479
Change-Id: Ic3abef07471614101ce0c686d35b85e7e5e6a777
Reviewed-on: https://go-review.googlesource.com/2410
Reviewed-by: Rob Pike <r@golang.org>
Split the profile parsing code out of cmd/cover into
a reusable package, to support third-party coverage
tools.
R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/36050045