diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-04-06 04:24:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-06 04:24:18 +0200 |
| commit | 4911d168d887f56b33414a8f3cd4d2384047dcaa (patch) | |
| tree | 58d0e2f028d59b93575fd0734f8d85f7be281585 | |
| parent | da873169707da0bdbc8a53d51bf1272ef6d365b8 (diff) | |
| parent | 7a824c8598db706d66c9c821adf8184370affc6e (diff) | |
| download | rust-4911d168d887f56b33414a8f3cd4d2384047dcaa.tar.gz rust-4911d168d887f56b33414a8f3cd4d2384047dcaa.zip | |
Rollup merge of #70713 - jsgf:rust-gdb-rustc, r=Mark-Simulacrum
Prefer sysroot from rustc in same directory as rust-gdb If there isn't a rustc in the same directory, then fall back to searching the path.
| -rwxr-xr-x | src/etc/rust-gdb | 10 | ||||
| -rwxr-xr-x | src/etc/rust-gdbgui | 10 |
2 files changed, 18 insertions, 2 deletions
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 diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui index 08d598cde1c..9744913b686 100755 --- a/src/etc/rust-gdbgui +++ b/src/etc/rust-gdbgui @@ -31,8 +31,16 @@ icon to start your program running. exit 0 fi +# 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" # Set the environment variable `RUST_GDB` to overwrite the call to a |
