[Lldb-commits] [lldb] [lldb][Formatters] Do not recursively dereference pointer type when creating formatter candicates list. (PR #124048)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 27 05:30:05 PST 2025


labath wrote:

If I **was** holding a vector as a `vector**`, then I would would to see its summary/size as well. And maybe even the children too. But the thing I questioning is how often does one hold a C++ container as a double pointer. Is there like some common programming pattern that produces those? The only time I've ever done that is when I was experimenting with how "frame variable" handles pointers and references. I have seen and worked with double pointers, but this was always in some kind of legacy/C context. A combination of double pointers and a std::vector (which essentially makes it a triple pointer) would be very.. eclectic here. Modern C++ would likely turn at least one of those pointers into an iterator, or a smart pointer, or a reference..

It's true that a summary provider is less intrusive (it doesn't override existing children -- though it can hide them!), than a synthetic child provider, but I think it would be very confusing to have different behavior here. The thing I like about doing this for one level is that (as Zequan points out) it nicely matches what our SBValue API does, which makes most formatters "just work".

https://github.com/llvm/llvm-project/pull/124048


More information about the lldb-commits mailing list