GDB Qt pretty printers: print size of container
ClosedPublic

Authored by mwolff on Jan 16 2018, 12:43 PM.

Details

Summary

The pretty printers already had a pretty approach for empty
containers, these got an 'empty ' prepended to their output.
But when you are printing large containers, how do you know the
size of the container? Often, it's not straight forward to get
to the size, e.g. for a QList. To help the user of the debugger,
always append '(size = N)' to the output, which works for all
situations. Remove the empty prefix, which is now obsolete.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mwolff created this revision.Jan 16 2018, 12:43 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 16 2018, 12:43 PM
mwolff requested review of this revision.Jan 16 2018, 12:43 PM
kfunk accepted this revision.Jan 16 2018, 1:10 PM
kfunk added a subscriber: kfunk.

I like the idea in general, but not really the string representation of the size.

Instead of size = N, let's do at least size: N?
Or less "exact" code-wise, but more phonetic: N entries for N > 0, else empty.

This revision is now accepted and ready to land.Jan 16 2018, 1:10 PM
This revision was automatically updated to reflect the committed changes.