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

Enrico Granata via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 15 14:33:07 PDT 2015

granata.enrico added a comment.

One alternative would be to have the num_children method on the synthetic provider itself be able to take an optional argument that is the max_count. That is, instead of defining

  def num_children(self):

You would instead define

  def num_children(self, max_count):

Of course, you would need to continue supporting both possible signatures in order to maintain compatibility with existing formatters. But we do have some support for that. If you look at LLDBSwigPythonCallCommand:

  PyCallable::argc argc = pfunc.GetNumArguments();
  if (argc.num_args == 5 || argc.varargs == true)
      pvalue = pfunc(debugger_sb, args, exe_ctx_sb, &cmd_retobj_sb, session_dict = FindSessionDictionary(session_dictionary_name));
      pvalue = pfunc(debugger_sb, args, &cmd_retobj_sb, session_dict = FindSessionDictionary(session_dictionary_name));

num_children could start doing something similar for 1 vs. 2 arguments


More information about the lldb-commits mailing list