aboutsummaryrefslogtreecommitdiffstats
path: root/extras/vcl-ldpreload/test/emacs_gdb_vpp.sh
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2017-10-19 03:47:42 -0400
committerKeith Burns <alagalah@gmail.com>2017-10-19 14:27:51 +0000
commit86b8e26b331bb6db4ce69aa9fa7c0ea1392b985d (patch)
treefcc16330a6516195229770877303fb50920c0992 /extras/vcl-ldpreload/test/emacs_gdb_vpp.sh
parent41a9e51f65aae3639771d9af53e810b43a5aee19 (diff)
vcl-ldpreload: test script enhancements
Change-Id: Iff302a35cd5d35bf0671a63e8ba81a0c60a231eb Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'extras/vcl-ldpreload/test/emacs_gdb_vpp.sh')
-rwxr-xr-xextras/vcl-ldpreload/test/emacs_gdb_vpp.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/extras/vcl-ldpreload/test/emacs_gdb_vpp.sh b/extras/vcl-ldpreload/test/emacs_gdb_vpp.sh
new file mode 100755
index 00000000000..460e4077e53
--- /dev/null
+++ b/extras/vcl-ldpreload/test/emacs_gdb_vpp.sh
@@ -0,0 +1,23 @@
+#! /bin/bash
+
+if [ -z "$WS_ROOT" ] ; then
+ echo "ERROR: WS_ROOT environment variable is not set!"
+ exit 1
+fi
+
+source $WS_ROOT/extras/vcl-ldpreload/env.sh
+tmp_gdb_cmdfile="/tmp/gdb_cmdfile_vpp.$$"
+
+trap "rm -f $tmp_gdb_cmdfile" SIGINT SIGTERM EXIT
+
+cat <<EOF > $tmp_gdb_cmdfile
+set confirm off
+source $WS_ROOT/extras/gdb/gdb_cmdfile.vpp
+start
+EOF
+
+gdb_in_emacs() {
+ sudo -E emacs --eval "(gdb \"gdb -x $tmp_gdb_cmdfile -i=mi --args $*\")" --eval "(setq frame-title-format \"VPP-DEBUG\")"
+}
+sudo rm -f /dev/shm/*
+gdb_in_emacs $WS_ROOT/build-root/install-vpp_debug-native/vpp/bin/vpp unix { interactive exec $LDP_TEST_DIR/common/vpp_docker.conf } api-segment { gid $(id -g) }