From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 927BC385AE5F for ; Thu, 9 Jun 2022 09:27:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 927BC385AE5F Received: from fencepost.gnu.org ([2001:470:142:3::e]:51036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzES6-0000cY-4I for gdb@sourceware.org; Thu, 09 Jun 2022 05:27:42 -0400 Received: from ip5f5a89c6.dynamic.kabel-deutschland.de ([95.90.137.198]:52966 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzES5-0003Jv-OU for gdb@sourceware.org; Thu, 09 Jun 2022 05:27:41 -0400 Message-ID: Date: Thu, 9 Jun 2022 11:27:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-US To: gdb ml From: Simon Sobisch Subject: help text of aliased commands using "with" Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2022 09:27:43 -0000 Using aliases works fine in general; the help only works if there's a direct alias. 1 direct alias - nearly fine help: (gdb) alias asdf = print (gdb) help asdf print, asdf, inspect, p Print value of expression EXP. Usage: print [[OPTION]... --] [/FMT] [EXP] [... rest of print help] 2 alias with default arguments - perfect (gdb) alias asdfa = print -elements unlimited -elements unlimited (gdb) help asdfa print, asdfa, asdf, inspect, p alias asdfa = print -elements unlimited -elements unlimited Print value of expression EXP. Usage: print [[OPTION]... --] [/FMT] [EXP] [... rest of print help] 3 alias with potentially nested "with", seems broken (gdb) alias -- asdfw = with print elements unlimited -- with print \ repeats unlimited -- print (gdb) help asdfw with, asdfw, w alias asdfw = with print elements unlimited -- with print repeats unlimited -- print Temporarily set SETTING to VALUE, run COMMAND, and restore SETTING. Usage: with SETTING [VALUE] [-- COMMAND] Usage: w SETTING [VALUE] [-- COMMAND] With no COMMAND, repeats the last executed command. SETTING is any setting you can change with the "set" subcommands. E.g.: with language pascal -- print obj with print elements unlimited -- print obj You can change multiple settings using nested with, and use abbreviations for commands and/or values. E.g.: w la p -- w p el u -- p obj The second one is better than the first, as it lists the alias, too. The third one shows that the alias is considered to be aliasing the "with" command, which is technically understandable, but from a user-point of view it is still the COMMAND that is aliased (in this case "print"). Questions: 1 Can the alias always be printed? scenario 1 misses the line alias asdf = print" I guess that's possibly a small bug fix. 2 Is it possible to adjust "alias --" to let its help point to the actual COMMAND? Preferably with the help for the parameters requested? Draft output (as in scenario 2 + output of the "with" entries as shown with "help set print elements unlimited"): (gdb) help asdfw print, asdfa, asdfw, asdf, inspect, p alias -- asdfw = with print elements unlimited -- with print repeats unlimited print Print value of expression EXP. Usage: print [[OPTION]... --] [/FMT] [EXP] [... rest of print help] print repeats unlimited Set threshold for repeated print elements. "unlimited" causes all elements to be individually printed. print elements unlimited Set limit on string chars or array elements to print. "unlimited" causes there to be no limit. 3 If this isn't possible then could the help of "alias --" entries be adjusted to "just show the alias? Draft output for that: (gdb) help asdfw alias -- asdfw = with print elements unlimited -- with print repeats unlimited print Do "help with", "help print" for info on commands executed. Simon