From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31278 invoked by alias); 26 Nov 2019 23:34:36 -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 31225 invoked by uid 89); 26 Nov 2019 23:34:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=reminds, vinfo, UD:info, monitor X-HELO: mailsec117.isp.belgacom.be Received: from mailsec117.isp.belgacom.be (HELO mailsec117.isp.belgacom.be) (195.238.20.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Nov 2019 23:34:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1574811272; x=1606347272; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=JFX21Ao5NahOvOFfz7Zn4MazDRZdswssv9orKO4b3bU=; b=N4uIywQgX79K3+unYyr9qq2fAwKnUUawx8WtoKiEQZc6g3ENKChk6iQ0 l8QpbDgNq1I8dJFiPPt+IMQ7vMpqCA==; IronPort-SDR: IeYYqrxer5vej340Al+42TWkLHD4rziIYzY1cx1/RcjE7AD6YsMPBDt624x9RP9ashuJNb8SuS LYEWG3pdT/uGEYg2ZB3FglfQSIWGxt6P5R33/VEiFVwQpJg8ldT/6v0y5EDhd+bEWglxPIee22 1s5TzHm7lldkTlG76EN3fnp8meA2huAZQbzC3hgbeb20YdvaDcTAuVdWpEuCdvszGbeLTv1BjS Ugdm47gxtyGx7W+E5mXvyjj0dpmimM6y1ixIIPYLNFxkZvpHyrmX54YB3gg0w2Pst/noWzasBF vls= Received: from 136.173-134-109.adsl-dyn.isp.belgacom.be (HELO md.home) ([109.134.173.136]) by relay.skynet.be with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Nov 2019 00:34:29 +0100 From: Philippe Waroquiers To: gdb-patches@sourceware.org Subject: [RFAv2 0/4] More flexible user-defined commands prefixing and naming. Date: Tue, 26 Nov 2019 23:34:00 -0000 Message-Id: <20191126233423.14801-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00983.txt.bz2 More flexible user-defined commands prefixing and naming. This patch series improves the way a user can define user commands using CLI sequences of commands. Currently, a user can define a command after an existing command prefix e.g. define target mycommand but cannot define a prefix to define command such as: define mytargetprefix mycommand. This patch series adds the command 'define-prefix to allow user commands to be prefix commands. Also, this patch series adds . as an allowed character for user defined commands. This can e.g. be used to define a set of Valgrind specific user command corresponding to the Valgrind monitor commands (such as check_memory, v.info, v.set, ...). This then allows to use GDB completion and expression evaluation for sending monitor commands e.g. to Valgrind; For example, for the Valgrind monitor 'check_memory' command: check_memory [addressable|defined] [] check that (or 1) bytes at have the given accessibility and outputs a description of we can now define some new GDB commands such as: (gdb) define-prefix Vmonitor (gdb) define-prefix Vmonitor check_memory (gdb) define Vmonitor check_memory addressable eval "monitor check_memory addressable %#lx %d", $arg0, $arg1 end (gdb) define Vmonitor check_memory defined eval "monitor check_memory defined %#lx %d", $arg0, $arg1 end (gdb) Compared to the 'raw' monitor command, the new GDB commands provide completion and evaluation of expressions. This is the second version of the patch series. Compared to the first version, this handles the comments of Simon. 2 changes worth mentionning here: * The command name was changed to define-prefix. * In case the user redefines a command that is also a prefix command, the confirmation message is now: (gdb) define-prefix xxxx (gdb) define xxxx Keeping subcommands of prefix command "xxxx". Redefine command "xxxx"? (y or n) This reminds the user that the subcommands of the prefix command xxxx are kept even when xxxx is redefined. The doc was slightly changed according to the changes above.