diff options
author | Josh Gao <jmgao@google.com> | 2015-08-28 11:12:48 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2015-08-28 14:48:48 -0700 |
commit | 3d545d77928286116cbe1a6104aef2edc0484ea0 (patch) | |
tree | bb09b2b0c113ab66a0dd48824d4ff32fb756f510 | |
parent | 218a5ec1947f276720ca8784ea9f41c0b8071495 (diff) | |
download | gdb-3d545d77928286116cbe1a6104aef2edc0484ea0.tar.gz |
Generate a stub script for gdb on non-windows.
Change-Id: I473c8e02033963aa850d0e48a6da205b0e283580
-rwxr-xr-x | build-gdb.sh | 13 |
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 } |