Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Restore info_command and breakpoint
@ 2020-05-05 17:02 Tom Tromey
  2020-05-05 18:26 ` Christian Biesinger
  2020-05-11 21:28 ` Tom Tromey
  0 siblings, 2 replies; 6+ messages in thread
From: Tom Tromey @ 2020-05-05 17:02 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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-05  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      |  6 ++++++
 gdb/cli/cli-cmds.c | 15 +++++++++++++--
 gdb/gdb-gdb.gdb.in |  6 ++++++
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 1b677f5d7a1..104d273812f 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -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);
 
diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
index b647445e8c9..05a38b2670b 100644
--- a/gdb/gdb-gdb.gdb.in
+++ b/gdb/gdb-gdb.gdb.in
@@ -7,6 +7,12 @@ if !$gdb_init_done
 
   b internal_error
 
+  b info_command
+  commands
+    silent
+    return
+  end
+
   dir @srcdir@/../libiberty
   dir @srcdir@/../bfd
   dir @srcdir@
-- 
2.21.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Restore info_command and breakpoint
  2020-05-05 17:02 [PATCH] Restore info_command and breakpoint Tom Tromey
@ 2020-05-05 18:26 ` Christian Biesinger
  2020-05-05 18:51   ` Philippe Waroquiers
  2020-05-05 19:00   ` Tom Tromey
  2020-05-11 21:28 ` Tom Tromey
  1 sibling, 2 replies; 6+ messages in thread
From: Christian Biesinger @ 2020-05-05 18:26 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Tue, May 5, 2020 at 12:03 PM Tom Tromey <tromey@adacore.com> wrote:
>
> 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-05  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      |  6 ++++++
>  gdb/cli/cli-cmds.c | 15 +++++++++++++--
>  gdb/gdb-gdb.gdb.in |  6 ++++++
>  3 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
> index 1b677f5d7a1..104d273812f 100644
> --- a/gdb/cli/cli-cmds.c
> +++ b/gdb/cli/cli-cmds.c
> @@ -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);
>
> diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
> index b647445e8c9..05a38b2670b 100644
> --- a/gdb/gdb-gdb.gdb.in
> +++ b/gdb/gdb-gdb.gdb.in
> @@ -7,6 +7,12 @@ if !$gdb_init_done
>
>    b internal_error
>
> +  b info_command

It would probably be good to add a comment here?
# This provides an easy way to break into the top-level GDB by typing "info"

> +  commands
> +    silent
> +    return
> +  end
> +
>    dir @srcdir@/../libiberty
>    dir @srcdir@/../bfd
>    dir @srcdir@
> --
> 2.21.1
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Restore info_command and breakpoint
  2020-05-05 18:26 ` Christian Biesinger
@ 2020-05-05 18:51   ` Philippe Waroquiers
  2020-05-05 19:00     ` Tom Tromey
  2020-05-05 19:00   ` Tom Tromey
  1 sibling, 1 reply; 6+ messages in thread
From: Philippe Waroquiers @ 2020-05-05 18:51 UTC (permalink / raw)
  To: Christian Biesinger, Tom Tromey; +Cc: gdb-patches

On Tue, 2020-05-05 at 13:26 -0500, Christian Biesinger via Gdb-patches wrote:

> > diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
> > index b647445e8c9..05a38b2670b 100644
> > --- a/gdb/gdb-gdb.gdb.in
> > +++ b/gdb/gdb-gdb.gdb.in
> > @@ -7,6 +7,12 @@ if !$gdb_init_done
> > 
> >    b internal_error
> > 
> > +  b info_command
> 
> It would probably be good to add a comment here?
> # This provides an easy way to break into the top-level GDB by typing "info"
Yes, good idea.
Even    ... by typing "info" or "i".
Also, a comment to explain the return, something like:
# return to avoid the long output of "info" command list.
as the objective of this was not crystal clear to everybody.
 
> 
> > +  commands
> > +    silent
> > +    return
> > +  end
> > +
> >    dir @srcdir@/../libiberty
> >    dir @srcdir@/../bfd
> >    dir @srcdir@
> > --
> > 2.21.1
> > 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Restore info_command and breakpoint
  2020-05-05 18:26 ` Christian Biesinger
  2020-05-05 18:51   ` Philippe Waroquiers
@ 2020-05-05 19:00   ` Tom Tromey
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2020-05-05 19:00 UTC (permalink / raw)
  To: Christian Biesinger; +Cc: Tom Tromey, gdb-patches

>>>>> "Christian" == Christian Biesinger <cbiesinger@google.com> writes:

>> +  b info_command

Christian> It would probably be good to add a comment here?
Christian> # This provides an easy way to break into the top-level GDB by typing "info"

Good idea, I added this.

Tom


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Restore info_command and breakpoint
  2020-05-05 18:51   ` Philippe Waroquiers
@ 2020-05-05 19:00     ` Tom Tromey
  0 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2020-05-05 19:00 UTC (permalink / raw)
  To: Philippe Waroquiers; +Cc: Christian Biesinger, Tom Tromey, gdb-patches

>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> Also, a comment to explain the return, something like:
Philippe> # return to avoid the long output of "info" command list.
Philippe> as the objective of this was not crystal clear to everybody.
 
I resemble that remark.
Anyway I added a comment along these lines.

Tom


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Restore info_command and breakpoint
  2020-05-05 17:02 [PATCH] Restore info_command and breakpoint Tom Tromey
  2020-05-05 18:26 ` Christian Biesinger
@ 2020-05-11 21:28 ` Tom Tromey
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2020-05-11 21:28 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:

Tom> As discussed on gdb-patches, this restores info_command and the
Tom> breakpoint on info_command in gdb-gdb.gdb.  This reverts a tiny part
Tom> of 0743fc83c03 ("Replace most calls to help_list and cmd_show_list"),
Tom> as well as 652fc23a30a ("Remove gdb-gdb.gdb breakpoint on disappeared
Tom> function info_command.").

I'm checking this in.

Tom


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-11 21:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 17:02 [PATCH] Restore info_command and breakpoint Tom Tromey
2020-05-05 18:26 ` Christian Biesinger
2020-05-05 18:51   ` Philippe Waroquiers
2020-05-05 19:00     ` Tom Tromey
2020-05-05 19:00   ` Tom Tromey
2020-05-11 21:28 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox