dist/tools/avarice: Detect GDB automatically
While some users likely still use avr-gdb, more and more systems are starting to use gdb-multiarch. In order to work in both cases, the script now just checks which version is installed. (If both are installed, gdb-multiarch is preferred.)
This commit is contained in:
parent
793e1122eb
commit
fa189c4c1d
11
dist/tools/avarice/debug.sh
vendored
11
dist/tools/avarice/debug.sh
vendored
@ -3,9 +3,18 @@
|
|||||||
# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice
|
# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice
|
||||||
: ${SETSID:=setsid}
|
: ${SETSID:=setsid}
|
||||||
|
|
||||||
|
if gdb-multiarch -v > /dev/null; then
|
||||||
|
GDB=gdb-multiarch
|
||||||
|
elif avr-gdb -v > /dev/null; then
|
||||||
|
GDB=avr-gdb
|
||||||
|
else
|
||||||
|
echo "Couldn't find multiarch GDB or AVR GDB. Check \$PATH."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
${SETSID} -w avarice $1 &
|
${SETSID} -w avarice $1 &
|
||||||
sleep 3 && avr-gdb -ex "target remote localhost:$3" $4
|
sleep 3 && $GDB -ex "target remote localhost:$3" $4
|
||||||
|
|
||||||
# avarice exits with 1 if the connection is released, therefore we always exit with 0
|
# avarice exits with 1 if the connection is released, therefore we always exit with 0
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user