go-delve / delve

Delve is a debugger for the Go programming language.
MIT License
22.37k stars 2.13k forks source link

Issue running debugger on a MAC M2 using vscode/devcontainer against an linux amd64 docker/rosseeta container. #3714

Closed alee-hai closed 2 months ago

alee-hai commented 2 months ago

Please answer the following before submitting your issue:

  1. What version of Delve are you using (dlv version)?

Linux/amd64 Delve Debugger Version: 1.22.1 Build: $Id: 0c3470054da6feac5f6dcf3e3e5144a64f7a9a48 $

Mac M2 Delve Debugger Version: 1.21.2 Build: 6d27a40a05f4a9230139a8f9871b475b17af0c02

  1. What version of Go are you using? (go version)? go version go1.22.1 linux/amd64 go version go1.21.1 darwin/arm64

  2. What operating system and processor architecture are you using? targeted container is linux/amd64 host is mac/m2

  3. What did you do?

Basically I'm trying to use devcontainers to debug my application running on an linux/amd64 but hosted via vscode on a Mac M2. Please note I have no issues when the container is a linux/arm64. It works just fine in this setup. However, when its amd64 I see the issue is the debugger failing to get information from the dap running on the container. Here is the output.

Unable to retrieve goroutines: input/output error

Now the program will compile and run fine. Its just I'm unable debug.

  1. What did you expect to see?

I expected the ability to debug the application in the container and set breakpoints.

  1. What did you see instead?

Failure to attach and debug. Instead targeted program runs.

Not sure if this is expected or an error somewhere.

aarzilli commented 2 months ago

It is not possible to debug emulated programs.