amosbird / ldb_toolchain_gen

MIT License
66 stars 21 forks source link

Add pretty printers scripts for GDB. #3

Closed adonis0147 closed 2 years ago

adonis0147 commented 2 years ago

generate_toolchain.sh can export pretty printers scripts for GDB which can be used to debug code more conveniently.

In GDB, we can execute the following code to add the pretty printers (NOTICE: <prefix> should be replaced to the real path).

python
import sys
sys.path.insert(0, '<prefix>/ldb_toolchain/share/gcc/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers(None)
end