From: Alan T. DeKok Date: Tue, 26 Jan 2021 12:20:58 +0000 (-0500) Subject: docs, and provisions for lldb X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d72eb33da2cec3a61e4623d427f64748ff0028e;p=thirdparty%2Ffreeradius-server.git docs, and provisions for lldb --- diff --git a/scripts/build/fuzzer b/scripts/build/fuzzer index 57e07897d1..01ae0e0b57 100755 --- a/scripts/build/fuzzer +++ b/scripts/build/fuzzer @@ -1,14 +1,35 @@ #!/bin/sh # -# USAGE: ./scripts/fuzzer FILENAME +# USAGE: ./scripts/fuzzer [lldb] FILENAME # # To be run with ONE input file, in order to debug crashes, leaks, # etc. # +# Add "lldb" +# + +usage() { + echo "Usage: ./scripts/build/fuzzer [-l] filename" + echo " -l - run the fuzzer under lldb" + echo "" + echo " The fuzzer will automatically pick up the protocol" + echo " from the filename. Which should be DIR/PROTOCOL/leak-foo" + echo " or DIR/PROTOCOL/crash-foo" + exit 1 +} + +if [ "$#" = "0" ]; then + usage +fi + + +if [ "$1" = "-l" ]; then + shift + LLDB="lldb --" +fi export ASAN_OPTIONS="malloc_context_size=50 detect_leaks=1 symbolize=1" export LSAN_OPTIONS="fast_unwind_on_malloc=0:malloc_context_size=50" - PROTOCOL=$(basename $(dirname $1 )) -./build/make/jlibtool --quiet --mode=execute ./build/bin/local/fuzzer_$PROTOCOL -artifact_prefix="build/fuzzer/$PROTOCOL/" -max_len=512 -D share/dictionary $1 +exec ./build/make/jlibtool --quiet --mode=execute $LLDB ./build/bin/local/fuzzer_$PROTOCOL -artifact_prefix="build/fuzzer/$PROTOCOL/" -max_len=512 -D share/dictionary $1