]> err.no Git - mapper/commitdiff
Add helper script running debuging tools
authorKaj-Michael Lang <milang@tal.org>
Wed, 23 Jan 2008 17:56:25 +0000 (19:56 +0200)
committerKaj-Michael Lang <milang@tal.org>
Wed, 23 Jan 2008 17:56:25 +0000 (19:56 +0200)
src/debug-mapper.sh [new file with mode: 0755]

diff --git a/src/debug-mapper.sh b/src/debug-mapper.sh
new file mode 100755 (executable)
index 0000000..a0196d4
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+export G_SLICE=always-malloc
+export G_DEBUG=gc-friendly
+
+case "$1" in
+       valgrind)
+               libtool --mode=execute valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=20 mapper
+       ;;
+       massif)
+               libtool --mode=execute valgrind --tool=massif --depth=5 --alloc-fn=g_malloc --alloc-fn=g_realloc --alloc-fn=g_try_malloc \
+         --alloc-fn=g_malloc0 --alloc-fn=g_mem_chunk_alloc mapper
+       ;;
+       gdb)
+               libtool --mode=execute gdb mapper
+       ;;
+       *)
+               echo "Mode: valgrind or massif"
+       ;;
+esac