Skip to content

Instantly share code, notes, and snippets.

@cppio
Created April 20, 2024 23:55
Show Gist options
  • Select an option

  • Save cppio/33b9e89d7c2ec1a00eb1a3b66cf29d5d to your computer and use it in GitHub Desktop.

Select an option

Save cppio/33b9e89d7c2ec1a00eb1a3b66cf29d5d to your computer and use it in GitHub Desktop.
An example of using gdb inside of Docker on macOS
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