From patchwork Sat Jan 3 21:55:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 4498 Received: (qmail 10302 invoked by alias); 3 Jan 2015 21:56:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10292 invoked by uid 89); 3 Jan 2015 21:56:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f45.google.com Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 03 Jan 2015 21:56:34 +0000 Received: by mail-pa0-f45.google.com with SMTP id lf10so26086890pab.4 for ; Sat, 03 Jan 2015 13:56:32 -0800 (PST) X-Received: by 10.66.186.110 with SMTP id fj14mr132359482pac.98.1420322192577; Sat, 03 Jan 2015 13:56:32 -0800 (PST) Received: from sspiff.org (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id ta9sm50141591pbc.50.2015.01.03.13.56.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Jan 2015 13:56:31 -0800 (PST) Received: by sspiff.org (sSMTP sendmail emulation); Sat, 03 Jan 2015 13:55:41 -0800 From: Doug Evans To: gdb-patches@sourceware.org, eliz@gnu.org Subject: [PATCH] Add aliases "i ty" and "i so". Date: Sat, 03 Jan 2015 13:55:41 -0800 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. I'd gotten tired enough of fully typing out "info types" and "info source" (which otherwise collide with "info type-printers" and "info sources") that I have this in my .gdbinit: alias i ty = info types alias i so = info source Does anyone want a more generally available solution? Another way to go is to put the "alias" solution in a more public place (the faq or some such). I don't have a strong preference, just in a "spring cleaning" kind of mood. :-) I thought of maybe "i t" for "info types" but I can't think of a reason to prefer "t" for "types" or "threads", so I'm going with "ty" which I think is pretty safe. "s" is taken ("info stack", which is fine by me), so I went with "so" for "source". 2015-01-03 Doug Evans * source.c (_initialize_source): Add "info so" as an alias for "info source". * symtab.c (_initialize_symtab): Add "info ty" as an alias for "info types". doc/ * gdb.texinfo (Symbols): Document "info ty" and "info so" aliases. diff --git a/gdb/source.c b/gdb/source.c index 574d9fa..8551713 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -2053,6 +2053,7 @@ $cdir in the path means the compilation directory of the source file."), add_info ("source", source_info, _("Information about the current source file.")); + add_info_alias ("so", "source", 1); add_info ("line", line_info, _("\ Core addresses of the code for a source line.\n\ diff --git a/gdb/symtab.c b/gdb/symtab.c index b5d8d63..62b7a70 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -5455,6 +5455,7 @@ All global and static variable names, or those matching REGEXP.")); there is much disagreement "info types" can be fixed). */ add_info ("types", types_info, _("All type names, or those matching REGEXP.")); + add_info_alias ("ty", "types", 1); add_info ("sources", sources_info, _("Source files in the program.")); diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index f4d7132..e1595d8 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -16210,7 +16210,9 @@ completely specified. @kindex info types @item info types @var{regexp} +@itemx info ty @var{regexp} @itemx info types +@itemx info ty Print a brief description of all types whose names match the regular expression @var{regexp} (or all types in your program, if you supply no argument). Each complete typename is matched as though it were a @@ -16267,6 +16269,7 @@ collect}. @kindex info source @item info source +@itemx info so Show information about the current source file---that is, the source file for the function containing the current point of execution: @itemize @bullet