This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add aliases "i ty" and "i so".


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".

        * 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]