From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23440 invoked by alias); 9 Sep 2009 12:40:59 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 23373 invoked by uid 22791); 9 Sep 2009 12:40:57 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org From: Vladimir Prus To: "Noam Yorav-Raphael" Subject: Re: Pretty-printed MI vars with children get "{...}" instead of the wanted string Date: Wed, 09 Sep 2009 12:40:00 -0000 User-Agent: KMail/1.11.90 (Linux/2.6.24-24-generic; KDE/4.2.90; i686; svn-979530; 2009-06-10) Cc: archer@sourceware.org References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200909091640.50374.vladimir@codesourcery.com> X-SW-Source: 2009-q3/txt/msg00195.txt.bz2 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 = x=0 = { > s = {a = 0, b = 0}, > x = 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