From c5f2ed9d1bbdd7e56323b055e5fbb97e0bbe44b4 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Thu, 25 Jan 2024 02:02:04 +0800 Subject: [PATCH] debug/gosym: add detailed doc for text argument in NewLineTable --- src/debug/gosym/pclntab.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/debug/gosym/pclntab.go b/src/debug/gosym/pclntab.go index 6592932622..50a16f635a 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 +// -linkmode=external is specified. 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)} }