Closed aimuz closed 1 year ago
When I add the -ldflags "-buildmode=exe" parameter, he works fine!
Debug info is always included in the executable, -N -l
just disables optimizations. Your problem is different: probably an just old version of delve, but it's hard to tell for sure because you haven't really described what's happening.
You are right, when I use the latest version of dlv he works fine, maybe older versions of dlv don't support PIE format executables?
It was probably this https://github.com/go-delve/delve/pull/3467
thank you
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Master branch compilations cannot be debugged using dlv.
Programs built with the
-gcflags "all=-N -l"
parameter cannot be debugged.After investigation, the problem was caused by changes to https://go-review.googlesource.com/c/go/+/461697
When I change back to the historical version of the code, I can debug it properly
What did you expect to see?
Be able to use dlv to debug programs properly
What did you see instead?
cannot be debugged