From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18114 invoked by alias); 19 Sep 2009 11:15:07 -0000 Received: (qmail 18036 invoked by uid 22791); 19 Sep 2009 11:15:05 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_14,J_CHICKENPOX_74,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Sep 2009 11:15:00 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1Moxu4-0005y4-Kg for gdb-patches@sources.redhat.com; Sat, 19 Sep 2009 13:14:56 +0200 Received: from h86-62-88-129.ln.rinet.ru ([86.62.88.129]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Sep 2009 13:14:56 +0200 Received: from vladimir by h86-62-88-129.ln.rinet.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Sep 2009 13:14:56 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: [MI] -stack-list-variables Date: Sat, 19 Sep 2009 11:15:00 -0000 Message-ID: References: <200909191412.37692.vladimir@codesourcery.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1322368.j9rNGIZT6d" Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.9 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-09/txt/msg00628.txt.bz2 --nextPart1322368.j9rNGIZT6d Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8Bit Content-length: 888 Vladimir Prus wrote: > > MI presently have two separate commands to list locals and arguments in > the current frame. Most often than not, frontend need both, so having > to emit two commands is inconvenience and and extra roundtrip. I believe > Nick has suggested having a single command, and Andre is in favour of > this idea, and I also think it's good. I actually recall than Nick planned > to write a patch, but I did not saw any, and this is fairly trivial > change, so here it goes. The new command is called -stack-list-variables, > and it's checked in into CVS HEAD. > > I'll post doc patch shortly; I will also merge this to 7.0 after a couple > of days, if no issues appear. On IRC, Matt Rice told me that gcc 4.5 complains that 'name_of_result' is potentially uninitialized. Now, that warnings is most utterly bogus, but I've checked in the workaround below. - Volodya --nextPart1322368.j9rNGIZT6d Content-Type: text/x-diff; name="stack-list-variables-fixup.diff" Content-Transfer-Encoding: 8Bit Content-Disposition: attachment; filename="stack-list-variables-fixup.diff" Content-length: 1416 ? A.diff ? commit_1.diff ? include.diff ? stack-list-variables.diff ? doc/ChangeLog.lines ? doc/ChangeLog.my ? doc/all ? doc/my ? doc/stack-list-variables-docs.diff Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.10883 diff -u -p -r1.10883 ChangeLog --- ChangeLog 19 Sep 2009 09:59:29 -0000 1.10883 +++ ChangeLog 19 Sep 2009 11:12:03 -0000 @@ -1,5 +1,10 @@ 2009-09-19 Vladimir Prus + * mi/mi-cmd-stack.c (list_args_or_locals): Workaround + gcc warning. + +2009-09-19 Vladimir Prus + * mi/mi-cmds.h (mi_cmd_stack_list_variables): Declare. * mi/mi-cmds.c (mi_cmds): Register -stack-list-variables. * mi/mi-cmd-stack.c (enum what_to_list): New. Index: mi/mi-cmd-stack.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmd-stack.c,v retrieving revision 1.45 diff -u -p -r1.45 mi-cmd-stack.c --- mi/mi-cmd-stack.c 19 Sep 2009 09:59:29 -0000 1.45 +++ mi/mi-cmd-stack.c 19 Sep 2009 11:12:04 -0000 @@ -261,6 +261,8 @@ list_args_or_locals (enum what_to_list w name_of_result = "args"; break; case all: name_of_result = "variables"; break; + default: + gdb_assert (("unexpected value", 0)); } cleanup_list = make_cleanup_ui_out_list_begin_end (uiout, name_of_result); --nextPart1322368.j9rNGIZT6d--