From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9508 invoked by alias); 9 Sep 2009 21:54:32 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 9457 invoked by uid 22791); 9 Sep 2009 21:54:30 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <200909091640.50374.vladimir@codesourcery.com> References: <200909091640.50374.vladimir@codesourcery.com> Date: Wed, 09 Sep 2009 21:54:00 -0000 Message-ID: Subject: Re: Pretty-printed MI vars with children get "{...}" instead of the wanted string From: Noam Yorav-Raphael To: Vladimir Prus Cc: archer@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2009-q3/txt/msg00197.txt.bz2 Where is the code of std::vector pretty-printer? I haven't found it in the gdb sources. Perhaps it may be changed, so printing the to_string() result in MI would be possible? 2009/9/9 Vladimir Prus : > On Wednesday 09 September 2009 Noam Yorav-Raphael wrote: > >> Keeping things stable is, of course, a sensible thing to do. >> >> But I still have a question. When I do a simple "print" of an object >> with a pretty-printer, I get something like: >> >> $1 =3D x=3D0 =3D { >> =C2=A0 s =3D {a =3D 0, b =3D 0}, >> =C2=A0 x =3D 0 >> } >> >> That is, both the to_string() result and the children are printed. So >> why should the std::vector to_string() return a large string with all >> the elements in the vector, if whenever it's printed all the elements >> are printed again after it? >> >> What I'm saying is this: It seems to me that for both CLI and MI, if a >> pretty-printer provides the children() method, its to_string() methods >> should return a short abstract of the object's content, not the full >> content. And if that is the case, there's no reason to hide the >> to_string() result in MI. >> >> What do you think? > > I do not know why in the vector pretty printer produces such a long > string. Note that it does not duplicates contents, just uses too may > words to say what the size and capacity is. > > - Volodya >