summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2015-08-28 22:05:07 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-08-28 22:05:07 +0000
commitd99fc05c84bafb1e5a1018056ea1251f2e862ca7 (patch)
tree9d440580a5f1abb68a8284a7d90736e0c3d3054e
parent6bd60c4c58290e765717be90269efcb6f42ff1da (diff)
parent3d545d77928286116cbe1a6104aef2edc0484ea0 (diff)
downloadgdb-d99fc05c84bafb1e5a1018056ea1251f2e862ca7.tar.gz
Merge "Generate a stub script for gdb on non-windows."
-rwxr-xr-xbuild-gdb.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/build-gdb.sh b/build-gdb.sh
index 47410a13d..0c3a0855f 100755
--- a/build-gdb.sh
+++ b/build-gdb.sh
@@ -251,10 +251,10 @@ install_host_gdb ()
# build the gdb stub and replace gdb with it. This is done post-install
# so files are in the correct place when determining the relative path.
+ dump "$TEXT Building gdb-stub"
+ bh_setup_host_env
case "$1" in
windows*)
- dump "$TEXT Building gdb-stub"
- bh_setup_host_env
GCC_FOR_STUB=${BH_HOST_CONFIG}-gcc
GCC_FOR_STUB_TARGET=`$GCC_FOR_STUB -dumpmachine`
if [ "$GCC_FOR_STUB_TARGET" = "i586-mingw32msvc" ]; then
@@ -276,6 +276,15 @@ install_host_gdb ()
fail_panic "Failed to build gdb-stub"
;;
*)
+ # Generate a script which sets PYTHONHOME
+ GDB_PATH=${DSTDIR}/bin/$(bh_tag_to_config_triplet $2)-gdb
+ mv "$GDB_PATH" "$GDB_PATH"-orig
+ cat > "$GDB_PATH" << EOF
+#!/bin/bash
+GDBDIR=\$(dirname \$(readlink -f \$0))
+echo PYTHONHOME="\$GDBDIR/../../../$(python_ndk_install_dir $1)" "\$GDBDIR/$(bh_tag_to_config_triplet $2)-gdb-orig"
+EOF
+ chmod 755 $GDB_PATH
;;
esac
}