]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Restore info_command and breakpoint
authorTom Tromey <tromey@adacore.com>
Mon, 11 May 2020 21:28:12 +0000 (15:28 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 11 May 2020 21:30:40 +0000 (15:30 -0600)
As discussed on gdb-patches, this restores info_command and the
breakpoint on info_command in gdb-gdb.gdb.  This reverts a tiny part
of 0743fc83c03 ("Replace most calls to help_list and cmd_show_list"),
as well as 652fc23a30a ("Remove gdb-gdb.gdb breakpoint on disappeared
function info_command.").

gdb/ChangeLog
2020-05-11  Tom Tromey  <tromey@adacore.com>

* cli/cli-cmds.c (info_command): Restore.
(_initialize_cli_cmds): Use add_prefix_command for "info".
* gdb-gdb.gdb.in: Restore breakpoint on info_command.

gdb/ChangeLog
gdb/cli/cli-cmds.c
gdb/gdb-gdb.gdb.in

index c88961fac1ac9c4a0d60fb75e394f7427a58e5c0..3db87b99d5d5e51a660122cad2bce99fdf947bf1 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-11  Tom Tromey  <tromey@adacore.com>
+
+       * cli/cli-cmds.c (info_command): Restore.
+       (_initialize_cli_cmds): Use add_prefix_command for "info".
+       * gdb-gdb.gdb.in: Restore breakpoint on info_command.
+
 2020-05-11  Tom Tromey  <tromey@adacore.com>
 
        * ada-lang.c (ada_value_primitive_field): Now public.
index 1b677f5d7a197889ec8691ffec569827b5da7d5a..104d273812f2a21a69f652a9979eba9a87049838 100644 (file)
@@ -191,6 +191,17 @@ error_no_arg (const char *why)
   error (_("Argument required (%s)."), why);
 }
 
+/* This implements the "info" prefix command.  Normally such commands
+   are automatically handled by add_basic_prefix_cmd, but in this case
+   a separate command is used so that it can be hooked into by
+   gdb-gdb.gdb.  */
+
+static void
+info_command (const char *arg, int from_tty)
+{
+  help_list (infolist, "info ", all_commands, gdb_stdout);
+}
+
 /* See cli/cli-cmds.h.  */
 
 void
@@ -2189,9 +2200,9 @@ Without an argument, history expansion is enabled."),
                           show_history_expansion_p,
                           &sethistlist, &showhistlist);
 
-  add_basic_prefix_cmd ("info", class_info, _("\
+  add_prefix_cmd ("info", class_info, info_command, _("\
 Generic command for showing things about the program being debugged."),
-                       &infolist, "info ", 0, &cmdlist);
+                 &infolist, "info ", 0, &cmdlist);
   add_com_alias ("i", "info", class_info, 1);
   add_com_alias ("inf", "info", class_info, 1);
 
index b647445e8c9e62124875a3915f4e00184a2b20b2..53dca0e08feac8a7608fda230406f528383b046a 100644 (file)
@@ -7,6 +7,15 @@ if !$gdb_init_done
 
   b internal_error
 
+  # This provides an easy way to break into the top-level GDB by
+  # typing "info".
+  b info_command
+  commands
+    silent
+    # This avoids the voluminous output of "info".
+    return
+  end
+
   dir @srcdir@/../libiberty
   dir @srcdir@/../bfd
   dir @srcdir@