File: rust-gdb

package info (click to toggle)
rustc 1.46.0+dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 269,876 kB
  • sloc: xml: 133,832; sh: 16,876; ansic: 16,844; javascript: 6,779; python: 6,128; cpp: 4,555; makefile: 3,186; asm: 1,392; ruby: 68; awk: 12
file content (26 lines) | stat: -rwxr-xr-x 882 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
# 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)"
#GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
# We can just hardcode this on Debian, and remove the rustc dependency
GDB_PYTHON_MODULE_DIRECTORY="/usr/share/rust-gdb"

# Run GDB with the additional arguments that load the pretty printers
# Set the environment variable `RUST_GDB` to overwrite the call to a
# different/specific command (defaults to `gdb`).
RUST_GDB="${RUST_GDB:-gdb}"
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
  --directory="$GDB_PYTHON_MODULE_DIRECTORY" \
  -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
  "$@"