]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj: print symbol index at -S=3
authorCherry Mui <cherryyz@google.com>
Wed, 15 May 2024 01:39:30 +0000 (21:39 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 15 May 2024 14:39:06 +0000 (14:39 +0000)
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/internal/obj/objfile.go

index ecc583ce4f3bf243833483d7059b127e75c52aa9..3da8c306405c9033471343f081e317df69e4cabe 100644 (file)
@@ -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("<idx %d %d>", s.PkgIdx, s.SymIdx)
+               }
        }
        fmt.Fprintf(ctxt.Bso, "%s%s ", name, ver)
        if s.Type != 0 {