about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-15 05:48:36 +0000
committerbors <bors@rust-lang.org>2023-04-15 05:48:36 +0000
commit825c70658e0190bccd93d477907b06e05ad9ccc3 (patch)
tree98fb0de99eb9e97cb9de1462bc1319bea3bd3a5b
parent3312a3053bb9996e56a5ed58b6b9306224ada727 (diff)
parentc6b1f3144911854cb5c14d51303af882372ae488 (diff)
downloadrust-825c70658e0190bccd93d477907b06e05ad9ccc3.tar.gz
rust-825c70658e0190bccd93d477907b06e05ad9ccc3.zip
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 <asomers@gmail.com>
-rwxr-xr-xsrc/etc/rust-gdb4
-rwxr-xr-xsrc/etc/rust-gdbgui2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
index d812f7a802b..9abed30ea6f 100755
--- a/src/etc/rust-gdb
+++ b/src/etc/rust-gdb
@@ -14,7 +14,7 @@ fi
 RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
 GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
 # Get the commit hash for path remapping
-RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \(\w*\)/\1/p')"
+RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
 
 # Run GDB with the additional arguments that load the pretty printers
 # 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} \
   -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
   -iex "set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust" \
   "$@"
- 
\ No newline at end of file
+ 
diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui
index e7bafcc99b8..913269316bd 100755
--- a/src/etc/rust-gdbgui
+++ b/src/etc/rust-gdbgui
@@ -43,7 +43,7 @@ fi
 RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
 GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
 # Get the commit hash for path remapping
-RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \(\w*\)/\1/p')"
+RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
 
 # Set the environment variable `RUST_GDB` to overwrite the call to a
 # different/specific command (defaults to `gdb`).