From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76160 invoked by alias); 18 May 2018 02:14:10 -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 76044 invoked by uid 89); 18 May 2018 02:14:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=shortcuts, life, documents X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 May 2018 02:14:07 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D7D8C1E512; Thu, 17 May 2018 22:14:05 -0400 (EDT) Subject: Re: [RFC 0/5] Implenent 'frame apply COMMAND', enhance 'thread apply COMMAND' To: Philippe Waroquiers , gdb-patches@sourceware.org References: <20180505192804.12731-1-philippe.waroquiers@skynet.be> From: Simon Marchi Message-ID: Date: Fri, 18 May 2018 10:42:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180505192804.12731-1-philippe.waroquiers@skynet.be> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-05/txt/msg00400.txt.bz2 On 2018-05-05 03:27 PM, Philippe Waroquiers wrote: > This patch series : > * implements a new command > 'frame apply [all | COUNT | -COUNT] [-FLAGS...] COMMAND'. > * enhance 'thread apply COMMAND' by adding a -FLAGS argument > * adds some shortcuts commands > * documents the above in gdb.texinfo and NEWS. > > Th new command 'frame apply' allows to apply a COMMAND to a number of frames, > or to all frames. > The optional -FLAGS... argument allows to control what output to produce > and how to handle errors raised when applying COMMAND to a frame. > > Some examples usages for this new command: > frame apply all info frame > Produce info frame for all frames > frame apply all p $sp > For each frame, print the location, followed by the frame sp > frame apply all -qq p $sp > Same as before, but -qq flags (q = quiet) indicate to only print > the frames sp. > frame apply all -vv p $sp > Same as before, but -vv flags (v = verbose) indicate to print > location and source line for each frame. > frame apply all p some_local_var_somewhere > Print some_local_var_somewhere in all frames. 'frame apply' > will abort as soon as the print command fails. > frame apply all -c p some_local_var_somewhere > Same as before, but -c flag (c = continue) means to > print the error and continue applying command in case the > print command fails. > frame apply all -s p some_local_var_somewhere > Same as before, but -s flag (s = silent) means to > be silent for frames where the print command fails. > In other words, this allows to 'search' the frame in which > some_local_var_somewhere can be printed. > > 'thread apply' command has been enhanced to also accepts a -FLAGS... > argument. > > Some examples usages for this new argument: > thread apply all -s frame apply all -s p some_local_var_somewhere > Prints the thread id, frame location and some_local_var_somewhere > value in frames of threads that have such local var. > > To make the life of the user easier, the most typical use cases > have shortcuts : > faas : shortcut for 'frame apply all -s' > taas : shortcut for 'thread apply all -s' > tfaas : shortcut for 'thread apply all -s frame apply all -s" > > An example usage : > tfaas p some_local_var_somewhere > same as the longer: > 'thread apply all -s frame apply all -s p some_local_var_somewhere' > > The patch serie provides the implementation and all user visible documentation. > > What is still missing is: > * Missing regression tests. > Not yet done as this is painful, and so is better done once there is > an agreement on the behaviour. > > * Missing ChangeLog. > Not yet done as this is painful, and is IMO close to or completely useless. > So, I will do it for the (first) RFA, once the flow of RFC comments > stops :). > Hi Philippe, I think this is really nice. I was really amazed by "thread apply all frame apply all", simple but powerful. As noted in my other message, I am not sure if it's a good idea to have similar syntax but different semantic for "thread apply" and "frame apply", it might confuse more than anything. I'm curious to know what you think about it. Other than that, I don't have any strong opinion on the syntax, it seems fine to me. Simon