nim-gdb 610 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. # Exit if anything fails
  3. set -e
  4. # Find out where the pretty printer Python module is
  5. NIM_SYSROOT=$(dirname $(dirname $(readlink -e $(which nim))))
  6. GDB_PYTHON_MODULE_PATH="$NIM_SYSROOT/tools/nim-gdb.py"
  7. # Run GDB with the additional arguments that load the pretty printers
  8. # Set the environment variable `NIM_GDB` to overwrite the call to a
  9. # different/specific command (defaults to `gdb`).
  10. NIM_GDB="${NIM_GDB:-gdb}"
  11. # exec replaces the new process of bash with gdb. It is always good to
  12. # have fewer processes.
  13. exec ${NIM_GDB} \
  14. -eval-command "source $GDB_PYTHON_MODULE_PATH" \
  15. "$@"