A convenient tool for running Valgrind without installing it is the
vg-in-place script. I have written a similar script that sets up the
proper environment variables for debugging a tool. Can this script
please be reviewed and applied if it is considered acceptable ?
Note: the script has not yet been tested on PowerPC or AIX.
--
Regards,
Bart Van Assche.
Index: debug-in-place
===================================================================
--- debug-in-place (revision 0)
+++ debug-in-place (revision 0)
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# This ensures it works when invoked from any directory.
+d=`dirname $0`
+
+export VALGRIND_LAUNCHER=$d/coregrind/valgrind
+
+case `uname -i` in
+ x86_64) arch=amd64;;
+ i386) arch=x86;;
+ ....) arch=ppc64;;
+ ....) arch=ppc32;;
+ *) echo "Error: unknown hardware platform"; exit 1;;
+esac
+
+case `uname -s` in
+ Linux|GNU/Linux) os=linux;;
+ AIX) os=aix;;
+ *) echo "Error: unknown kernel type"; exit 1;;
+esac
+
+for arg in "$@"
+do
+ if [ "${arg#--tool=}" != "${arg}" ]; then
+ tool="${arg#--tool=}"
+ fi
+done
+gdbcommands=/tmp/gdb-commands-$PID
+
+cat <<EOF >"${gdbcommands}"
+EOF
+
+echo ""
+echo "You can now set breakpoints. Next, issue the following gdb command:"
+echo "run $@"
+echo ""
+
+/usr/bin/gdb -x "${gdbcommands}" "$d/.in_place/${arch}-${os}/${tool}"
+
+/bin/rm -f "${gdbcommands}"
Property changes on: debug-in-place
___________________________________________________________________
Name: svn:executable
+ *
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers