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

Christian Sigg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 23:46:48 PST 2020


csigg marked an inline comment as done.
csigg added a comment.

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.


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