From 2e8efb58aa7edf7aa07de215fefd1a33c0466cda Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 17 Feb 2015 22:39:06 +0100 Subject: run-ws: set ASAN options Saves myself from typing another gdb wrapper that sets ASAN_OPTIONS and G_SLICE. https://code.google.com/p/address-sanitizer/wiki/Flags https://developer.gnome.org/glib/unstable/glib-running.html --- run-ws | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'run-ws') diff --git a/run-ws b/run-ws index 2b34d22..a309a75 100755 --- a/run-ws +++ b/run-ws @@ -52,6 +52,20 @@ fi [ -z "$SSLDEBUG" ] || set -- -o ssl.debug_file:"$SSLDEBUG" "$@" +# Set AddressSanitizer options if not already +if [ -z "$ASAN_OPTIONS" ]; then + # Abort so it can be caught by gdb + ASAN_OPTIONS=abort_on_error=1 + # Strip source path (assume /tmp/wireshark/) + ASAN_OPTIONS+=strip_path_prefix=/tmp/wireshark/ + export ASAN_OPTIONS +fi + +# For ASAN, disable slice allocator and use g_malloc directly. +if [ -z "$G_SLICE" ]; then + export G_SLICE=always-malloc +fi + "${DEBUGGER[@]}" \ "$WIRESHARK" -r "$CAPTFILE" \ -o http.ssl.port:443,4430-4433 \ -- cgit v1.2.1