public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: remove cmd_list_element::pre_show_hook
@ 2021-05-12 16:27 Simon Marchi
  2021-05-13  8:56 ` Andrew Burgess
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2021-05-12 16:27 UTC (permalink / raw)
  To: gdb-patches

This is unused, remove it.

gdb/ChangeLog:

	* cli/cli-decode.h (struct cmd_list_element) <pre_show_hook>:
	Remove.
	* cli/cli-setshow.c (do_show_command): Adjust.

Change-Id: Ib9cd79d842550392b062309e1e5c079ad5d7571a
---
 gdb/cli/cli-decode.h  | 4 ----
 gdb/cli/cli-setshow.c | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index 214428eab048..da6013a6cc52 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -187,10 +187,6 @@ struct cmd_list_element
   /* If this command is deprecated, this is the replacement name.  */
   const char *replacement = nullptr;
 
-  /* If this command represents a show command, then this function
-     is called before the variable's value is examined.  */
-  void (*pre_show_hook) (struct cmd_list_element *c) = nullptr;
-
   /* Hook for another command to be executed before this command.  */
   struct cmd_list_element *hook_pre = nullptr;
 
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 1b14df70711b..35482e1c5cc6 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -708,10 +708,6 @@ do_show_command (const char *arg, int from_tty, struct cmd_list_element *c)
 
   gdb_assert (c->type == show_cmd);
 
-  /* Possibly call the pre hook.  */
-  if (c->pre_show_hook)
-    (c->pre_show_hook) (c);
-
   std::string val = get_setshow_command_value_string (c);
 
   /* FIXME: cagney/2005-02-10: There should be MI and CLI specific
-- 
2.30.1


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

* Re: [PATCH] gdb: remove cmd_list_element::pre_show_hook
  2021-05-12 16:27 [PATCH] gdb: remove cmd_list_element::pre_show_hook Simon Marchi
@ 2021-05-13  8:56 ` Andrew Burgess
  2021-05-13 14:14   ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2021-05-13  8:56 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

* Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> [2021-05-12 12:27:58 -0400]:

> This is unused, remove it.
> 
> gdb/ChangeLog:
> 
> 	* cli/cli-decode.h (struct cmd_list_element) <pre_show_hook>:
> 	Remove.
> 	* cli/cli-setshow.c (do_show_command): Adjust.

LGTM.

Thanks,
Andrew


> 
> Change-Id: Ib9cd79d842550392b062309e1e5c079ad5d7571a
> ---
>  gdb/cli/cli-decode.h  | 4 ----
>  gdb/cli/cli-setshow.c | 4 ----
>  2 files changed, 8 deletions(-)
> 
> diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
> index 214428eab048..da6013a6cc52 100644
> --- a/gdb/cli/cli-decode.h
> +++ b/gdb/cli/cli-decode.h
> @@ -187,10 +187,6 @@ struct cmd_list_element
>    /* If this command is deprecated, this is the replacement name.  */
>    const char *replacement = nullptr;
>  
> -  /* If this command represents a show command, then this function
> -     is called before the variable's value is examined.  */
> -  void (*pre_show_hook) (struct cmd_list_element *c) = nullptr;
> -
>    /* Hook for another command to be executed before this command.  */
>    struct cmd_list_element *hook_pre = nullptr;
>  
> diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
> index 1b14df70711b..35482e1c5cc6 100644
> --- a/gdb/cli/cli-setshow.c
> +++ b/gdb/cli/cli-setshow.c
> @@ -708,10 +708,6 @@ do_show_command (const char *arg, int from_tty, struct cmd_list_element *c)
>  
>    gdb_assert (c->type == show_cmd);
>  
> -  /* Possibly call the pre hook.  */
> -  if (c->pre_show_hook)
> -    (c->pre_show_hook) (c);
> -
>    std::string val = get_setshow_command_value_string (c);
>  
>    /* FIXME: cagney/2005-02-10: There should be MI and CLI specific
> -- 
> 2.30.1
> 

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

* Re: [PATCH] gdb: remove cmd_list_element::pre_show_hook
  2021-05-13  8:56 ` Andrew Burgess
@ 2021-05-13 14:14   ` Simon Marchi
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2021-05-13 14:14 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

On 2021-05-13 4:56 a.m., Andrew Burgess wrote:
> * Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> [2021-05-12 12:27:58 -0400]:
> 
>> This is unused, remove it.
>>
>> gdb/ChangeLog:
>>
>> 	* cli/cli-decode.h (struct cmd_list_element) <pre_show_hook>:
>> 	Remove.
>> 	* cli/cli-setshow.c (do_show_command): Adjust.
> 
> LGTM.

Thanks, pushed.

Simon

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

end of thread, other threads:[~2021-05-13 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 16:27 [PATCH] gdb: remove cmd_list_element::pre_show_hook Simon Marchi
2021-05-13  8:56 ` Andrew Burgess
2021-05-13 14:14   ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).