[PATCH] D157961: [llvm][utils] Fix SmallVector formatter when type is a pointer

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 15:52:59 PDT 2023


dblaikie added a comment.

In D157961#4649097 <https://reviews.llvm.org/D157961#4649097>, @kastiglione wrote:

>> Could we fix that, so the `SmallVector` formatter is only used for `SmallVector` objects, not pointers?
>
> `type synthetic add` has:
>
>   -p ( --skip-pointers )
>        Don't use this format for pointers-to-type objects.

Hmm, that seems like an awkward way for lldb to expose this functionality. Judging by the examples here: https://lldb.llvm.org/use/variable.html if you `-p`, then lldb will still print the contents of what a pointer points to, but using innate printing, instead of teh pretty printer? (the example with a pretty printer for `int` with `-p` - if you print out a pointer, you also get the builtin `int` printing for the thing the pointer points to, but then if you dereference, you get the custom pretty printing) but then if you don't use `-p` your pretty printer has to handle being passed a pointer? (what about a pointer to pointer? Is it just one level of indirection that's special cased)

Ugh :/

Thanks for listening/pointing me to the docs at least - guess this patch is the right way to go, given lldb's features. Not sure how to make sense of the feature, though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157961/new/

https://reviews.llvm.org/D157961



More information about the llvm-commits mailing list