[PATCH] D72589: Add GDB pretty printers for llvm::ilist, llvm::simple_ilist, and llvm::ilist_node.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 15:38:42 PST 2020


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

In D72589#1846185 <https://reviews.llvm.org/D72589#1846185>, @csigg wrote:

> In D72589#1845519 <https://reviews.llvm.org/D72589#1845519>, @dblaikie wrote:
>
> > Thanks for the details! I'd be /OK/ with this, but it doesn't seem ideal to be printing the next/prev when printing the container? Do you think it's worth/there's any nice way to avoid that significant redundancy/verbosity in the printing & just print the payload?
>
>
> Well, it's an //intrusive// list. I'm not aware of any way to hide the ilist_node base class when printing the list, that would be the responsibility of the derived class' printer (which probably wouldn't want to do that, in case someone prints an individual node).
>  `children` can only return a list of `gdb.Value`, and gdb picks the printers for those internally. And to make things a little more complicated, like in the test here, there can be multiple `ilist_node` base classes and you would only want to silence the one with the corresponding tag.


Yup. Better than nothing & no doubt something better than this would be non-trivial.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72589





More information about the llvm-commits mailing list