From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsec109.isp.belgacom.be (mailsec109.isp.belgacom.be [195.238.20.105]) by sourceware.org (Postfix) with ESMTPS id 75FD7388C022 for ; Sun, 21 Jun 2020 18:31:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 75FD7388C022 IronPort-SDR: lWLpL6imCVNVJ1ZOIJt7X8Zwqj5e0VqqUaczJxXMiacMasukJclKIW/G6wKfL1syUfBnGLwtgW /Dp/USTNBOtmZpbTi2owsZ4mRm7Wq1+59yLlGlfwqvZL4kolepqmmAbYEcdqkZWjZSFbXsLYNa EooRtqgZd+fHOEjFmJISgTKa+pOtokSOGujhlv5fqPeW7wMQpEnHQhR2goozmlVE/XwcSqEV5V QXNmDBHp6XSL8b21QSA4+7OpTFlbwdo5EkAzkqoexjmN0cjbrCTgkjrTOajHTXKRm7VOhRYzB1 zgE= IronPort-PHdr: =?us-ascii?q?9a23=3A4eR4LBYAmKA3/uMy8Gs5gXv/LSx+4OfEezUN45?= =?us-ascii?q?9isYplN5qZr8qzbnLW6fgltlLVR4KTs6sC17OL9fmwASdZu8jJmUtBWaQEbw?= =?us-ascii?q?UCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFR?= =?us-ascii?q?rlKAV6OPn+FJLMgMSrzeCy/IDYbxlViDanbr5+MRW7oR/MusQVnYduJbs9xg?= =?us-ascii?q?XIr3BVZ+lY2GRkKE6JkR3h/Mmw5plj8ypRu/Il6cFNVLjxcro7Q7JFEjkoKn?= =?us-ascii?q?g568L3uxbNSwuP/WYcXX4NkhVUGQjF7Qr1UYn3vyDnq+dywiiaPcnxTbApRT?= =?us-ascii?q?Sv6rpgRRH0hCsbMTMy7WfagdFygq1GuhKsvxxxzZDJbo+bN/RweazSc9wBSG?= =?us-ascii?q?ZdXctcTTBND5mgY4cTCecKIOZWr5P6p1sLtRawHwmsBOLryj9Jnn/2xbM12P?= =?us-ascii?q?khHg7cxgwgGMsOsGnVrNrrLqcSSv2+wa7QzTXDbvNW3Tb96JDQch8/u/2NU6?= =?us-ascii?q?h/cdDWyUk2CgPFj0ufqZb+Pz6OzeQNsGia7+x+WuKzkWIosB9+ryGpy8wxhY?= =?us-ascii?q?bHmpgbxUrY9SVl3ok1P9u4RVZ4bNOrDJdcqT2WOpV5T84gQ29ltig0xqEJt5?= =?us-ascii?q?C0cyUExooryRDBZvGFb4SF4B3tWeePLDplmH5oeq6yiRm9/ES9zOD3S8q60E?= =?us-ascii?q?5SoyZbj9XBtGoB2wHd58WGUPdw/Vqt1SyB2g3d7OxPPFo6mrDBK5E7x749jp?= =?us-ascii?q?8TsUPeESDogEj2l6qWdlk8+uiv9uTnfq3qpp+COI9wjQHzKqEuldGlDeQ4NQ?= =?us-ascii?q?gOWnaU9fy91L3l40L5XK1HguMrnqTbqpzWOMoWq6+jDwJWz4ov8RiyAjm+3N?= =?us-ascii?q?Qdh3YHLVZFeBydj4juPlHDOOj4Dfe+g1SokTdr3+jGMaP7DpTDNHfDirDhfa?= =?us-ascii?q?9g605d1gUz18tf6olPCrECIPPzXFH+tMDCAhAiLQO42/znB8ll1oMCRWKPBb?= =?us-ascii?q?eUMKzPvlCT/+4vO/ODZJMJtzb9Nfcl/OXjjWQ+mV8AZ6mmwYUYaX6iEfR8PU?= =?us-ascii?q?qVe33sgs0OETRCgg1rQ+DgzUWLTTVTam2aRKUh/Do2F4u8AMHEXI/+rqaG2X?= =?us-ascii?q?KDHpxSZ3heBxizGG3vbpiFVu0XIHaKIs5lkyQcWP6+QpUmzAyvuRXh46FkP+?= =?us-ascii?q?zZ5msSuMSwh5BO++TPmERqpnRPBMOH3jTVQg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2BlCACZpu9e/yFRiNlmHQEBPAEFBQE?= =?us-ascii?q?CAQkBHIFFg2uOBIV5nCaBaAsBAQEBAQEBAQEILAECBAEBhnIlOBMCAwEBAQM?= =?us-ascii?q?CBQEBBgEBAQEBAQUEAYYORYI7IoNOASNygRyDDIMBuDSFUYNvgUCBOAGHdYR?= =?us-ascii?q?8gUw/gRGCYoUPZ4UnBI8SpD9aKAeCXYEGBAuYBQ8gnnuwG4FqgXhtgz1PGQ2?= =?us-ascii?q?OKheOJkJnAgYIAQEDCVcBIgGNQi2CFwEB?= X-IPAS-Result: =?us-ascii?q?A2BlCACZpu9e/yFRiNlmHQEBPAEFBQECAQkBHIFFg2uOB?= =?us-ascii?q?IV5nCaBaAsBAQEBAQEBAQEILAECBAEBhnIlOBMCAwEBAQMCBQEBBgEBAQEBA?= =?us-ascii?q?QUEAYYORYI7IoNOASNygRyDDIMBuDSFUYNvgUCBOAGHdYR8gUw/gRGCYoUPZ?= =?us-ascii?q?4UnBI8SpD9aKAeCXYEGBAuYBQ8gnnuwG4FqgXhtgz1PGQ2OKheOJkJnAgYIA?= =?us-ascii?q?QEDCVcBIgGNQi2CFwEB?= 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; 21 Jun 2020 20:31:36 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Subject: [RFAv8 0/3] Allow the user to define default args for aliases Date: Sun, 21 Jun 2020 20:31:27 +0200 Message-Id: <20200621183130.11503-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=-7.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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, 21 Jun 2020 18:31:40 -0000 Allow the user to define default args for user-defined aliases. This is version 8 of the patch series. The documentation (NEWS and gdb.texinfo) should be re-reviewed, as default-args are now only provided by the 'alias' command. Compared to version 7 and 6: It removes the commands 'set|show default-args' as these could introduce a future backward incompatibility if alias expansion would be done dynamically by GDB when executing the alias. For the same reason, 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. When relevant, the 'set/show default-args' have been converted to use the 'alias' command or 'help aliases'. 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 changes the alias command to be: alias [-a] [--] ALIAS = COMMAND [DEFAULT-ARGS...] Using the above default-args, you can 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'.