From: Josh Bleecher Snyder Date: Fri, 17 Sep 2021 23:21:43 +0000 (-0700) Subject: runtime: fix output for bad pcHeader X-Git-Tag: go1.18beta1~1268 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=13aa0d8f578e9c293970fe462f79655899959093;p=gostls13.git 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 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Go Bot Reviewed-by: Cherry Mui --- diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index aa9dd7b40c..87b4eeb220 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -568,13 +568,11 @@ const debugPcln = false 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 != goarch.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") + if hdr.magic != 0xfffffffa || hdr.pad1 != 0 || hdr.pad2 != 0 || + hdr.minLC != sys.PCQuantum || hdr.ptrSize != goarch.PtrSize { + println("runtime: pcHeader: magic=", hex(hdr.magic), "pad1=", hdr.pad1, "pad2=", hdr.pad2, + "minLC=", hdr.minLC, "ptrSize=", hdr.ptrSize, "pluginpath=", datap.pluginpath) + throw("invalid function symbol table") } // ftab is lookup table for function by program counter.