openbsd-ports/lang/rust/patches/patch-src_etc_rust-gdb

27 lines
998 B
Plaintext
Raw Normal View History

$OpenBSD: patch-src_etc_rust-gdb,v 1.3 2017/06/17 02:06:53 danj Exp $
only compatible with egdb (gdb from ports)
Index: src/etc/rust-gdb
--- src/etc/rust-gdb.orig
+++ src/etc/rust-gdb
@@ -12,6 +12,11 @@
# Exit if anything fails
set -e
+if ! command -v egdb; then
+ echo "error: rust-gdb requires devel/gdb to be installed" >&2
+ exit 1
+fi
+
# Find out where the pretty printer Python module is
RUSTC_SYSROOT=`rustc --print=sysroot`
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
@@ -19,7 +24,7 @@ GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustli
# 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}"
+RUST_GDB="${RUST_GDB:-egdb}"
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" ${RUST_GDB} \
-d "$GDB_PYTHON_MODULE_DIRECTORY" \
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \