File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1313# Find out where the pretty printer Python module is
1414RUSTC_SYSROOT=" $( " $RUSTC " --print=sysroot) "
1515GDB_PYTHON_MODULE_DIRECTORY=" $RUSTC_SYSROOT /lib/rustlib/etc"
16+ # Get the commit hash for path remapping
17+ RUSTC_COMMIT_HASH=" $( " $RUSTC " -vV | sed -n ' s/commit-hash: \(\w*\)/\1/p' ) "
1618
1719# Run GDB with the additional arguments that load the pretty printers
1820# Set the environment variable `RUST_GDB` to overwrite the call to a
@@ -21,4 +23,6 @@ RUST_GDB="${RUST_GDB:-gdb}"
2123PYTHONPATH=" $PYTHONPATH :$GDB_PYTHON_MODULE_DIRECTORY " exec ${RUST_GDB} \
2224 --directory=" $GDB_PYTHON_MODULE_DIRECTORY " \
2325 -iex " add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY " \
26+ -iex " set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT /lib/rustlib/src/rust" \
2427 " $@ "
28+
Original file line number Diff line number Diff line change 4242# Find out where the pretty printer Python module is
4343RUSTC_SYSROOT=" $( " $RUSTC " --print=sysroot) "
4444GDB_PYTHON_MODULE_DIRECTORY=" $RUSTC_SYSROOT /lib/rustlib/etc"
45+ # Get the commit hash for path remapping
46+ RUSTC_COMMIT_HASH=" $( " $RUSTC " -vV | sed -n ' s/commit-hash: \(\w*\)/\1/p' ) "
4547
4648# Set the environment variable `RUST_GDB` to overwrite the call to a
4749# different/specific command (defaults to `gdb`).
@@ -53,7 +55,9 @@ RUST_GDBGUI="${RUST_GDBGUI:-gdbgui}"
5355
5456# These arguments get passed through to GDB and make it load the
5557# Rust pretty printers.
56- GDB_ARGS=" --directory=\" $GDB_PYTHON_MODULE_DIRECTORY \" -iex \" add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY \" "
58+ GDB_ARGS=" --directory=\" $GDB_PYTHON_MODULE_DIRECTORY \" " \
59+ " -iex \" add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY \" " \
60+ " -iex \" set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT /lib/rustlib/src/rust\" "
5761
5862# Finally we execute gdbgui.
5963PYTHONPATH=" $PYTHONPATH :$GDB_PYTHON_MODULE_DIRECTORY " \
You can’t perform that action at this time.
0 commit comments