]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix output for bad pcHeader
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 17 Sep 2021 23:21:43 +0000 (16:21 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 21 Sep 2021 16:34:59 +0000 (16:34 +0000)
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 <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/symtab.go

index aa9dd7b40c94c1abdf5bacfe5be7c9ca59154e66..87b4eeb22057d18daa1f1c73d1bf961665f49b87 100644 (file)
@@ -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.