From 13aa0d8f578e9c293970fe462f79655899959093 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Fri, 17 Sep 2021 16:21:43 -0700 Subject: [PATCH] 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 --- src/runtime/symtab.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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. -- 2.50.0