[Lldb-commits] [lldb] [lldb] Add generic string view summary provider (PR #171854)
Sergei Druzhkov via lldb-commits
lldb-commits at lists.llvm.org
Thu Dec 11 09:17:46 PST 2025
DrSergei wrote:
> Thanks for the patch. I'm all in favour of de-duplicating the formatter code, but I'd prefer it if we kept the individual SummaryProvider's per STL.
>
> I.e., the code that extracts the data and size from the type should live in the individual STL files. But the code that then formats the strings can be generic.
>
> Is that feasible?
>
> Note, copy-paste between the formatters is not actually a bad thing per-se, imo. It's useful for them to be developed separately because layouts can drastically change, and at that point a generic implementation may become convoluted to maintain. Also not every developer has access to every STL. Having them separate also means a developer can focus on the specific STL they're worried about, without breaking it for other STLs. That being said, the stuff that just prints the data can definitely be generic, as it's not STL specific.
I added special function to access data and size fields for each stl. `GenericInitializerList` already have data access functions inside it, so I thought it is normal.
https://github.com/llvm/llvm-project/pull/171854
More information about the lldb-commits
mailing list