aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorZxilly <zxilly@outlook.com>2024-01-24 21:27:41 +0000
committerCherry Mui <cherryyz@google.com>2024-01-25 19:43:24 +0000
commit6a861010be9eed02d5285509cbaf3fb26d2c5041 (patch)
treef34375980442c98780cae8e0f8e6bc25d80ef4ce /src/debug
parent4fde3ef2acef11738c83f6ad9147eba03b5da6d1 (diff)
downloadgo-6a861010be9eed02d5285509cbaf3fb26d2c5041.tar.gz
go-6a861010be9eed02d5285509cbaf3fb26d2c5041.zip
debug/gosym: add detailed doc for text argument in NewLineTable
Fixes #65232 Change-Id: I9ef76355cec4bea2d77811a69c61c1806c486be8 GitHub-Last-Rev: 9c617b65be9b01e9708e05a540316f98c8a0d165 GitHub-Pull-Request: golang/go#65263 Reviewed-on: https://go-review.googlesource.com/c/go/+/557957 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/gosym/pclntab.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/debug/gosym/pclntab.go b/src/debug/gosym/pclntab.go
index 6592932622..1d5498e037 100644
--- a/src/debug/gosym/pclntab.go
+++ b/src/debug/gosym/pclntab.go
@@ -148,7 +148,11 @@ func (t *LineTable) LineToPC(line int, maxpc uint64) uint64 {
// NewLineTable returns a new PC/line table
// corresponding to the encoded data.
// Text must be the start address of the
-// corresponding text segment.
+// corresponding text segment, with the exact
+// value stored in the 'runtime.text' symbol.
+// This value may differ from the start
+// address of the text segment if
+// binary was built with cgo enabled.
func NewLineTable(data []byte, text uint64) *LineTable {
return &LineTable{Data: data, PC: text, Line: 0, funcNames: make(map[uint32]string), strings: make(map[uint32]string)}
}