Created
April 20, 2024 23:55
-
-
Save cppio/33b9e89d7c2ec1a00eb1a3b66cf29d5d to your computer and use it in GitHub Desktop.
An example of using gdb inside of Docker on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run -it --rm alpine | |
| # inside | |
| apk add gdb-multiarch | |
| wget https://gist.githubusercontent.com/cppio/6576572073a424b01b9d0c9a2e4bade5/raw/42aa93d2be602e343792a59587d7a8ad7152a7d8/hello.x86_64 | |
| chmod +x hello.x86_64 | |
| ROSETTA_DEBUGSERVER_PORT=12345 ./hello.x86_64 & | |
| gdb-multiarch hello.x86_64 -ex 'tar rem :12345' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment