Pretty Printers
Pretty printers allow debuggers to display uint128 and int128 values in human-readable format instead of showing the raw struct members.
The library contains pretty printers for LLDB, GDB, and Visual Studio in the extra/ folder.
LLDB
To use this, add the following line to your ~/.lldbinit file:
command script import /path/to/int128/extra/int128_printer_lldb.py
If this is successful, you should see the following message in your debugger upon startup:
"int128 and uint128 pretty printers loaded successfully"
GDB
To load the pretty printer, add the following line to your .gdbinit:
source /path/to/int128/extra/int128_printer_gdb.py
or you can source it manually in GDB.
(gdb) source /path/to/int128/extra/int128_printer_gdb.py
Visual Studio (NATVIS)
The extra/int128.natvis file provides visualization for the Visual Studio debugger.
There are several ways to register it:
Per-Project
Add the .natvis file to your Visual Studio project.
In Solution Explorer, right-click the project, select Add > Existing Item, and choose int128.natvis.
Visual Studio will automatically use it when debugging that project.
Per-User (All Projects)
Copy int128.natvis to your per-user Visualizers directory:
%USERPROFILE%\Documents\Visual Studio 2022\Visualizers\
Replace 2022 with your Visual Studio version.
All projects debugged with that installation will use the visualizer.
