]> git.lizzy.rs Git - rust.git/blob - src/etc/rust-gdb
update
[rust.git] / src / etc / rust-gdb
1 #!/bin/sh
2 # Exit if anything fails
3 set -e
4
5 # Find out where the pretty printer Python module is
6 RUSTC_SYSROOT=`rustc --print=sysroot`
7 GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
8
9 # Run GDB with the additional arguments that load the pretty printers
10 # Set the environment variable `RUST_GDB` to overwrite the call to a
11 # different/specific command (defaults to `gdb`).
12 RUST_GDB="${RUST_GDB:-gdb}"
13 PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
14   --directory="$GDB_PYTHON_MODULE_DIRECTORY" \
15   -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
16   "$@"