-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Debug on Apple M1/M2 when using linux/amd64 devcontainer #10788
Comments
The error is comming from GDB.
This may be an issue with devcontainers or how GDB works within them. You can file a bug on GDB at https://sourceware.org/bugzilla/ |
When I tried to run |
Not a GDB bug...but GDB does get a little confused in this case since I was able to get it working inside a container by following this excellent blog post:
I am sure there's a way to convert the above to a VSCode launch configuration (exercise left to the reader). I am using macOS M2, Ventura 13.4, stock |
Nice workaround. But I'm still struggling debbugging my cpp. I replaced your command with Same configuration: M2, macOS 13.4, colima 0.5.5 |
A segfault under gdb doesn't sound like OP's issue. We were simply seeing the error If it's crashing for you it could be a different issue. I'd say make sure you are starting Colima with |
Hi @KOConchobhair, yes, I'm investigating and apparently the segfault comes from some multithreaded libraries messing around in our code. Still don't now if this issue comes for rosetta emulation or not, but definitely not a gdb issue. Thank you very much! P.s.: for reference your link doesn't not work anymore, here the archived version https://web.archive.org/web/20230419045554/https://sporks.space/2023/04/12/debugging-an-x86-application-in-rosetta-for-linux/ |
I tried this in Visual Studio Code, but I couldn't find a suitable way to convert these instructions to Microsoft's C++ extension. After some effort, I discovered an extension that could address this issue.
Now, you're all set to debug your program. |
idk what is wrong with my setup, this does not work for me, I am running a centos(x86) docker image with docker desktop on M3 pro, it still gives me Couldn't get registers: Input/output error. Can u pls help? |
Hi, have you tried the setup I posted? I think it might be helpful. |
I have the same issue, although trying to debug an application running on a linux/amd64 debian bookworm container through the dev containers extension. Also i'm not sure what the expected behaviour of prepending a binary with the ROSETTA_DEBUGSERVER_PORT environment variable is supposed to do within a container? does it run an instance of gdbserver? whenever i try to attach gdb to the server within the container it throws a timeout. |
Environment
OS and version:
MacOS Ventura, 13.3 (22E252)
VS Code:
Version: 1.77.1 (Universal)
Commit: b7886d7461186a5eac768481578c1d7ca80e2d21
Date: 2023-04-04T23:23:33.779Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: No
C/C++ extension: C++ v1.14.5
OS and version of remote machine (if applicable):
Using devcontainer: mcr.microsoft.com/devcontainers/cpp:0-ubuntu-22.04
Build and running as platform linux/amd64
GDB / LLDB version:
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
lldb version 14.0.0
Bug Summary and Steps to Reproduce
Attaching sample workspace:
sample-cpp.zip
Steps:
Debugger Configurations
tasks.json
Terminal
The text was updated successfully, but these errors were encountered: