aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/symtab.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2021-04-13 14:12:43 -0400
committerDavid Chase <drchase@google.com>2021-04-13 23:56:27 +0000
commit34620364cb2ea52e0ebf400a9cda91f86cb38a25 (patch)
treeeb3de44e59eb3c92c77245a9cc8aabfc252267d3 /src/runtime/symtab.go
parentf2d5bd1ad306e87804d600d92105dc37279af83f (diff)
downloadgo-34620364cb2ea52e0ebf400a9cda91f86cb38a25.tar.gz
go-34620364cb2ea52e0ebf400a9cda91f86cb38a25.zip
runtime, cgo/test: improve debugging output
tests that run commands should log their actions in a shell-pasteable way. Change-Id: Ifeee88397047ef5a76925c5f30c213e83e535038 Reviewed-on: https://go-review.googlesource.com/c/go/+/309770 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/symtab.go')
-rw-r--r--src/runtime/symtab.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go
index c0630c874e..cf759153e7 100644
--- a/src/runtime/symtab.go
+++ b/src/runtime/symtab.go
@@ -561,7 +561,11 @@ func moduledataverify1(datap *moduledata) {
// Check that the pclntab's format is valid.
hdr := datap.pcHeader
if hdr.magic != 0xfffffffa || hdr.pad1 != 0 || hdr.pad2 != 0 || hdr.minLC != sys.PCQuantum || hdr.ptrSize != sys.PtrSize {
- println("runtime: function symbol table header:", hex(hdr.magic), hex(hdr.pad1), hex(hdr.pad2), hex(hdr.minLC), hex(hdr.ptrSize))
+ print("runtime: function symbol table header:", hex(hdr.magic), hex(hdr.pad1), hex(hdr.pad2), hex(hdr.minLC), hex(hdr.ptrSize))
+ if datap.pluginpath != "" {
+ print(", plugin:", datap.pluginpath)
+ }
+ println()
throw("invalid function symbol table\n")
}
@@ -576,7 +580,11 @@ func moduledataverify1(datap *moduledata) {
if i+1 < nftab {
f2name = funcname(f2)
}
- println("function symbol table not sorted by program counter:", hex(datap.ftab[i].entry), funcname(f1), ">", hex(datap.ftab[i+1].entry), f2name)
+ print("function symbol table not sorted by program counter:", hex(datap.ftab[i].entry), funcname(f1), ">", hex(datap.ftab[i+1].entry), f2name)
+ if datap.pluginpath != "" {
+ print(", plugin:", datap.pluginpath)
+ }
+ println()
for j := 0; j <= i; j++ {
print("\t", hex(datap.ftab[j].entry), " ", funcname(funcInfo{(*_func)(unsafe.Pointer(&datap.pclntable[datap.ftab[j].funcoff])), datap}), "\n")
}