Skip to content

Commit 825c706

Browse files
committed
Auto merge of #110335 - asomers:rust-gdb-freebsd, r=jyn514
Fix rust-gdb on FreeBSD "\w" is a GNU-specific extension to sed. Avoid it. Fixes #110334 Signed-off-by: Alan Somers <[email protected]>
2 parents 3312a30 + c6b1f31 commit 825c706

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/etc/rust-gdb

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fi
1414
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
1515
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
1616
# Get the commit hash for path remapping
17-
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \(\w*\)/\1/p')"
17+
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
1818

1919
# Run GDB with the additional arguments that load the pretty printers
2020
# Set the environment variable `RUST_GDB` to overwrite the call to a
@@ -25,4 +25,4 @@ PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
2525
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
2626
-iex "set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust" \
2727
"$@"
28-
28+

src/etc/rust-gdbgui

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fi
4343
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
4444
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
4545
# Get the commit hash for path remapping
46-
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \(\w*\)/\1/p')"
46+
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
4747

4848
# Set the environment variable `RUST_GDB` to overwrite the call to a
4949
# different/specific command (defaults to `gdb`).

0 commit comments

Comments
 (0)