diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-10-27 02:32:32 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-10-27 02:32:32 +0000 |
commit | 4de661bb9fc1783ea6b1b480758ba8314375b867 (patch) | |
tree | 5728f4eaceba5c9efed97e8b82136c751ed5608a | |
parent | 3c622f7b80f62fa2261b199e07098628bea7bb0c (diff) | |
download | wireshark-4de661bb9fc1783ea6b1b480758ba8314375b867.tar.gz |
Add a little shell script to export the appropriate variables necessary for
running valgrind and then run it on either tshark or (if the user is very
patient) Wireshark.
svn path=/trunk/; revision=39627
-rw-r--r-- | tools/Makefile.am | 23 | ||||
-rwxr-xr-x | tools/valgrind-wireshark.sh | 39 |
2 files changed, 51 insertions, 11 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am index 7166a51e08..c4d22d27fc 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -89,24 +89,24 @@ EXTRA_DIST = \ $(PIDL_FILES) \ asn2wrs.py \ checkhf.pl \ - colorfilters2js.pl \ - compare-abis.sh \ + colorfilters2js.pl \ + compare-abis.sh \ checkAPIs.pl \ dfilter-test.py \ - extract_asn1_from_spec.pl \ - fixhf.pl \ - ftsanity.py \ + extract_asn1_from_spec.pl \ + fixhf.pl \ + ftsanity.py \ fuzz-test.sh \ html2text.py \ - idl2wrs.sh \ + idl2wrs.sh \ idl2wrs.sh.in \ - indexcap.py \ - lex.py \ - list_protos_in_cap.sh \ + indexcap.py \ + lex.py \ + list_protos_in_cap.sh \ Makefile.nmake \ make-dissector-reg \ - make-dissector-reg.py \ - make-manuf \ + make-dissector-reg.py \ + make-manuf \ make-sminmpec.pl \ make-services.pl \ make-tapreg-dotc \ @@ -124,6 +124,7 @@ EXTRA_DIST = \ setuid-root.pl.in \ test-fuzzed-cap.sh \ textify.sh \ + valgrind-wireshark.sh \ win32-setup.sh \ win64-setup.sh \ win-setup.sh \ diff --git a/tools/valgrind-wireshark.sh b/tools/valgrind-wireshark.sh new file mode 100755 index 0000000000..1599bad99e --- /dev/null +++ b/tools/valgrind-wireshark.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# $Id$ +# +# A small script to export some variables and run tshark or wireshark in +# valgrind on a given capture file. + +# Directory containing tshark or wireshark. Default current directory. +BIN_DIR=. + +# Use tshark by default +COMMAND=tshark +COMMAND_ARGS="-nVxr" + +while getopts ":b:lw" OPTCHAR ; do + case $OPTCHAR in + b) BIN_DIR=$OPTARG ;; + l) LEAK_CHECK="--leak-check=full" ;; + w) COMMAND=wireshark + COMMAND_ARGS="-nr" ;; + esac +done +shift $(($OPTIND - 1)) + +if [ $# -ne 1 ] +then + printf "Usage: $0 [-b bin_dir] [-l] [-w] /path/to/file.pcap\n" + exit 1 +fi + +if [ "$BIN_DIR" = "." ]; then + export WIRESHARK_RUN_FROM_BUILD_DIRECTORY= +fi + +export WIRESHARK_DEBUG_EP_NO_CHUNKS= +export WIRESHARK_DEBUG_SE_NO_CHUNKS= +export G_SLICE=always-malloc # or debug-blocks + +libtool --mode=execute valgrind $LEAK_CHECK $BIN_DIR/$COMMAND $COMMAND_ARGS $1 > /dev/null |