From e5c61dfcd6e3c89c0f7b003e76a522b805e80873 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 10 Dec 2013 23:59:01 +0100 Subject: run-ws: support gdb and valgrind --- run-ws | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'run-ws') 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" \ -- cgit v1.2.1