summaryrefslogtreecommitdiffstats
path: root/core/process_wrapper_gdb.sh
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:28:42 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:28:42 -0800
commit88b607994a148f4af5bffee163e39ce8296750c6 (patch)
treefa249ff843e976cf034f2029437d3362a8396321 /core/process_wrapper_gdb.sh
parent05806d7af62e07c6225b2e7103a1b115ecf6c9ad (diff)
downloadbuild-88b607994a148f4af5bffee163e39ce8296750c6.zip
build-88b607994a148f4af5bffee163e39ce8296750c6.tar.gz
build-88b607994a148f4af5bffee163e39ce8296750c6.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'core/process_wrapper_gdb.sh')
-rwxr-xr-xcore/process_wrapper_gdb.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/process_wrapper_gdb.sh b/core/process_wrapper_gdb.sh
new file mode 100755
index 0000000..38b948a
--- /dev/null
+++ b/core/process_wrapper_gdb.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# This is the command running inside the xterm of our
+# debug wrapper. It needs to take care of starting
+# the server command, so it can attach to the parent
+# process. In addition, here we run the command inside
+# of a gdb session to allow for debugging.
+
+# On some systems, running xterm will cause LD_LIBRARY_PATH
+# to be cleared, so restore it and PATH to be safe.
+export PATH=$PREV_PATH
+export LD_LIBRARY_PATH=$PREV_LD_LIBRARY_PATH
+
+# Start binderproc (or whatever sub-command is being run)
+# inside of gdb, giving gdb an initial command script to
+# automatically run the process without user intervention.
+gdb -q -x $2/process_wrapper_gdb.cmds --args "$@"