[libcxxabi] [llvm] [ItaniumDemangle] Add customizable printLeft/printRight APIs to OutputBuffer (PR #133249)

Richard Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 14 11:34:07 PDT 2025


https://github.com/zygoloid approved this pull request.

Looks good.

However: for your use case, I think you'll likely also need to add a couple more hooks to `OutputBuffer` in order to properly track the locations of parts of the demangled name. Specifically:

* For `prepend` and `insert`, some virtual function call to indicate that an insertion has happened in the buffer (eg, specifying the insertion position and size).
* For `setCurrentPosition`, some virtual function call to indicate that an erase is about to happen in the buffer (eg, specifying the position and size) -- right now the only kind of erase we perform here is a truncation, but it may be a bit more future-proof for the extension mechanism to support an arbitrary erase.

If you don't handle those, any locations that you are tracking on the lldb side may be wrong when they happen.

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


More information about the llvm-commits mailing list