From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16423 invoked by alias); 15 Nov 2006 16:29:54 -0000 Received: (qmail 16412 invoked by uid 22791); 15 Nov 2006 16:29:53 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 15 Nov 2006 16:29:41 +0000 Received: (qmail 8862 invoked from network); 15 Nov 2006 16:29:39 -0000 Received: from unknown (HELO ?172.16.64.38?) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 15 Nov 2006 16:29:39 -0000 From: Vladimir Prus To: Daniel Jacobowitz Subject: Re: MI: -var-list-children --simple-values Date: Wed, 15 Nov 2006 16:29:00 -0000 User-Agent: KMail/1.9.1 Cc: Nick Roberts , gdb-patches@sources.redhat.com References: <200611151250.11654.vladimir@codesourcery.com> <200611151755.02301.vladimir@codesourcery.com> <20061115150940.GA26174@nevyn.them.org> In-Reply-To: <20061115150940.GA26174@nevyn.them.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200611151929.29567.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00128.txt.bz2 On Wednesday 15 November 2006 18:09, Daniel Jacobowitz wrote: > On Wed, Nov 15, 2006 at 05:55:02PM +0300, Vladimir Prus wrote: > > Why? Especially, why it's better than --all-values. Note that > > --simple-values only don't print values of arrays, structures and unions, > > and if you check c_value_of_variable, you'll see that for structures just > > a literal string is returned, while for array very trivial formatting > > operation is used. > > > > In other words, --all-values do not involve any complex processing, > > reading data from the target, or anything. What are we trying to save by > > adding --simple-values? > > But the result of --all-values where it differs from --simple-values is > probably not used. I've never used an IDE that printed out the > collapsed value of a struct; Eclipse? KDevelop? I can send you screenshots, but I hope you'll believe me saying that both use "{...}" as value of a structure. > I didn't invent --simple-values though, I just added it to -var-update. > Nick added it to -stack-list-locals on 20-Jan-2004. Ah here: > http://sourceware.org/ml/gdb/2003-11/msg00055.html This is in fact completely different change. Here's what "-stack-list-locals --all-values" produces: ^done,locals=[{name="the_struct",value="{a_fr = 120, b = 333, inner_fr = {i = 0, j = 5, k = 5}, c = 3, pad = {0 }, d = 10, pad2 = {0 }, e = 10}"}] So, the difference between --all-values and --simple-values is dramatic. In case of --var-list-children you don't get full structure printed. You won't even have the structure *read* (with my laziness patch, that is). So, while --simple-values might be reasonable for -stack-list-locals, it's not all that needed for -var-list-children. - Volodya