[Lldb-commits] [lldb] [lldb] Avoid (unlimited) GetNumChildren calls when printing values (PR #93946)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 3 01:32:47 PDT 2024


labath wrote:

> This seems reasonable. However, I note that on the page where we show how to write synthetic child providers, we say:
> 
> def num_children(self): this call should return the number of children that you want your object to have
> 
> That's actually not true - we pass the max_children argument on to the num_children method, and in fact some of the tests do use the max parameter. But since you're making that actually useful, can you fix the docs so people will know to take advantage of this?

Sounds good. I've created a separate [pr](https://github.com/llvm/llvm-project/pull/94192) for that.


> BTW, because the max number of children is probably getting ignored in the wild, this has to be advisory, you can't require that:
> 
> val.GetNumChildren(max_children) <= max_children
> 
> I don't think you do that but it might be good to note the fact.

Yes, I am keeping that in mind.

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


More information about the lldb-commits mailing list