Obtaining number of children of a dynamic varobj

Vladimir Prus vladimir@codesourcery.com
Thu Feb 11 17:23:00 GMT 2010


Elmenthaler, Jens wrote:

> Hi,
> 
> Trying to enable the python pretty printers in the Eclipse CDT, a question about the MI API for
> varobjs arose.
> 
> If I read the documentation correctly, I should not call -var-list-children without the range of
> children, because in general I should assume that the varobj has a huge number of children and
> fetching them all is potential too expensive.
> 
> Quite reasonable sofar. Nevertheless, I have the problem that I have to know the number of
> children a dynamic varobj has.
> 
> The only way I see to obtain the number of children, however, is to call -var-list-children
> without a range specification. I can omit the values to be transferred. Does that have the same
> scalability issues, after all it still creates a varobj for each child?

[Please do not ask new questions by replying to an unrelated email]

Yes, it has the same issues. If you ask GDB about the number of children of a variable, and the
variable is uninitialized, GDB might not ever return. 

- Volodya




More information about the Gdb mailing list