From: Cherry Mui Date: Wed, 15 May 2024 01:39:30 +0000 (-0400) Subject: cmd/internal/obj: print symbol index at -S=3 X-Git-Tag: go1.23rc1~343 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=805654077252b0f34fb4323a519618ffad5a611e;p=gostls13.git cmd/internal/obj: print symbol index at -S=3 When the compiler or assembler's -S flag is set to 3 or higher, print the symbol index, for debugging. Change-Id: Ia7a42b0c017105ef12fd97b3e52de0e155b0cf2e Reviewed-on: https://go-review.googlesource.com/c/go/+/585655 LUCI-TryBot-Result: Go LUCI Reviewed-by: Than McIntosh --- diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index ecc583ce4f..3da8c30640 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -839,6 +839,9 @@ func (ctxt *Link) writeSymDebugNamed(s *LSym, name string) { ver := "" if ctxt.Debugasm > 1 { ver = fmt.Sprintf("<%d>", s.ABI()) + if ctxt.Debugasm > 2 { + ver += fmt.Sprintf("", s.PkgIdx, s.SymIdx) + } } fmt.Fprintf(ctxt.Bso, "%s%s ", name, ver) if s.Type != 0 {