Slices show up as { ptr, len }, optionals are unreadable, and slice[0] just errors out. Python formatters help a bit but don’t fix expressions. zig-lldb fixes everything… if you’re willing to rebuild LLDB and maintain a fork.
zdb is a native LLDB plugin that sits in the middle:
- Works with stock LLDB (Homebrew / system)
- Native C++ type summaries (no Python)
- Zig-style expressions work: slice[0], opt.?, err catch x
(lldb) p int_slice[0]
(int) $0 = 1
How? By calling LLDB’s internal APIs via versioned offset tables and rewriting expressions on the fly.
Limitations: no Variables View expansion (ABI issues with std::function). CLI debugging works great.
joelreymont•2h ago
Slices show up as { ptr, len }, optionals are unreadable, and slice[0] just errors out. Python formatters help a bit but don’t fix expressions. zig-lldb fixes everything… if you’re willing to rebuild LLDB and maintain a fork.
zdb is a native LLDB plugin that sits in the middle:
- Works with stock LLDB (Homebrew / system) - Native C++ type summaries (no Python) - Zig-style expressions work: slice[0], opt.?, err catch x
(lldb) p int_slice[0] (int) $0 = 1
How? By calling LLDB’s internal APIs via versioned offset tables and rewriting expressions on the fly.
Limitations: no Variables View expansion (ABI issues with std::function). CLI debugging works great.
Check out the Github repo at https://github.com/joelreymont/zdb!