2017-02-15 12:52:35 +00:00
|
|
|
$OpenBSD: patch-src_etc_rust-gdb,v 1.2 2017/02/15 12:52:35 landry Exp $
|
2016-01-13 07:39:07 +00:00
|
|
|
only compatible with egdb (gdb from ports)
|
2017-02-15 12:52:35 +00:00
|
|
|
--- src/etc/rust-gdb.orig Tue Jan 31 01:29:51 2017
|
|
|
|
+++ src/etc/rust-gdb Sun Feb 5 15:40:37 2017
|
|
|
|
@@ -12,12 +12,17 @@
|
|
|
|
# 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`
|
2016-01-13 07:39:07 +00:00
|
|
|
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
|
|
|
|
|
|
|
|
# Run GDB with the additional arguments that load the pretty printers
|
|
|
|
-PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" gdb \
|
|
|
|
+PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" egdb \
|
|
|
|
-d "$GDB_PYTHON_MODULE_DIRECTORY" \
|
|
|
|
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
|
|
|
|
"$@"
|