From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19193 invoked by alias); 1 Jul 2009 13:13:18 -0000 Received: (qmail 19179 invoked by uid 22791); 1 Jul 2009 13:13:17 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_00,BOTNET,SPF_PASS X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Jul 2009 13:13:10 +0000 Received: from totara (238.60.255.123.dynamic.snap.net.nz [123.255.60.238]) by viper.snap.net.nz (Postfix) with ESMTP id 480E23DA2FA; Thu, 2 Jul 2009 01:13:07 +1200 (NZST) Received: by totara (Postfix, from userid 1000) id EA011C14D; Thu, 2 Jul 2009 01:13:04 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19019.24800.902658.94531@totara.tehura.co.nz> Date: Wed, 01 Jul 2009 13:13:00 -0000 To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: [mi] -stack-list-arguments --simple-values In-Reply-To: <200906301339.30711.vladimir@codesourcery.com> References: <200906301339.30711.vladimir@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00009.txt.bz2 > This patch makes -stack-list-arguments --simple-values work. > It looks like --simple-values (and friends) were accepted for > -stack-list-locals, but not for -stack-list-arguments. While > the utility of such human friendly spelling is unclear, for > a machine interface, it's even more confusing having 1/2 > of relevant commands accept it. It's not immediately clear from the manual that SHOW-VALUES from -stack-list-arguments and PRINT-VALUES from -stack-list-locals are related. -stack-list-arguments takes three arguments while -stack-list-locals only takes -one. I think it would be nice to have one command, -stack-list-locals-and-args say, that lists both the locals and the arguments of the current frame: The `-stack-list-locals-and-args' Command -------------------------------- Synopsis ........ -stack-list-locals-and-args PRINT-VALUES Display the local variable and argument names for the selected frame. If PRINT-VALUES is 0 or `--no-values', print only the names of the variables; if it is 1 or `--all-values', print also their values; and if it is 2 or `--simple-values', print the name, type and value for simple data types and the name and type for arrays, structures and unions. In this last case, a frontend can immediately display the value of simple data types and create variable objects for other data types when the user wishes to explore their values in more detail. GDB Command ........... `info locals' and `info locals' in GDB. Example ....... (gdb) -stack-list-locals-and-args 0 ^done,vars={locals={name="A",name="B",name="C"}, args={name="arg1",name="arg2"}} (gdb) -stack-list-locals-and-args --all-values ^done,vars={locals={{name="A",value="1"},{name="B",value="2"}, {name="C",value="{1, 2, 3}"}},args={{name="arg1",value="5"}, {name="arg4",value="6.2"}}} (gdb) using curly brackets which appears to be more in keeping with the JSON concept of an object. -- Nick http://www.inet.net.nz/~nickrob