golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.85k stars 17.52k forks source link

cmd/compile: debugger jumps around declarations #32786

Open dlsniper opened 5 years ago

dlsniper commented 5 years ago

What version of Go are you using (go version)?

$ go version
go version devel +9bf62783d2 Wed Jun 26 06:27:56 2019 +0000 windo
ws/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\florin\AppData\Local\go-build
set GOENV=C:\Users\florin\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\go
set GOPRIVATE=
set GOPROXY=direct
set GOROOT=C:\go-master
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\go-master\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\go-samples\debugging\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-m
ap=C:\Users\florin\AppData\Local\Temp\go-build286245954=/tmp/go-b
uild -gno-record-gcc-switches

What did you do?

What did you expect to see?

I would expect the execution pointer to follow the code and step thru the structure construction as it's defined in the code.

What did you see instead?

The execution pointer randomly jumps around, like in this video https://youtu.be/0FcDOg5ez4o (and it happens from command line as well as GoLand so it's not an implementation issue for the UI)

dlsniper commented 5 years ago

I remember @dr2chase and @heschik were interested in such cases, so please have a look. Thank you!

dr2chase commented 5 years ago

I'll put my name on this for now, but won't be working on it for some time yet because of 1.13 release cycle stuff.