Generate gdb-connect file with RTT address automatically

This commit is contained in:
Berkus Decker 2019-03-03 22:06:19 +02:00
parent 2e4bc42cd5
commit 673edf2261
3 changed files with 11 additions and 2 deletions

View File

@ -89,6 +89,7 @@ openocd:
$(OPENOCD) -f interface/jlink.cfg -f ./doc/rpi3_jlink.cfg
gdb: kernel8.img
make nm | grep _SEGGER_RTT | awk '{print $$1}' | ./make-gdb-connect.sh
env RUST_GDB=$(GDB) rust-gdb -x gdb-connect kernel8
gdbdash: kernel8.img

View File

@ -1,2 +0,0 @@
target remote :3333

10
make-gdb-connect.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Generate gdb-connect script with given RTT block address, to avoid typing it in manually
[ $# -ge 1 ] && ADDR="$1" || ADDR=$(cat)
cat <<EOF > gdb-connect
target remote :3333
monitor rttserver start 19021 0
monitor rtt setup 0x$ADDR 24 "SEGGER RTT"
EOF