From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13936 invoked by alias); 21 Sep 2009 12:39:36 -0000 Received: (qmail 13927 invoked by uid 22791); 21 Sep 2009 12:39:35 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,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; Mon, 21 Sep 2009 12:39:30 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1MpiAs-0002fl-JZ for gdb-patches@sources.redhat.com; Mon, 21 Sep 2009 14:39:22 +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 ; Mon, 21 Sep 2009 14:39:22 +0200 Received: from vladimir by h86-62-88-129.ln.rinet.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Sep 2009 14:39:22 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: [PATCH:gdb/mi] Update a specified list of variable objects Date: Mon, 21 Sep 2009 12:39:00 -0000 Message-ID: References: <19127.27863.973393.962895@totara.tehura.co.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00660.txt.bz2 Nick Roberts wrote: > Since -var-list-children currently creates variable objects of all children > and this may be a large number, I would like to be able to restrict > -var-update to just update those variable objects whose expressions are > visible in the front end. This could be done by updating them individually > but that might result in many round trips. I would therefore like to commit > the following patch which allows a list of variable objects to be specified in > the argument to -var-update: > > -var-update [PRINT_VALUES] NAME1 NAME2 ... > Hi Nick, the general idea seems good. There is a minor issue. You have made this change - if (argc == 2) - print_values = mi_parse_values_option (argv[0]); - else - print_values = PRINT_NO_VALUES; + while (1) + { + int opt = mi_getopt ("mi_cmd_var_update", + argc, argv, opts, &optind, &optarg); mi_parse_values_option used to accept 0, 1 and 2, in addition to string values, and your change breaks that. So, I observe this: (gdb) -var-create foo @ 10 ^done,name="foo",numchild="0",value="10",type="int",has_more="0" (gdb) -var-update 0 foo ^error,msg="Variable object not found" and it works for me with 6.8 Would it be easier to rename mi_parse_values_option to mi_parse_values_option_nothrow and write new mi_parse_values_option that would call mi_parse_values_option_nothrow and call error as necessary? - Volodya