Created
December 29, 2025 15:45
-
-
Save Akdeniz/492300f3776c5ee7f38f3dfd4ebc3f9f to your computer and use it in GitHub Desktop.
Install GDB libcxx printers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # determines what version you want | |
| version=heads/main | |
| # path=tags/llvmorg-21-init | |
| mkdir -p ~/.config/gdb/libcxx | |
| wget https://github.com/llvm/llvm-project/raw/refs/$version/libcxx/utils/gdb/libcxx/printers.py -O ~/.config/gdb/libcxx/printers.py | |
| touch ~/.config/gdb/libcxx/__init__.py | |
| if [ ! -f ~/.gdbinit ]; then | |
| echo " | |
| set print pretty on | |
| set print object on | |
| " | tee ~/.gdbinit | |
| fi | |
| echo " | |
| # libc++ pretty printers | |
| # See: https://github.com/koutheir/libcxx-pretty-printers | |
| python | |
| import sys | |
| sys.path.insert(0, '$(eval echo ~)/.config/gdb') | |
| from libcxx.printers import register_libcxx_printer_loader | |
| register_libcxx_printer_loader() | |
| end | |
| " | tee -a ~/.gdbinit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment