forked from osmocom/wireshark
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
This commit is contained in:
parent
3c622f7b80
commit
4de661bb9f
|
@ -89,24 +89,24 @@ EXTRA_DIST = \
|
||||||
$(PIDL_FILES) \
|
$(PIDL_FILES) \
|
||||||
asn2wrs.py \
|
asn2wrs.py \
|
||||||
checkhf.pl \
|
checkhf.pl \
|
||||||
colorfilters2js.pl \
|
colorfilters2js.pl \
|
||||||
compare-abis.sh \
|
compare-abis.sh \
|
||||||
checkAPIs.pl \
|
checkAPIs.pl \
|
||||||
dfilter-test.py \
|
dfilter-test.py \
|
||||||
extract_asn1_from_spec.pl \
|
extract_asn1_from_spec.pl \
|
||||||
fixhf.pl \
|
fixhf.pl \
|
||||||
ftsanity.py \
|
ftsanity.py \
|
||||||
fuzz-test.sh \
|
fuzz-test.sh \
|
||||||
html2text.py \
|
html2text.py \
|
||||||
idl2wrs.sh \
|
idl2wrs.sh \
|
||||||
idl2wrs.sh.in \
|
idl2wrs.sh.in \
|
||||||
indexcap.py \
|
indexcap.py \
|
||||||
lex.py \
|
lex.py \
|
||||||
list_protos_in_cap.sh \
|
list_protos_in_cap.sh \
|
||||||
Makefile.nmake \
|
Makefile.nmake \
|
||||||
make-dissector-reg \
|
make-dissector-reg \
|
||||||
make-dissector-reg.py \
|
make-dissector-reg.py \
|
||||||
make-manuf \
|
make-manuf \
|
||||||
make-sminmpec.pl \
|
make-sminmpec.pl \
|
||||||
make-services.pl \
|
make-services.pl \
|
||||||
make-tapreg-dotc \
|
make-tapreg-dotc \
|
||||||
|
@ -124,6 +124,7 @@ EXTRA_DIST = \
|
||||||
setuid-root.pl.in \
|
setuid-root.pl.in \
|
||||||
test-fuzzed-cap.sh \
|
test-fuzzed-cap.sh \
|
||||||
textify.sh \
|
textify.sh \
|
||||||
|
valgrind-wireshark.sh \
|
||||||
win32-setup.sh \
|
win32-setup.sh \
|
||||||
win64-setup.sh \
|
win64-setup.sh \
|
||||||
win-setup.sh \
|
win-setup.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
|
Loading…
Reference in New Issue