You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run a simple go file using go run <file>. Start another process using go build -o output <file>; ./output. Then I tried to attach debuggers to both these processes.
What did you expect to see?
I expected to be able to successfully attach debuggers to these processes.
What did you see instead?
But, the debug symbols are missing from the executable created using go run. In https://golang.org/src/cmd/go/internal/run/run.go, there is p.Internal.OmitDebug = true without any option to override.
There is no mention of this behavior in https://golang.org/pkg/cmd/go/internal/run/. Without looking at the source code, it's quite difficult to understand why debugger can't be attached to the process run using go run.
The text was updated successfully, but these errors were encountered:
This is intentional behavior. go run is a convenience function that builds and runs a program for you. Since a program that is run by go run is not run under the debugger, go run is made a little faster by not building any debug information. Attaching a debugger to a program run by go run is corner case that we have decided to not support. Use go build instead.
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?
Run a simple go file using
go run <file>
. Start another process usinggo build -o output <file>; ./output
. Then I tried to attach debuggers to both these processes.What did you expect to see?
I expected to be able to successfully attach debuggers to these processes.
What did you see instead?
But, the debug symbols are missing from the executable created using
go run
. In https://golang.org/src/cmd/go/internal/run/run.go, there isp.Internal.OmitDebug = true
without any option to override.There is no mention of this behavior in https://golang.org/pkg/cmd/go/internal/run/. Without looking at the source code, it's quite difficult to understand why debugger can't be attached to the process run using
go run
.The text was updated successfully, but these errors were encountered: