summaryrefslogtreecommitdiff
path: root/run-ws
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-02-17 22:39:06 +0100
committerPeter Wu <peter@lekensteyn.nl>2015-02-17 22:39:06 +0100
commit2e8efb58aa7edf7aa07de215fefd1a33c0466cda (patch)
tree693a78457c43e4e6e6bdb0268a05ee4d3c642adf /run-ws
parentbf9521263ecbe1bd33bbc89a05073ca5680f327c (diff)
downloadwireshark-notes-2e8efb58aa7edf7aa07de215fefd1a33c0466cda.tar.gz
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
Diffstat (limited to 'run-ws')
-rwxr-xr-xrun-ws14
1 files changed, 14 insertions, 0 deletions
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 \