[Lldb-commits] [PATCH] D13778: [SBValue] Add a method HasChildAtIndex.

Enrico Granata via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 15 11:59:23 PDT 2015

granata.enrico added a comment.

So, if I understand this correctly, this HasChildAtIndex() API returns a three-state int:

1 == yes I do
0 == no I do not
-1 == maybe, can't tell

When would you ever run into the -1 case? It seems you're mostly using it as an invalid marker. Would 0 not be a better choice for those invalid cases? Then you could just use a boolean which seems a better answer for an inherently yes/no question (invalid objects do not have a child at index for any index, do they?)

Also, if you're only using this from inside a synthetic child provider, why does it need to be in SBValue? Or is your argument that you want to write scripts against LLDB that use this feature?

Truth be told, I am not particularly excited about this feature, and the fact that this seems to be introduced in a vacuum does nothing to assuage my original concern that is is a potentially avoidable complication to the model.


More information about the lldb-commits mailing list