There are some Linux distributions that gdb-multiarch doesn't work as expected and debug section not start. Since AVARICE is dedicated to AVR architecture, let's check first by the default tool then multiarch version. Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
21 lines
491 B
Bash
Executable File
21 lines
491 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice
|
|
: ${SETSID:=setsid}
|
|
|
|
if avr-gdb -v > /dev/null; then
|
|
GDB=avr-gdb
|
|
elif gdb-multiarch -v > /dev/null; then
|
|
GDB=gdb-multiarch
|
|
else
|
|
echo "Couldn't find multiarch GDB or AVR GDB. Check \$PATH."
|
|
exit 1
|
|
fi
|
|
|
|
sleep 2
|
|
${SETSID} -w avarice $1 &
|
|
sleep 3 && $GDB -ex "target remote localhost:$3" $4
|
|
|
|
# avarice exits with 1 if the connection is released, therefore we always exit with 0
|
|
exit 0
|