How to debug linux/amd64 applications on Macbook with arm64? #4011
Closed
hitzhangjie
started this conversation in
Ideas
Replies: 2 comments
-
On un-emulated darwin we launch debugserver and speak to it using a text protocol; the code for this is in pkg/proc/gdbserial. I suspect it could be possible to adapt it to connect to the debugserver provided by rosetta. Some of the code in gdbserial uses runtime.GOOS and runtime.GOARCH, that would have to be changed and also we'd have to detect that rosetta will be used and set ROSETTA_DEBUGSERVER_PORT before starting the inferior. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Closing, duplicate of #2910 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I encounter this problem and search the relevant issues:
rosetta will convert the amd64 instructions to arm64 instructions ahead-of-time, so it can run in nearly native speed.
dlv debugging may encounter problems:
I found many dlv users reported similar issues. Don't know if can work around this.
I found this: https://sporks.space/2023/04/12/debugging-an-x86-application-in-rosetta-for-linux/
This article said rosetta has an environment to wait for a incoming debugging connection. I think this special embeded debugger may handle some special logic for debugger frontend.
I haven't tested as the article says. Just want to discuss the difficulties and underlying solutions if we want to work around this.
If we can fix this with limited efforts, it would be great.
Beta Was this translation helpful? Give feedback.
All reactions