On Fri, Jan 8, 2010 at 5:10 PM, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx>
That is a good idea. It is a small enough patch. Could you make the request on the bug so it does not slip between the cracks?
> Marc, this is nice! I'm seeing the pretty printed display of strings, maps, vectors, etc. This is going to make a lot of people happy.
> Are the plans to commit this to only the 3.6 branch, or is there any chance it will be in 3.5.2 as well?
Actually, MI does support pretty-printing but it requires some special request from DSF-GDB to turn this on.
> Have you given thought to what it would take to be able to toggle the actual variables between a pretty-printed view and a raw view?
> It means completely avoiding use of the -var-list-children MI command, since that still reports the raw format.
> Would it be easy to inject an alternate handling of variables that issued the cli print command and interpreted its results?
I don't think it would be very hard, but I've been so busy with so many other things that I didn't have time to figure
out what those MI changes are. They are all documented in GDB... Someone just needs to take the time to read it and digest it.
If someone from the community could try making some headway on it, that would speeds things up.
In my emails with Tom Tromey, my understanding is that only a subset of the MI commands understand how to do pretty printing. So if you ask a vector how many children it has, it reports the number of elements contained in the vector, and if you then -var-list-children for the number of children returned, you get an index exception because that command returns the raw implementation information, and a vector typically has a single child, its implementation class. Fixing this problem looks like a lot of effort in GDB.
Interestingly, the NetBeans C++ support doesn't have this problem, it never issues the MI commands that cause trouble.
I'm not familiar with that extension point, but in DSF and DSF-GDB, we don't use any extension points.
> Or does DSF support anything like the org.eclipse.debug.core.logicalStructureProviders extension point?
The reason an extension point is interesting is because different pretty print libraries may use different formatting, and it is nice to allow custom interpretation of the data. Probably a better solution would be to add a "--pretty_print_annotations" flag to gdb that pretty printers would use to provide standard annotations allow other tools to unambiguously interpret the data being returned.
It's nice to see interest on this fix.
Definite interest on pushing this along, thanks for the start!