diff options
author | Than McIntosh <thanm@google.com> | 2021-04-27 12:40:43 -0400 |
---|---|---|
committer | Than McIntosh <thanm@google.com> | 2021-04-30 19:38:07 +0000 |
commit | 162d4f9c92cb618e8b434e445a842351160fb84d (patch) | |
tree | 49ecd11cc1daf1d98243d318083acf3e5832093b /src/cmd/compile/internal/ssagen | |
parent | 93200b98c75500b80a2bf7cc31c2a72deff2741c (diff) | |
download | go-162d4f9c92cb618e8b434e445a842351160fb84d.tar.gz go-162d4f9c92cb618e8b434e445a842351160fb84d.zip |
cmd/compile: regabi support for DWARF location expressions
Revise the code that generates DWARF location expressions for input
parameters to get it to work properly with the new register ABI when
optimization is turned off.
The previously implementation assumed stack locations for all
input+output parameters when -N (disable optimization) was in effect.
In the new implementation, a register-resident input parameter is
given a 2-element location list, the first list element pointing to
the ABI register(s) containing the param, and the second element
pointing to the stack home once it has been spilled.
NB, this change fixes a bunch of the Delve pkg/proc unit tests (maybe
about half of the outstanding failures). Still a good number that need
to be investigated, however.
Updates #40724.
Updates #45720.
Change-Id: I743bbb9af187bcdebeb8e690fdd6db58094ca415
Reviewed-on: https://go-review.googlesource.com/c/go/+/314431
Trust: Than McIntosh <thanm@google.com>
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssagen')
-rw-r--r-- | src/cmd/compile/internal/ssagen/ssa.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index fb35d8044e..5eda8c4b1c 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -6961,7 +6961,12 @@ func genssa(f *ssa.Func, pp *objw.Progs) { } if base.Ctxt.Flag_locationlists { - debugInfo := ssa.BuildFuncDebug(base.Ctxt, f, base.Debug.LocationLists > 1, StackOffset) + var debugInfo *ssa.FuncDebug + if e.curfn.ABI == obj.ABIInternal && base.Flag.N != 0 { + debugInfo = ssa.BuildFuncDebugNoOptimized(base.Ctxt, f, base.Debug.LocationLists > 1, StackOffset) + } else { + debugInfo = ssa.BuildFuncDebug(base.Ctxt, f, base.Debug.LocationLists > 1, StackOffset) + } e.curfn.DebugInfo = debugInfo bstart := s.bstart idToIdx := make([]int, f.NumBlocks()) |