Skip to content

Commit 13aa0d8

Browse files
committed
runtime: fix output for bad pcHeader
With print, the output all runs together. Take this opportunity to clean up and label all the fields. Print pluginpath unilaterally; no reason not to. Wrap long lines. Remove pointless newline from throw. Change-Id: I37af15dc8fcb3dbdbc6da8bbea2c0ceaf7b5b889 Reviewed-on: https://go-review.googlesource.com/c/go/+/350734 Trust: Josh Bleecher Snyder <[email protected]> Run-TryBot: Josh Bleecher Snyder <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 901ac46 commit 13aa0d8

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/runtime/symtab.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,11 @@ const debugPcln = false
568568
func moduledataverify1(datap *moduledata) {
569569
// Check that the pclntab's format is valid.
570570
hdr := datap.pcHeader
571-
if hdr.magic != 0xfffffffa || hdr.pad1 != 0 || hdr.pad2 != 0 || hdr.minLC != sys.PCQuantum || hdr.ptrSize != goarch.PtrSize {
572-
print("runtime: function symbol table header:", hex(hdr.magic), hex(hdr.pad1), hex(hdr.pad2), hex(hdr.minLC), hex(hdr.ptrSize))
573-
if datap.pluginpath != "" {
574-
print(", plugin:", datap.pluginpath)
575-
}
576-
println()
577-
throw("invalid function symbol table\n")
571+
if hdr.magic != 0xfffffffa || hdr.pad1 != 0 || hdr.pad2 != 0 ||
572+
hdr.minLC != sys.PCQuantum || hdr.ptrSize != goarch.PtrSize {
573+
println("runtime: pcHeader: magic=", hex(hdr.magic), "pad1=", hdr.pad1, "pad2=", hdr.pad2,
574+
"minLC=", hdr.minLC, "ptrSize=", hdr.ptrSize, "pluginpath=", datap.pluginpath)
575+
throw("invalid function symbol table")
578576
}
579577

580578
// ftab is lookup table for function by program counter.

0 commit comments

Comments
 (0)