From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55268 invoked by alias); 9 Feb 2017 15:46:35 -0000 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 Received: (qmail 55258 invoked by uid 89); 9 Feb 2017 15:46:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=variation, tuples, H*f:sk:86ddf1f, H*i:sk:86ddf1f X-HELO: mail-io0-f172.google.com Received: from mail-io0-f172.google.com (HELO mail-io0-f172.google.com) (209.85.223.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Feb 2017 15:46:24 +0000 Received: by mail-io0-f172.google.com with SMTP id j18so19800727ioe.2 for ; Thu, 09 Feb 2017 07:46:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iXWV/cqW/SWRmXkPTT7b95b2gCMnlPO/5Cy54B+BVBY=; b=XUUdc2A/66Z2vv52gFehNzCqE9grjgUhPF9wz8hCv/HVEUSb0e74W8XBkmvqFJlNed Gte4Casuvjwvp6ti2p5PFCDc0tzu/Z1yaWnZEt4Qgpg0hY9and6DUq1D4ypqbADN3Dtk BITIXnHd4dgo91ytBn8xxWKhPeHGTW6EA/gvv0dR9mRlb/6W1qBlNHEJayZOERsafpqA eSKIIjtTYVbtMf0Mo8mfEVG8cEX+DlaDSC6ihp+IftBrFL/bpnxs1oiswDVyBvfJvOOX rOSxt8SNST1ChoD94ljBaH83hvYB1KTR3w0xF6sUObSkqpdtJ7NJbC/qIDBPKuvotRFn 3FtQ== X-Gm-Message-State: AMke39mp9dCqJ7NygO/HdNQMo0uLH9tFbSSrT8fNfpAEc/ktv4SPSQRSFOAKdQr69gbPOM/X3fIWYnZuN2yOYg== X-Received: by 10.107.131.39 with SMTP id f39mr3716435iod.40.1486655182784; Thu, 09 Feb 2017 07:46:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.208.84 with HTTP; Thu, 9 Feb 2017 07:46:22 -0800 (PST) In-Reply-To: <86ddf1f5-a957-5a99-deac-936848b10190@redhat.com> References: <20170115134253.24018-1-tom@tromey.com> <20170115134253.24018-2-tom@tromey.com> <20170116113021.sar3yh5ivykpqmbw@ball> <87inok708e.fsf@tromey.com> <10eb506c-e8be-de98-e9b0-77cedd69cc92@redhat.com> <86ddf1f5-a957-5a99-deac-936848b10190@redhat.com> From: Matt Rice Date: Thu, 09 Feb 2017 15:46:00 -0000 Message-ID: Subject: Re: [RFA 1/5] Remove some ui_out-related cleanups from Python To: Pedro Alves Cc: Tom Tromey , Trevor Saunders , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00227.txt.bz2 On Thu, Feb 9, 2017 at 4:51 AM, Pedro Alves wrote: > On 02/09/2017 12:48 PM, Pedro Alves wrote: >> Hi Matt, >> >> On 02/09/2017 04:34 AM, Matt Rice wrote: >> >>> Wondering if this would be a good opportunity to try and transition >>> ui_out_list construction into a more type safe manner, e.g. >>> result ==> variable "=" value >>> list ==> "[]" | "[" value ( "," value )* "]" | "[" result ( "," result )* "]" >>> >>> currently when building a list, it didn't specify whether you were >>> declaring a list of results or a list of values, unless/until the >>> first value or result was added, and IIRC this | property wasn't >>> really explicitly enforced. >> >> More type-safety sounds good to me. :-) >> >> Can you give an example of a command that outputs a result list, >> and an example of a command that outputs a value list? >> There is a good example of a command which outputs both in the documentation (in the example below "The -break-insert command") interpreter-exec mi -break-insert main interpreter-exec mi -break-insert -t foo interpreter-exec mi -break-list in the output of the -break-list command there is a list of results of the form: body=[bkpt=... , bkpt=...] https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html#g_t_002dbreak_002dinsert I picked that one specifically because it shows the duplicate "bkpt" keys. inside those bkpt={... thread-groups=["i1"] ... } should be a list of values. interpreter-exec mi -list-thread-groups is a slightly easier to read one that returns a list of values (tuples) ^done,groups=[tuple, ...] Additionally of note is: https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Output-Syntax.html#GDB_002fMI-Output-Syntax * New gdb/mi commands should only output lists containing values. So, i suppose result_list should be some variation on compat_only_result_list or some such... >>> it'd be nice to migrate this to something like: >>> result_list, value_list, deprecated_unspecified_list, It would be nice >>> to know if/when you guys think it would be a convenient time to >>> introduce such a change so I could get back up to speed... >> >> Simon has already C++-fyed ui_out in master, so this seems like >> a good time to me. > > Though, to be clear, IIUC, you're talking about changing > GDB internals without affecting the resulting MI output, right? Yes, internals change only,