This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug mi/11335] -var-evaluate-expression should return the pretty printer's to_string result


------- Additional Comments From jens dot elmenthaler at verigy dot com  2010-03-30 07:20 -------
(In reply to comment #3)
> I actually though that this summary is both too huge and not particularly
> useful in a frontend. Say, the type of container is already knows, so all
> the summary say is report the size. Maybe, for containers, we want to show
> [N] as opposed to {...}?
Yes, from the requirements point, this is what I miss most. Currently, I have 
to expand the collection variable, if I just want to see how many elements it 
contains. And this doesn't work well, because in a large collection I also 
have to scroll to the end.

Lets assume your proposal, how would you decide it's a collection? You take 
the display hint and if it's map or vector, it's collection. Next, how will 
you determine the number of childen? You cannot use the children method and 
use the iterate over all elements. If the collection is uninitialized, it may 
never return. Alternatively, you could add a new method to the pretty printers.

It all boyls down to what our understanding of the to_string method is. Shall 
it just provide a short summary to identify an object, or shall it be used to 
dump all members in a string? I always interpreted as the first.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11335

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]