summaryrefslogtreecommitdiff
path: root/run-ws
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-12-10 23:59:01 +0100
committerPeter Wu <lekensteyn@gmail.com>2013-12-10 23:59:01 +0100
commite5c61dfcd6e3c89c0f7b003e76a522b805e80873 (patch)
tree4518e4b2871d7f03ad16bd017ce0dfeae712c300 /run-ws
parent0cac6f1f911590850e90894e14b3ecd0226cfa12 (diff)
downloadwireshark-notes-e5c61dfcd6e3c89c0f7b003e76a522b805e80873.tar.gz
run-ws: support gdb and valgrind
Diffstat (limited to 'run-ws')
-rwxr-xr-xrun-ws21
1 files changed, 20 insertions, 1 deletions
diff --git a/run-ws b/run-ws
index b9c46b6..2b34d22 100755
--- a/run-ws
+++ b/run-ws
@@ -1,10 +1,28 @@
-#!/bin/sh
+#!/bin/bash
if [ $# -lt 2 ]; then
echo "Usage: $0 /path/to/wireshark capture.pcapng [ssl debug file] [--] [other wireshark options]"
exit 1
fi
+DEBUGGER=()
+case $1 in
+gdb|*/gdb)
+ while :; do
+ arg=$1; shift
+ DEBUGGER+=("$arg")
+ [[ $arg != --args ]] || break
+ done
+ ;;
+valgrind|*/valgrind)
+ while :; do
+ arg=$1; shift
+ DEBUGGER+=("$arg")
+ [[ $arg != -- ]] || break
+ done
+ ;;
+esac
+
SSLKEYLOGFILE=${SSLKEYLOGFILE:-$PWD/premaster.txt}
WIRESHARK=$1
CAPTFILE=$2
@@ -34,6 +52,7 @@ fi
[ -z "$SSLDEBUG" ] || set -- -o ssl.debug_file:"$SSLDEBUG" "$@"
+"${DEBUGGER[@]}" \
"$WIRESHARK" -r "$CAPTFILE" \
-o http.ssl.port:443,4430-4433 \
-o ssl.keylog_file:"$SSLKEYLOGFILE" \