From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsec103.isp.belgacom.be (mailsec103.isp.belgacom.be [195.238.20.99]) by sourceware.org (Postfix) with ESMTPS id A171A383E83C for ; Sun, 14 Jun 2020 16:39:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A171A383E83C IronPort-SDR: fEkMGzu4PuQLm12s4u54DuHgU1I0ZUZAmgz4jTAfDfUmP3MJ6uquC2RfGjUbmrVtVhp5YrIrG+ plkvy67Z3MlxWsHTgimwvxaMJkVJQqE0+J7XfNdA0kGJb1vW2YCjSF8Gvp6ZqqhK9Rw3AgvvGz j2LqnzZ/LML55Ri9lGSS+B5W11eR1Rz2aLoKVxPeu8Z1nnxejHrRis3tmQvKzMRdl8RpAsFOUg W0yNCuUq9NCS0hzTRdjdP3G94cjTg7PAkWcyYx6Pg2Op0ELJYhJcih0fVm39vgDCvP5WURLWKB aKY= IronPort-PHdr: =?us-ascii?q?9a23=3ARoTEdBM28d0x7ro0JBAl6mtUPXoX/o7sNwtQ0K?= =?us-ascii?q?IMzox0IvryrarrMEGX3/hxlliBBdydt6sZzbOI7eu5ATBIyK3CmUhKSIZLWR?= =?us-ascii?q?4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBx?= =?us-ascii?q?rwKxd+KPjrFY7OlcS30P2594HObwlSizexfLN/IA+roQjQt8QajpZuJro+xx?= =?us-ascii?q?DUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG?= =?us-ascii?q?8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XC?= =?us-ascii?q?mp4ql3RBP0jioMKjg0+3zVhMNtlqJWuBKvqQJizYDaY4+bM/VxcKzGcN8GRm?= =?us-ascii?q?dMRNpdWjZdDo+gaYYEEuoPPfxfr4n4v1YAtxu+BQioBOPu0j9InmH51rA63O?= =?us-ascii?q?s7CwHG2xUgH88PsHvKttX1L7oZXOetzKnIzDXDa/JW2S/l6IfWaBwgr+uDXa?= =?us-ascii?q?h3ccrI1EkvFh3Kjk+LqYH+JDOV1eQMs26F4Op8T+6gkHAophh3rzOyycgilp?= =?us-ascii?q?PHiZgJylDY6yp52oA1KMW7RUN0fdKoDodcuj+VOoZ0Qs0vTW9mtDo1xLMJtp?= =?us-ascii?q?O1cjYGxpo5yhPdd/CKcYeG7xP9WeuMPTt1hm5odr2wihqv90Wr1+7yVtGs3V?= =?us-ascii?q?pUsyZIkMPAum0D2hHS8MSKSeZx8l2v1DuB0Q3Y9/tKLloulaXBLp4s2rswlp?= =?us-ascii?q?0OvkvdBiL2g0D2jLOOdkUj5+io9/zrYrX4qZ+YMI95kgT+Pbk0lsy/BuQ4Nx?= =?us-ascii?q?YBU3Ca+eS6yrLj4VX0TKtXgvA0iKXVrZ7XKMUBqqO6HgNZyIgu5hinAzejyt?= =?us-ascii?q?sYnH0HLFxfeBKAiojkI0nOIPD5Dfe7glSsiC9ryO7cMrzvGJrNNH/DkK78fb?= =?us-ascii?q?Z89UFc0hEzwMtE55JXCrABJuz8WlPruNPDEBA1Kxa0zPr/CNVhyoMeXnqCAq?= =?us-ascii?q?CEP6zJqFOI/vggI/WQa48Vpjn9MOMo5+XpjX8kg18SYbem3JUNZ3CiAPtqOU?= =?us-ascii?q?KZYWDjgoRJLWBfsQY0CfTjlFaCXCV7fHGvRakx+TghBcShF4iQaJqqhem53C?= =?us-ascii?q?a/H4VOayh5A0qLCGrpep+fE6MUaCOWI9d5n3obXKKmUpIg2Au1nBT52rxqMq?= =?us-ascii?q?ze93tL5trYyNFp6riLxlkJ/jtuApHF3g=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AIBABKUuZe/yFRiNlmHgE8DAILHIF?= =?us-ascii?q?Dg22OBIV1nBAUgWgLAQEBAQEBAQEBCCwBAgQBAYZzJTYHDgIDAQEBAwIFAQE?= =?us-ascii?q?GAQEBAQEBBQQBhgxHgjsig04BI3KEKIMBtHaFUYNUgUCBOIdihHeBTD+BEYJ?= =?us-ascii?q?ihQ9nhScEjwyJcJo/WigHglyBBgQLl3cPIJ5nr2yBWgyBfG2DPU8ZDY4qF44?= =?us-ascii?q?mQmcCBggBAQMJVwEiAY4BLYIXAQE?= X-IPAS-Result: =?us-ascii?q?A2AIBABKUuZe/yFRiNlmHgE8DAILHIFDg22OBIV1nBAUg?= =?us-ascii?q?WgLAQEBAQEBAQEBCCwBAgQBAYZzJTYHDgIDAQEBAwIFAQEGAQEBAQEBBQQBh?= =?us-ascii?q?gxHgjsig04BI3KEKIMBtHaFUYNUgUCBOIdihHeBTD+BEYJihQ9nhScEjwyJc?= =?us-ascii?q?Jo/WigHglyBBgQLl3cPIJ5nr2yBWgyBfG2DPU8ZDY4qF44mQmcCBggBAQMJV?= =?us-ascii?q?wEiAY4BLYIXAQE?= Received: from 33.81-136-217.adsl-dyn.isp.belgacom.be (HELO md.home) ([217.136.81.33]) by relay.skynet.be with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Jun 2020 18:39:48 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Subject: [RFAv7 0/3] Allow the user to define default args for aliases Date: Sun, 14 Jun 2020 18:39:39 +0200 Message-Id: <20200614163942.19176-1-philippe.waroquiers@skynet.be> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2020 16:39:52 -0000 Allow the user to define default args for user-defined aliases. This is version 7 of the patch series. Compared to version 6, it implements the prevention of defining an alias of an alias having default args, as suggested by Simon. This prevention is implemented in cli-cmds.c validate_aliased_command (which is valid_command_p renamed and modified). The default-args.exp test was enhanced to test this prevention. In the documentation, the following sentence was added in @node Aliases: @var{COMMAND} can also be the name of an existing alias. In this case, @var{COMMAND} cannot be an alias that has default arguments. The version 6 of the patch series did the following changes, compared to the previous version: * it handles the comment of Simon that default args should only be available for user-defined aliases and not for GDB commands and GDB pre-defined aliases. As default args are now only for user-defined aliases, the 'show/set enable-default-args [on|off]' commands have been removed. * documentation changed accordingly. * help and apropos now shows the full definition of the aliases having default args. Previous versions handled the comments of Christian/Eli/Pedro/Tom/Simon. This patch series implements, tests and documents the following commands: set default-args ALIAS [DEFAULT-ARGS...] show default-args [ALIAS] It also changes the alias command to be: alias [-a] [--] ALIAS = COMMAND [DEFAULT-ARGS...] Using the above default-args commands and arguments, you can define default arguments for commands or define powerful aliases. For example: alias bt_ALL = backtrace -entry-values both -frame-arg all -past-main -past-entry -full defines the alias bt_ALL that will give as much information as possible in a backtrace. Default args can usefully be combined with the 'with' command, such as: Make "wLapPeu" an alias of 2 nested "with": alias wLapPeu = with language pascal -- with print elements unlimited -- or have an alias pp10 to pretty print an expression with a maximum of 10 elements: alias pp10 = with print pretty -- with print elem 10 -- print This patch series also adds a completer for 'alias'. For what concerns changing 'alias -a' to 'alias -abbreviation": This can for sure be done (and be backward compatible). This can however be done as a separate patch (I still also need to do a similar change for the 'qcs' flags).