gdbinit 665 B

1234567891011121314151617181920212223
  1. set auto-load local-gdbinit on
  2. set print elements 0
  3. add-auto-load-safe-path /
  4. python
  5. # Update GDB's Python paths with the `sys.path` values of the local
  6. # Python installation, whether that is brew'ed Python, a virtualenv,
  7. # or another system python.
  8. # Convert GDB to interpret in Python
  9. import os, subprocess, sys
  10. # Execute a Python using the user's shell and pull out the sys.path (for site-packages)
  11. paths = subprocess.check_output('/usr/bin/python3 -c "import os,sys;print(os.linesep.join(sys.path).strip())"',shell=True).decode("utf-8").split()
  12. # Extend GDB's Python's search path
  13. sys.path.extend(paths)
  14. end
  15. source /your/path/to/mat_pretty_printer.py