summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2016-10-06 11:46:26 +0200
committerFilip Tehlar <ftehlar@cisco.com>2016-10-06 11:46:26 +0200
commitaea14fd0ac0868ee21b278695b2a5a17f6768141 (patch)
tree3674b0af231c8eec2f9f5b7d5f287d7ebdae0252
parent18b298a6096f95362c4f38270166f335790f4d0b (diff)
Add a help script for attaching running vpp with gdb
Change-Id: I01baad5910a98f3ca8f764aca69aa7a564b19d05 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
-rw-r--r--tests/data_plane/vpp_lite_topo/config.sh3
-rwxr-xr-xtests/data_plane/vpp_lite_topo/utils/scripts/attach.sh16
2 files changed, 18 insertions, 1 deletions
diff --git a/tests/data_plane/vpp_lite_topo/config.sh b/tests/data_plane/vpp_lite_topo/config.sh
index a546c52..87cc041 100644
--- a/tests/data_plane/vpp_lite_topo/config.sh
+++ b/tests/data_plane/vpp_lite_topo/config.sh
@@ -4,7 +4,8 @@ ODL_IP="127.0.0.1"
ODL_PORT="8181"
# path to vpp executable
-VPP_LITE_BIN=/vpp/build-root/install-vpp_lite_debug-native/vpp/bin/vpp
+VPP_LITE_DIR=/vpp/build-root/install-vpp_lite_debug-native/vpp/bin
+VPP_LITE_BIN=${VPP_LITE_DIR}/vpp
VPP_API_TEST=/vpp/build-root/install-vpp_lite_debug-native/vpp-api-test/bin/vpp_api_test
# read user config file if exists
diff --git a/tests/data_plane/vpp_lite_topo/utils/scripts/attach.sh b/tests/data_plane/vpp_lite_topo/utils/scripts/attach.sh
new file mode 100755
index 0000000..0b87085
--- /dev/null
+++ b/tests/data_plane/vpp_lite_topo/utils/scripts/attach.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+# Help script for attaching running vpp
+#
+# Currently his sctipt waits for second vpp pid
+
+pid=""
+
+cd ${VPP_LITE_DIR}
+
+while [ "$pid" == "" ] ; do
+ pid=$(pidof vpp | awk '{print $2}')
+done
+
+echo "attached to $pid"
+gdb attach $pid -ex cont