New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: degraded debug info for incoming parameters with regabi enabled #45945
Comments
Change https://golang.org/cl/316890 mentions this issue: |
When the expand_calls phase in the SSA backend lowers prolog OpArg values into OpArgIntReg/OpArgFloatReg values, we don't always record the assocation between the new lowered value and the parameter name. This patch handles the simple case where a given parameter fits into exactly one register; in this scenario it makes sense to manufacture a new pseudo-slot for the value that points to the param, and install the slot/value mapping in the NamedValues table for the function. More work will be needed to deal with params that span multiple registers; that will need to be addressed in a subsequent patch. This change improves the parameter error rate "optargorder" benchmark by about 7-8% (when run on the optargorder binary). Updates #45945. Change-Id: Ic9adbe20b6f91145d49651348818f0f5cba92b18 Reviewed-on: https://go-review.googlesource.com/c/go/+/316890 Trust: Than McIntosh <thanm@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
With https://golang.org/cl/316890, we're now getting the same debugging experience on tip as 1.16 for the example cited in this issue. There is still work to do to improve things for composite parameters, however. I'm going to hold this issue open for a bit longer in case there are short-term / limited things we can do go improve the situation. |
What version of Go are you using (
go version
)?Using 1.17 / tip
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
Compile this program:
https://play.golang.org/p/rKyJWXA7hGK
then bring it up under a debugger (gdb or delve), set a breakpoint in main.ABC, and examine the values of the incoming parameters.
What did you expect to see?
Debugger can print values for live params that are live (e.g. all except "s"). E.g.
What did you see instead?
In 1.17, we get no debug locations for any of the parameters except "b"; all others are "optimized out". This is a fairly large degradation in debug info quality.
Looking at what is happening in the compiler, the problems are primarily due to new code paths that implement the new register ABI; if you build the same program with GOEXPERIMENT=noregabi, the debugging experience for incoming parameters is about the same as 1.16.
The text was updated successfully, but these errors were encountered: