3 if [ -z "$WS_ROOT" ] ; then
4 echo "ERROR: WS_ROOT environment variable is not set!"
8 source $WS_ROOT/extras/vcl-ldpreload/env.sh
9 tmp_gdb_cmdfile="/tmp/gdb_cmdfile_curl.$$"
11 trap "rm -f $tmp_gdb_cmdfile" SIGINT SIGTERM EXIT
13 cat <<EOF > $tmp_gdb_cmdfile
15 source $WS_ROOT/extras/gdb/gdb_cmdfile.vpp
16 set exec-wrapper env LD_PRELOAD=$VCL_LDPRELOAD_LIB_DIR/libvcl_ldpreload.so.0.0.0
21 sudo -E emacs --eval "(gdb \"gdb -x $tmp_gdb_cmdfile -i=mi --args $*\")" --eval "(setq frame-title-format \"CURL-DEBUG (VCL-LDPRELOAD)\")"
24 # Extract nginx IPv4 address from docker bridge
26 nginx_addr=$(docker network inspect bridge | grep IPv4Address | awk -e '{print $2}' | sed -e 's,/16,,' -e 's,",,g' -e 's/,//')
28 if [ -z "$nginx_addr" ] ; then
29 echo "ERROR: Unable to determine docker container address!"
33 gdb_in_emacs /usr/bin/curl http://$nginx_addr