Skip to content

Commit fa31093

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 0a8e347 commit fa31093

File tree

1 file changed

+3
-1
lines changed
  • src/cmd/compile/internal/gc

1 file changed

+3
-1
lines changed

src/cmd/compile/internal/gc/ssa.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ func buildssa(fn *Node, worker int) *ssa.Func {
202202
// Populate SSAable arguments.
203203
for _, n := range fn.Func.Dcl {
204204
if n.Class() == PPARAM && s.canSSA(n) {
205-
s.vars[n] = s.newValue0A(ssa.OpArg, n.Type, n)
205+
v := s.newValue0A(ssa.OpArg, n.Type, n)
206+
s.vars[n] = v
207+
s.addNamedValue(n, v) // This helps with debugging information, not needed for compilation itself.
206208
}
207209
}
208210

0 commit comments

Comments
 (0)