]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
docs, and provisions for lldb
authorAlan T. DeKok <aland@freeradius.org>
Tue, 26 Jan 2021 12:20:58 +0000 (07:20 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 26 Jan 2021 12:20:58 +0000 (07:20 -0500)
scripts/build/fuzzer

index 57e07897d1d4d7ad2d18579b90e325c1e74ca8dd..01ae0e0b571f7181b85d10254a7407059b1470c6 100755 (executable)
@@ -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