ClangBuiltLinux / boot-utils

Collection of files for booting Linux kernels
26 stars 7 forks source link

gdb: require gdb-multiarch for -g #21

Closed nickdesaulniers closed 4 years ago

nickdesaulniers commented 4 years ago

Since gdb likely was only configured for the those triple.

nathanchance commented 4 years ago

gdb-multiarch is a Debian/Ubuntu thing. We should probably do something like ${GDB:-gdb-multiarch} so that it can be easily overridden from the environment if a user is not on Debian/Ubuntu.

nickdesaulniers commented 4 years ago
diff --git a/boot-qemu.sh b/boot-qemu.sh
index 3b760dc5ae89..8511d86486c3 100755
--- a/boot-qemu.sh
+++ b/boot-qemu.sh
@@ -227,7 +227,9 @@ function invoke_qemu() {
                 -s -S &
             QEMU_PID=$!
             green "Starting GDB..."
-            gdb-multiarch "${KBUILD_DIR}/vmlinux" -ex "target remote :1234"
+            set -x
+            "${GDB:-gdb-multiarch}" "${KBUILD_DIR}/vmlinux" -ex "target remote :1234"
+            set +x
             red "Killing QEMU..."
             kill -9 "${QEMU_PID}"
             wait "${QEMU_PID}" 2>/dev/null

seems to expand to

+ true /android0/kernel-all/vmlinux -ex 'target remote :1234'

am I holding it wrong?

nickdesaulniers commented 4 years ago

ah, right cause we have a local $GDB