patch-src_etc_rust-gdb 838 B

123456789101112131415161718192021222324
  1. $OpenBSD: patch-src_etc_rust-gdb,v 1.2 2017/02/15 12:52:35 landry Exp $
  2. only compatible with egdb (gdb from ports)
  3. --- src/etc/rust-gdb.orig Tue Jan 31 01:29:51 2017
  4. +++ src/etc/rust-gdb Sun Feb 5 15:40:37 2017
  5. @@ -12,12 +12,17 @@
  6. # Exit if anything fails
  7. set -e
  8. +if ! command -v egdb; then
  9. + echo "error: rust-gdb requires devel/gdb to be installed" >&2
  10. + exit 1
  11. +fi
  12. +
  13. # Find out where the pretty printer Python module is
  14. RUSTC_SYSROOT=`rustc --print=sysroot`
  15. GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
  16. # Run GDB with the additional arguments that load the pretty printers
  17. -PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" gdb \
  18. +PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" egdb \
  19. -d "$GDB_PYTHON_MODULE_DIRECTORY" \
  20. -iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
  21. "$@"