docker: replace qemu_gdb.sh with passing --gdb to gemu_run.sh
What changed, and why it matters
This commit is a routine developer tooling cleanup. It removes a separate debug script and instead lets the same launch script start the emulator in debugger mode when a --gdb flag is passed. There is no change to the actual Jade firmware or to how end-user devices behave.
No security action required. Treat as normal maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch refactors QEMU launch scripts for the Blockstream Jade firmware build environment. qemu_gdb.sh is deleted and its contents (starting qemu-system-xtensa with -s -S and then attaching xtensa-esp32-elf-gdb) are merged into qemu_run.sh under a conditional –gdb argument. Dockerfile.qemu is updated to pass $QEMU_GDB to qemu_run.sh. The change affects only local emulation/debug workflows and does not modify firmware code, cryptography, network services, or hardware security boundaries.
Changed components
main/qemu/qemu_run.shmain/qemu/qemu_gdb.shDockerfile.qemuInspect captured patch +18 / −28
diff --git a/Dockerfile.qemu b/Dockerfile.qemu
index f3446c0..264a455 100644
--- a/Dockerfile.qemu
+++ b/Dockerfile.qemu
@@ -1,6 +1,7 @@
FROM blockstream/jade_builder@sha256:6937ea8808b89fe3510af6e156da4495d313c0ec7d3370108896ed50b605d237
ARG QEMU_CONFIG_ARGS="--dev --ci --psram"
+ARG QEMU_GDB=""
WORKDIR /jade
@@ -8,4 +9,4 @@ COPY . .
RUN ./tools/switch_to.sh qemu ${QEMU_CONFIG_ARGS}
RUN cd /opt/esp/idf && . ./export.sh && cd /jade && idf.py all && ./tools/fwprep.py build/jade.bin build
RUN ./main/qemu/make-flash-img.sh
-CMD [ "/jade/main/qemu/qemu_run.sh" ]
+CMD [ "/jade/main/qemu/qemu_run.sh", "$QEMU_GDB" ]
diff --git a/main/qemu/qemu_gdb.sh b/main/qemu/qemu_gdb.sh
deleted file mode 100755
index 695db77..0000000
--- a/main/qemu/qemu_gdb.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env bash
-#
-if [ -z "${IDF_PATH}" ]; then
- pushd /opt/esp/idf && . ./export.sh && popd
-fi
-
-pkill -f qemu-system-xtensa || true
-
-qemu-system-xtensa -s -S -nographic \
- -machine esp32 \
- -m 4M \
- -drive file=/flash_image.bin,if=mtd,format=raw \
- -nic user,model=open_eth,id=lo0,hostfwd=tcp:0.0.0.0:30121-:30121 \
- -drive file=/qemu_efuse.bin,if=none,format=raw,id=efuse \
- -global driver=nvram.esp32.efuse,property=drive,value=efuse \
- -serial pty &
-
-sleep 2
-
-xtensa-esp32-elf-gdb /jade/build/jade.elf \
- -ex "target remote :1234" \
- -ex "monitor system_reset" \
- -ex "tb app_main" -ex "c" \
- -ex "b main.c:120"\
- -ex 'info b' -ex 'set print pretty on'
diff --git a/main/qemu/qemu_run.sh b/main/qemu/qemu_run.sh
index 31840a7..915d4e1 100755
--- a/main/qemu/qemu_run.sh
+++ b/main/qemu/qemu_run.sh
@@ -6,12 +6,26 @@ fi
pkill -f qemu-system-xtensa || true
-qemu-system-xtensa -nographic \
+if [ "$1" = "--gdb" ]; then
+ EXTRA_ARGS="-s -S"
+ BG="&"
+fi
+
+qemu-system-xtensa $EXTRA_ARGS -nographic \
-machine esp32 \
-m 4M \
-drive file=/flash_image.bin,if=mtd,format=raw \
-nic user,model=open_eth,id=lo0,hostfwd=tcp:0.0.0.0:30122-:30122,hostfwd=tcp:0.0.0.0:30121-:30121 \
-drive file=/qemu_efuse.bin,if=none,format=raw,id=efuse \
-global driver=nvram.esp32.efuse,property=drive,value=efuse \
- -serial pty
+ -serial pty $BG
#-serial mon:stdio
+
+if [ "$1" = "--gdb" ]; then
+ xtensa-esp32-elf-gdb /jade/build/jade.elf \
+ -ex "target remote :1234" \
+ -ex "monitor system_reset" \
+ -ex "tb app_main" -ex "c" \
+ -ex "b main.c:120"\
+ -ex 'info b' -ex 'set print pretty on'
+fi
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.