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