Improvement suggestions very welcome including automatically loading gdb commands etc
FROM --platform=linux/amd64 ubuntu:22.04
RUN apt update && apt install git vim curl python3 binutils-multiarch file gdb gdb-multiarch -y
RUN git clone https://github.com/longld/peda.git ~/peda && \
echo "source ~/peda/peda.py" > ~/.gdbinit && \
echo "set architecture i386:x86-64\ntarget remote localhost:1234" > /x86-64 # this line doesnt do anything atm. 🚧
docker run --rm -it -v $PWD:/data --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --platform=linux/amd64 securisec/gdb /bin/bash
In terminal 1
Run LC_CTYPE=C.UTF-8 gdb
normally without any binaries
The following commands are run inside gdb
(gdb) set architecture i386:x86-64
# Read symbols. Without this, peda does not show the registers sometimes
(gdb) file /target_binary
# gbd remote debugging
(gdb) target remote localhost:1234
In Terminal 2
, run the target binary with the following command
ROSETTA_DEBUGSERVER_PORT=1234 ./target_binary