Various LLDB extensions that make debugging C++ code a bit more seamless:
The native LLDB data formatters enumerate hash table based containers in iteration order. This can be inconvenient for large registries where a simple integral key is mapped to a more complex type: finding the appropriate entry is difficult, as the elements are listed in iteration order by default.
Type formatter implementations in lldb-toybox
print elements in their natural order if the key of an entry is convertible to an integral type:
Native LLDB | lldb-toybox |
---|---|
|
|
Native LLDB formatters lack support for various node_type
s for containers. lldb-toybox
adds it's own implementation:
(std::unordered_map<int, int>::node_type) <Empty node>
(std::unordered_map<int, int>::node_type) {
stored = (first = 100, second = 1000)
}
Native LLDB formatters iterator support is extended to provide better summaries.
(absl::container_internal::raw_hash_set<...>::iterator) <End iterator>
(absl::container_internal::raw_hash_set<...>::iterator) {
pointee = (first = 200, second = 2000)
}
libc++ std::unordered_(set|map)
Implemented by hash_container_support.py
, enabled by the lldb-toybox.libcxx
and lldb-toybox.libcxx-overrides
type categories.
- Support for naturally ordered elements (overrides native implementation!)
- Support for
node_type
Warning
Replacing the native data formatter implementation of LLDB for libc++ types with a Python script comes with a slight performance impact, and has a risk of breaking for future libc++ versions.
If you are experiencing issues you can disable the override through the lldb-toybox.libcxx-overrides
type category:
type category disable lldb-toybox.libcxx-overrides
Implemented by hash_container_support.py
, enabled by the lldb-toybox.abseil
type category.
- Support for naturally ordered elements
- Support for
iterator
andconst_iterator
- Support for
node_type