From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126421 invoked by alias); 28 May 2018 19:37:49 -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 126412 invoked by uid 89); 28 May 2018 19:37:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:_initia, sp, UD:be, Prints X-HELO: mailsec111.isp.belgacom.be Received: from mailsec111.isp.belgacom.be (HELO mailsec111.isp.belgacom.be) (195.238.20.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 28 May 2018 19:37:45 +0000 IronPort-PHdr: =?us-ascii?q?9a23=3As2SCzRRScTME8cZ6zoLOnOyIB9psv+yvbD5Q0YIu?= =?us-ascii?q?jvd0So/mwa69YhaN2/xhgRfzUJnB7Loc0qyK6/umATRIyK3CmUhKSIZLWR4BhJ?= =?us-ascii?q?detC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+?= =?us-ascii?q?KPjrFY7OlcS30P2594HObwlSizexfb1/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf?= =?us-ascii?q?5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbD?= =?us-ascii?q?VwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlS?= =?us-ascii?q?gHLSY0/mLKhMJwkqxVrhCupxJjzIDTb46bO+Fzfr/fcN4AWWZMRNpdWi5HD4ih?= =?us-ascii?q?b4UPFe0BPeNAoofnp1sOrB++BQi0BOP31DBDm3/50rcg0+QmCAHGwQ0gEMwUsH?= =?us-ascii?q?TPsd74M78SUeC0zKnMzDXDd+tW1inn5InGaB8hu/aMXattccrQ10YvDRjFg06L?= =?us-ascii?q?qYzmPzKV0PoCs3SB4+V7S+2ikmgqoBxyrDi33sohiZTFipgLxl3L6Cl12oY4Kc?= =?us-ascii?q?CiREJmfdKpE51dvDyAOYRsWMMtWWRotT4/yr0BpJG0YjAHyI8ixx7Dc/yHdJWI?= =?us-ascii?q?4g77WOaRPzh4gHVldaq6hxmv6USgy+v8Wdeo0FtSrSdJj8PAum4C2hDO8MSKSu?= =?us-ascii?q?Zx8l281TqT1A3f8uRELlo1larfJZ4h2Lkwlp8LvETbHi/2mUH2jK6OdkU85Oek?= =?us-ascii?q?8ermba/8pp+bLo90lwD+Pbo0msykGuk4KQsOXmid+euiyL3v51b2T6tSgv0sjq?= =?us-ascii?q?bZqIzaJdgcpqOhDA9az50s5w+nDzi8zNQXgXkHI0xeeB+clIjpPEzOIOrkAvih?= =?us-ascii?q?jVWjii1ryO7cMr3mGJXNISuLrLC0crp3rlZV1AEzwMt3/JVJELoMP/vpVwn2rt?= =?us-ascii?q?OLIAU+NlmMw+fjCc1l28shUHiIG7KYPbnJ+QuQ5uMrIvGUackKsSz6MuUk6uT1?= =?us-ascii?q?pWQ6iFkQYe+j0M1EOziDAv16LhDBMjLXidAbHDJSsw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2CWAgA1Wgxb/2wz8VFbH4NWJD5tEiiDM?= =?us-ascii?q?EeIY44EMQFdkzuBeAsbEAGEQAKCDiI0GAECAQEBAQEBAgFrHAyCNSKCUgEFIzM?= =?us-ascii?q?zCBsCAiYCAjkeGRkBgwqCA6RBghyEWYNkgWiBCYkBP4EPiwCCVAKYYgcCgWeEB?= =?us-ascii?q?Yh0gTs+iwwBh1WJNoFBOIFSbYMWCYI/hgqHfj0wgQ0IDAGPBwEB?= X-IPAS-Result: =?us-ascii?q?A2CWAgA1Wgxb/2wz8VFbH4NWJD5tEiiDMEeIY44EMQFdkzu?= =?us-ascii?q?BeAsbEAGEQAKCDiI0GAECAQEBAQEBAgFrHAyCNSKCUgEFIzMzCBsCAiYCAjkeG?= =?us-ascii?q?RkBgwqCA6RBghyEWYNkgWiBCYkBP4EPiwCCVAKYYgcCgWeEBYh0gTs+iwwBh1W?= =?us-ascii?q?JNoFBOIFSbYMWCYI/hgqHfj0wgQ0IDAGPBwEB?= Received: from 108.51-241-81.adsl-dyn.isp.belgacom.be (HELO md) ([81.241.51.108]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 28 May 2018 21:37:42 +0200 Message-ID: <1527536262.1703.7.camel@skynet.be> Subject: [PING] [RFA 0/8] Implement 'frame apply COMMAND', enhance 'thread apply COMMAND' From: Philippe Waroquiers To: gdb-patches@sourceware.org Date: Mon, 28 May 2018 22:18:00 -0000 In-Reply-To: <20180521110651.13842-1-philippe.waroquiers@skynet.be> References: <20180521110651.13842-1-philippe.waroquiers@skynet.be> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00746.txt.bz2 Ping. Thanks Philippe On Mon, 2018-05-21 at 13:06 +0200, Philippe Waroquiers wrote: > Implement 'frame apply COMMAND', enhance 'thread apply COMMAND' > > Compared to RFC, this handles all comments received from Eli and Simon, > and completes the changes so that it is (should be) ready for RFA. > > 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. > * adds a unit test for cli-utils.c > * adds test for 'frame apply' > * modify gdb.threads/pthreads.exp to test 'thread apply' -FLAGS argument > > 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' > > gdb/ChangeLog > 2018-05-21 Philippe Waroquiers > > * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add > unittests/cli-utils-selftests.c > * NEWS: Mention new commands. Mention change to 'thread apply'. > * cli-utils.c (number_or_range_parser::get_number): Only handle > numbers or convenience var as numbers. > (check_for_flags): New function. > (check_for_flags_vqcs): New function. > * cli-utils.h (check_for_flags): New function. > (check_for_flags_vqcs): New function. > * stack.c: (trailing_outermost_frame): New function, mostly > extracted from backtrace_command_1. > (backtrace_command_1): Update to call trailing_outermost_frame. > (frame_apply_command_count): New function. > (frame_apply_all_command): New function. > (frame_apply_command): New function. > (faas_command): New function. > (frame_cmd_list): New variable. > (_initialize_stack): Update to setup the new commands 'frame apply' > and 'faas'. > * thread.c (thr_try_catch_cmd): New function. > (thread_apply_all_command): Handle vqcs flags. > (thread_apply_command): Handle vqcs flags. > (taas_command): New function. > (tfaas_command): New function. > (_initialize_thread): Update to setup the new commands 'taas > and 'tfaas'. Change doc string for 'thread apply'. > * unittests/cli-utils-selftests.c: New file. > > gdb/testsuite/ChangeLog > 2018-05-21 Philippe Waroquiers > > * gdb.base/frameapply.c: New file. > * gdb.base/frameapply.exp: New file. > * gdb.threads/pthreads/exp: Test vqcs FLAGS. > > gdb/doc/ChangeLog > 2018-05-21 Philippe Waroquiers > > * gdb.texinfo (Debugging Programs with Multiple Threads): > Document changes to 'thread apply'. Document 'taas'. > Document 'tfaas'. > (Examining the Stack): Document 'frame apply'. Document 'faas'.