From edd93411fe4ef5a07b89de25b18562e3bbccdf1f Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 27 Mar 2019 13:45:25 +0100 Subject: [PATCH] dist: De-duplicated AVR debug config & scripts Use common debug.sh, debug_srv.sh and gdb.conf for all AVR boards. --- boards/common/arduino-atmega/dist/debug.sh | 12 ------------ boards/common/arduino-atmega/dist/debug_srv.sh | 7 ------- boards/common/arduino-atmega/dist/gdb.conf | 1 - boards/mega-xplained/dist/debug.sh | 12 ------------ boards/mega-xplained/dist/debug_srv.sh | 7 ------- boards/mega-xplained/dist/gdb.conf | 1 - boards/waspmote-pro/dist/debug.sh | 12 ------------ boards/waspmote-pro/dist/debug_srv.sh | 7 ------- boards/waspmote-pro/dist/gdb.conf | 1 - .../dist => dist/tools/avarice}/debug.sh | 0 .../dist => dist/tools/avarice}/debug_srv.sh | 0 .../dist => dist/tools/avarice}/gdb.conf | 0 makefiles/tools/avrdude.inc.mk | 7 ++++--- 13 files changed, 4 insertions(+), 63 deletions(-) delete mode 100644 boards/common/arduino-atmega/dist/debug.sh delete mode 100644 boards/common/arduino-atmega/dist/debug_srv.sh delete mode 100644 boards/common/arduino-atmega/dist/gdb.conf delete mode 100755 boards/mega-xplained/dist/debug.sh delete mode 100755 boards/mega-xplained/dist/debug_srv.sh delete mode 100644 boards/mega-xplained/dist/gdb.conf delete mode 100755 boards/waspmote-pro/dist/debug.sh delete mode 100755 boards/waspmote-pro/dist/debug_srv.sh delete mode 100644 boards/waspmote-pro/dist/gdb.conf rename {boards/atmega256rfr2-xpro/dist => dist/tools/avarice}/debug.sh (100%) rename {boards/atmega256rfr2-xpro/dist => dist/tools/avarice}/debug_srv.sh (100%) rename {boards/atmega256rfr2-xpro/dist => dist/tools/avarice}/gdb.conf (100%) diff --git a/boards/common/arduino-atmega/dist/debug.sh b/boards/common/arduino-atmega/dist/debug.sh deleted file mode 100644 index 46dc7377ca..0000000000 --- a/boards/common/arduino-atmega/dist/debug.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice -: ${SETSID:=setsid} - -sleep 2 -${SETSID} -w avarice $1 & -#sleep 2 && $2/avr-gdb-wrapper -ex "target remote localhost:$3" $4 -sleep 3 && avr-gdb -ex "target remote localhost:$3" $4 - -# avarice exits with 1 if the connection is released, therefore we always exit with 0 -exit 0 diff --git a/boards/common/arduino-atmega/dist/debug_srv.sh b/boards/common/arduino-atmega/dist/debug_srv.sh deleted file mode 100644 index 8e7de053ab..0000000000 --- a/boards/common/arduino-atmega/dist/debug_srv.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -sleep 2 -avarice $1 - -# avarice exits with 1 if the connection is released, therefore we always exit with 0 -exit 0 diff --git a/boards/common/arduino-atmega/dist/gdb.conf b/boards/common/arduino-atmega/dist/gdb.conf deleted file mode 100644 index ca68eb344c..0000000000 --- a/boards/common/arduino-atmega/dist/gdb.conf +++ /dev/null @@ -1 +0,0 @@ -set $pc=0x00 diff --git a/boards/mega-xplained/dist/debug.sh b/boards/mega-xplained/dist/debug.sh deleted file mode 100755 index 46dc7377ca..0000000000 --- a/boards/mega-xplained/dist/debug.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice -: ${SETSID:=setsid} - -sleep 2 -${SETSID} -w avarice $1 & -#sleep 2 && $2/avr-gdb-wrapper -ex "target remote localhost:$3" $4 -sleep 3 && avr-gdb -ex "target remote localhost:$3" $4 - -# avarice exits with 1 if the connection is released, therefore we always exit with 0 -exit 0 diff --git a/boards/mega-xplained/dist/debug_srv.sh b/boards/mega-xplained/dist/debug_srv.sh deleted file mode 100755 index 8e7de053ab..0000000000 --- a/boards/mega-xplained/dist/debug_srv.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -sleep 2 -avarice $1 - -# avarice exits with 1 if the connection is released, therefore we always exit with 0 -exit 0 diff --git a/boards/mega-xplained/dist/gdb.conf b/boards/mega-xplained/dist/gdb.conf deleted file mode 100644 index ca68eb344c..0000000000 --- a/boards/mega-xplained/dist/gdb.conf +++ /dev/null @@ -1 +0,0 @@ -set $pc=0x00 diff --git a/boards/waspmote-pro/dist/debug.sh b/boards/waspmote-pro/dist/debug.sh deleted file mode 100755 index 46dc7377ca..0000000000 --- a/boards/waspmote-pro/dist/debug.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# The setsid command is needed so that Ctrl+C in GDB doesn't kill avarice -: ${SETSID:=setsid} - -sleep 2 -${SETSID} -w avarice $1 & -#sleep 2 && $2/avr-gdb-wrapper -ex "target remote localhost:$3" $4 -sleep 3 && avr-gdb -ex "target remote localhost:$3" $4 - -# avarice exits with 1 if the connection is released, therefore we always exit with 0 -exit 0 diff --git a/boards/waspmote-pro/dist/debug_srv.sh b/boards/waspmote-pro/dist/debug_srv.sh deleted file mode 100755 index 8e7de053ab..0000000000 --- a/boards/waspmote-pro/dist/debug_srv.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -sleep 2 -avarice $1 - -# avarice exits with 1 if the connection is released, therefore we always exit with 0 -exit 0 diff --git a/boards/waspmote-pro/dist/gdb.conf b/boards/waspmote-pro/dist/gdb.conf deleted file mode 100644 index ca68eb344c..0000000000 --- a/boards/waspmote-pro/dist/gdb.conf +++ /dev/null @@ -1 +0,0 @@ -set $pc=0x00 diff --git a/boards/atmega256rfr2-xpro/dist/debug.sh b/dist/tools/avarice/debug.sh similarity index 100% rename from boards/atmega256rfr2-xpro/dist/debug.sh rename to dist/tools/avarice/debug.sh diff --git a/boards/atmega256rfr2-xpro/dist/debug_srv.sh b/dist/tools/avarice/debug_srv.sh similarity index 100% rename from boards/atmega256rfr2-xpro/dist/debug_srv.sh rename to dist/tools/avarice/debug_srv.sh diff --git a/boards/atmega256rfr2-xpro/dist/gdb.conf b/dist/tools/avarice/gdb.conf similarity index 100% rename from boards/atmega256rfr2-xpro/dist/gdb.conf rename to dist/tools/avarice/gdb.conf diff --git a/makefiles/tools/avrdude.inc.mk b/makefiles/tools/avrdude.inc.mk index c5a317b892..97c283a27b 100644 --- a/makefiles/tools/avrdude.inc.mk +++ b/makefiles/tools/avrdude.inc.mk @@ -1,11 +1,12 @@ FLASHER = avrdude DIST_PATH = $(BOARDSDIR)/$(BOARD)/dist +AVARICE_PATH = $(RIOTTOOLS)/avarice DEBUGSERVER_PORT = 4242 -DEBUGSERVER = $(DIST_PATH)/debug_srv.sh +DEBUGSERVER = $(AVARICE_PATH)/debug_srv.sh DEBUGSERVER_INTERFACE ?= DEBUGSERVER_FLAGS = "-g -j usb $(DEBUGSERVER_INTERFACE) :$(DEBUGSERVER_PORT)" -DEBUGGER_FLAGS = "-x $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE)" -DEBUGGER = $(DIST_PATH)/debug.sh $(DEBUGSERVER_FLAGS) $(DIST_PATH) $(DEBUGSERVER_PORT) +DEBUGGER_FLAGS = "-x $(AVARICE_PATH)/gdb.conf $(ELFFILE)" +DEBUGGER = "$(AVARICE_PATH)/debug.sh" $(DEBUGSERVER_FLAGS) $(AVARICE_PATH) $(DEBUGSERVER_PORT) PROGRAMMER_FLAGS = -p $(subst atmega,m,$(CPU))