This project provides GDB pretty printers for LLVM types, specifically for llvm::Type and llvm::Value. The pretty printers directly use the dump() method when inspecting LLVM types within GDB.
- Clone the repository:
git clone https://github.com/bmanga/llvm-ir-pp.git- Load the pretty printers in your GDB session by adding the following to your
.gdbinitfile:
source /path/to/llvm-ir-pp/llvm-ir-prettyprinter.pyOnce the pretty printers are loaded, GDB will automatically use them to display LLVM types when they are encountered. For example:
(gdb) p *ST
$1 = store ptr addrspace(1) %data_out_raw, ptr %data, align 4Your IDE may also be able to make use of it (eg. VSCode, see the image above)
Contributions are welcome! Please submit pull requests or open issues to discuss potential changes.
