X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fetc%2Frust-gdb;h=b950cea79edfeaef99761ae1ab76d5cee09cf974;hb=a13c7da23e65d0c6d2b5c9402cd7db76d50e6131;hp=23ba93da8e52932671db9638f2a1d6f196ac5d18;hpb=b2b7a063af39455d7362524da3123c34c3f4842e;p=rust.git diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb index 23ba93da8e5..b950cea79ed 100755 --- a/src/etc/rust-gdb +++ b/src/etc/rust-gdb @@ -2,8 +2,16 @@ # Exit if anything fails set -e +# Prefer rustc in the same directory as this script +DIR="$(dirname "$0")" +if [ -x "$DIR/rustc" ]; then + RUSTC="$DIR/rustc" +else + RUSTC="rustc" +fi + # Find out where the pretty printer Python module is -RUSTC_SYSROOT=`rustc --print=sysroot` +RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)" GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc" # Run GDB with the additional arguments that load the pretty printers