From: Michael Munday Date: Tue, 15 May 2018 17:22:52 +0000 (+0100) Subject: cmd/compile: improve error message emitted by debug info generation X-Git-Tag: go1.11beta1~413 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3797f88f2416c2e6999776a4f8ecd9c7f66401f5;p=gostls13.git cmd/compile: improve error message emitted by debug info generation Before: unexpected at 2721:load with unexpected source op v3278unexpected at 2775:load with unexpected source op v3281unexpected at 2249:load with unexpected source op v3289unexpected at 2875:load with unexpected source op v3278unexpected at 2232:load with unexpected source op v286unexpected at 2231:load with unexpected source op v3291unexpected at 2784:load with unexpected source op v3289unexpected at 2785:load with unexpected source op v3291 After: debug info generation: v2721: load with unexpected source op: Phi (v3278) debug info generation: v2775: load with unexpected source op: Phi (v3281) debug info generation: v2249: load with unexpected source op: Phi (v3289) debug info generation: v2875: load with unexpected source op: Phi (v3278) debug info generation: v2232: load with unexpected source op: Phi (v286) debug info generation: v2231: load with unexpected source op: Phi (v3291) debug info generation: v2784: load with unexpected source op: Phi (v3289) debug info generation: v2785: load with unexpected source op: Phi (v3291) Updates #25404. Change-Id: Ib97722848d27ca18bdcd482a610626bc3c6def7d Reviewed-on: https://go-review.googlesource.com/113275 Run-TryBot: Michael Munday Run-TryBot: Heschi Kreinick TryBot-Result: Gobot Gobot Reviewed-by: Heschi Kreinick --- diff --git a/src/cmd/compile/internal/ssa/debug.go b/src/cmd/compile/internal/ssa/debug.go index 036806182c..d1d767b0a6 100644 --- a/src/cmd/compile/internal/ssa/debug.go +++ b/src/cmd/compile/internal/ssa/debug.go @@ -157,7 +157,7 @@ type RegisterSet uint64 // changing this to a Fprintf(os.Stderr) and running make.bash generates // thousands of warnings. func (s *debugState) unexpected(v *Value, msg string, args ...interface{}) { - s.f.Logf("unexpected at "+fmt.Sprint(v.ID)+":"+msg, args...) + s.f.Logf("debug info generation: "+fmt.Sprint(v)+": "+msg, args...) } func (s *debugState) logf(msg string, args ...interface{}) { @@ -477,7 +477,7 @@ func (state *debugState) liveness() []*BlockDebug { case OpStoreReg: source = a.Args[0] default: - state.unexpected(v, "load with unexpected source op %v", a) + state.unexpected(v, "load with unexpected source op: %v (%v)\n", a.Op, a) } } // Update valueNames with the source so that later steps