vcl-ldpreload: test script enhancements
[vpp.git] / extras / vcl-ldpreload / test / emacs_gdb_vpp.sh
1 #! /bin/bash
2
3 if [ -z "$WS_ROOT" ] ; then
4     echo "ERROR: WS_ROOT environment variable is not set!"
5     exit 1
6 fi
7
8 source $WS_ROOT/extras/vcl-ldpreload/env.sh
9 tmp_gdb_cmdfile="/tmp/gdb_cmdfile_vpp.$$"
10
11 trap "rm -f $tmp_gdb_cmdfile" SIGINT SIGTERM EXIT
12
13 cat <<EOF > $tmp_gdb_cmdfile
14 set confirm off
15 source $WS_ROOT/extras/gdb/gdb_cmdfile.vpp
16 start
17 EOF
18
19 gdb_in_emacs() {
20     sudo -E emacs --eval "(gdb \"gdb -x $tmp_gdb_cmdfile -i=mi --args $*\")" --eval "(setq frame-title-format \"VPP-DEBUG\")"
21 }
22 sudo rm -f /dev/shm/*
23 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) }