aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/objfile
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2020-10-15 18:04:08 -0400
committerCherry Zhang <cherryyz@google.com>2020-10-16 14:40:50 +0000
commit20819440fc65d28fabe8f7410ea8fe193cdc53c6 (patch)
tree5931d686fceff113e541b5214a664db7bce708ae /src/cmd/internal/objfile
parent771f5f2e487db4eb2bcf6fa1660dc8cef1feaf14 (diff)
downloadgo-20819440fc65d28fabe8f7410ea8fe193cdc53c6.tar.xz
cmd/internal/objfile: correct file table reading for Go object file
Apparently I never actually understood the new file table in Go object files. The PC value stream actually encodes the file index in the per-CU table. I thought it was indexing into a per-function table, which then contains index to the per-CU table. Remove the extra indirection. Change-Id: I0aea5629f7b3888ebe3a04fea437aa15ce89519e Reviewed-on: https://go-review.googlesource.com/c/go/+/262779 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
Diffstat (limited to 'src/cmd/internal/objfile')
-rw-r--r--src/cmd/internal/objfile/goobj.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cmd/internal/objfile/goobj.go b/src/cmd/internal/objfile/goobj.go
index 7f74a8256c..f19bec5dcb 100644
--- a/src/cmd/internal/objfile/goobj.go
+++ b/src/cmd/internal/objfile/goobj.go
@@ -267,13 +267,11 @@ func (f *goobjFile) PCToLine(pc uint64) (string, int, *gosym.Func) {
}
b := r.BytesAt(r.DataOff(isym), r.DataSize(isym))
var info *goobj.FuncInfo
- lengths := info.ReadFuncInfoLengths(b)
pcline := getSymData(info.ReadPcline(b))
line := int(pcValue(pcline, pc-addr, f.arch))
pcfile := getSymData(info.ReadPcfile(b))
fileID := pcValue(pcfile, pc-addr, f.arch)
- globalFileID := info.ReadFile(b, lengths.FileOff, uint32(fileID))
- fileName := r.File(int(globalFileID))
+ fileName := r.File(int(fileID))
// Note: we provide only the name in the Func structure.
// We could provide more if needed.
return fileName, line, &gosym.Func{Sym: &gosym.Sym{Name: osym.Name(r)}}