Ask questionsVariable value printing error on linux/arm64
Please answer the following before submitting your issue:
Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.
What version of Delve are you using (dlv version)?
Delve Debugger
Version: 1.5.0
Build: af250d45126070adbc702fe4ae1b74f19dcfdf97
What version of Go are you using? (go version)?
go version devel +b6dbaef68f Tue Sep 15 23:14:33 2020 +0000 linux/arm64
What operating system and processor architecture are you using? linux/arm64 Ubuntu 18.04.4 LTS
What did you do? $ cat foo.go
package foo
func reset(a []int, i int) []int {
a[i] = 4
return a
}
$ dlv exec go/pkg/tool/linux_arm64/compile -- foo.go (dlv) b go/src/cmd/compile/internal/ssa/prove.go:761 (dlv) c (dlv) n (dlv) p ft.unsat false (dlv) s (dlv) p ft.unsat true
Answer
questions
erifan
The variable is in fact false, the code is https://github.com/golang/go/blob/1ee30d25c517cfa5674a35754602f1a9ba3562f4/src/cmd/compile/internal/ssa/prove.go#L761. After ft is created, ft.unsat is false, and then ft calls checkpoint. Just enter this function and print ft.unsat again, it becomes true. Obviously, it has not been changed. Debug the same program with dlv on linux/amd64, the print is correct.