Re: Patch: implement new dynamic varobj spec

Tom Tromey
2009-09-16T17:12:57Z

>>>>> "Nick" == Nick Roberts <nickrob@snap.net.nz> writes:

Tom> With a dynamic varobj you can tell if it has children by examining the
Tom> has_more attribute.

Nick> The field has_more tells you if it _currently_ has children. If
Nick> you create a variable object of a STL container immediately after
Nick> declaring an empty container, e.g. after

Ok, yeah, I see what you mean.

Nick> map<string, int> m;
Nick> then has_more=0 yet the node for it would need to be expandable.

I don't think I understand this, though. There would be nothing
underneath the node. So, showing some expansion control would be weird,
wouldn't it?

Nick> AFAICS the only way the front end can discriminate is through the
Nick> displayhint field.

I would like the display hint to remain just a hint. In particular I
think it is important for future backward compatibility that we don't
require all front ends to know about all possible hints -- that is, it
should always be ok for the front end to ignore a hint it doesn't
understand.

So, if we need a way to determine "might possibly have children", then
let's add a new attribute.

Nick> On that note, printers.py in libstdc++ doesn't have a displayhint
Nick> function for StdListPrinter.

I'll look into this. I'm not sure whether this was intentional or not.

Nick> Also there appears to be something wrong with the python class
Nick> StdVectorPrinter because if you create a variable object immediately after
Nick> declaring it, e.g. after

I'll look at this too, thanks.

Tom