Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: gdb-patches@sourceware.org, eliz@gnu.org
Subject: [PATCH] Add aliases "i ty" and "i so".
Date: Sat, 03 Jan 2015 21:56:00 -0000	[thread overview]
Message-ID: <m34ms7pm02.fsf@seba.sebabeach.org> (raw)

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  <xdje42@gmail.com>

	* 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


             reply	other threads:[~2015-01-03 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-03 21:56 Doug Evans [this message]
2015-01-04  3:38 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34ms7pm02.fsf@seba.sebabeach.org \
    --to=xdje42@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox