From: David Chase Date: Thu, 11 Oct 2018 21:48:33 +0000 (-0400) Subject: cmd/compile: attach slots to incoming params for better debugging X-Git-Tag: go1.12beta1~726 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fa31093ec4e9bbfce51c11c8ab90dd9b711d0052;p=gostls13.git cmd/compile: attach slots to incoming params for better debugging This change attaches a slots to the OpArg values for incoming params, and this in turn causes location lists to be generated for params, and that yields better debugging, in delve and sometimes in gdb. The parameter lifetimes could start earlier; they are in fact defined on entry, not at the point where the OpArg is finally mentioned. (that will be addressed in another CL) Change-Id: Icca891e118291d260c35a14acd5bc92bb82d9e9f Reviewed-on: https://go-review.googlesource.com/c/141697 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index d3a30879db..3818aaf6b0 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -202,7 +202,9 @@ func buildssa(fn *Node, worker int) *ssa.Func { // Populate SSAable arguments. for _, n := range fn.Func.Dcl { if n.Class() == PPARAM && s.canSSA(n) { - s.vars[n] = s.newValue0A(ssa.OpArg, n.Type, n) + v := s.newValue0A(ssa.OpArg, n.Type, n) + s.vars[n] = v + s.addNamedValue(n, v) // This helps with debugging information, not needed for compilation itself. } }