From eea59bf805a73601f2e7e5bc33a45787dd9ec4bb Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 22 Sep 2015 11:35:23 +0200 Subject: [PATCH] iotlab: add capability to create and connect to debug server --- dist/testbed-support/Makefile.iotlab | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dist/testbed-support/Makefile.iotlab b/dist/testbed-support/Makefile.iotlab index b1faf643b0..8c47932f87 100644 --- a/dist/testbed-support/Makefile.iotlab +++ b/dist/testbed-support/Makefile.iotlab @@ -8,6 +8,7 @@ IOTLAB_AUTH ?= $(HOME)/.iotlabrc IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH)) IOTLAB_EXP_ID ?= $(shell experiment-cli get -l --state Running | grep -m 1 '"id"' | grep -Eo '[[:digit:]]+') IOTLAB_EXP_NAME ?= RIOT_EXP +IOTLAB_DEBUG_PORT ?= 3333 IOTLAB_AUTHORITY := "$(IOTLAB_USER)@$(IOTLAB_SITE).iot-lab.info" @@ -43,6 +44,16 @@ iotlab-flash: $(IOTLAB_AUTH) all iotlab-reset: $(IOTLAB_AUTH) $(AD)node-cli --reset -i $(IOTLAB_EXP_ID) +ifeq (,$(IOTLAB_DEBUG_NODE)) +iotlab-debug-server: IOTLAB_DEBUG_NODE := $(shell experiment-cli get -i $(IOTLAB_EXP_ID) --resources | \ + grep -m 1 "network_address" | \ + sed 's/.*: "\(.*\)".*/\1/') +endif +iotlab-debug-server: $(IOTLAB_AUTH) + $(AD)node-cli --debug-start -i $(IOTLAB_EXP_ID) + @echo "Debug on node $(IOTLAB_DEBUG_NODE)" + $(AD)ssh -N -L $(IOTLAB_DEBUG_PORT):$(IOTLAB_DEBUG_NODE):3333 $(IOTLAB_AUTHORITY) + iotlab-term: $(AD)ssh -t $(IOTLAB_AUTHORITY) "test -f ~/.iotlabrc || auth-cli -u $(IOTLAB_USER)" $(AD)ssh -t $(IOTLAB_AUTHORITY) "serial_aggregator -i $(IOTLAB_EXP_ID)"