[PATCH] gdbtk: Remove use deprecated_interactive_hook

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] gdbtk: Remove use deprecated_interactive_hook

Andrew Burgess
The deprecated_interactive_hook is currently setup to point to an
empty function.  Removing this will allow a small clean up in GDB.
The empty function used by deprecated_interactive_hook currently looks
like this:

    /* Come here during long calculations to check for GUI events.  Usually invoked
       via the QUIT macro.  */

    void
    gdbtk_interactive (void)
    {
      /* Tk_DoOneEvent (TK_DONT_WAIT|TK_IDLE_EVENTS); */
    }

As far as I can tell this function has been empty for years.  If in
the future we do ever want or need to implement something like
gdbtk_interactive, then we would be better off adding a new observable
to GDB, but I don't see a reason to add one at this point just so that
gdbtk can call an empty function.

ChangeLog:

        * gdbtk/generic/gdbtk-hooks.c (gdbtk_add_hooks): Don't setup
        deprecated_interactive_hook.
        * gdbtk/generic/gdbtk.c (gdbtk_interactive): Delete.
        * gdbtk/generic/gdbtk.h (gdbtk_interactive): Delete declaration.
---
 gdbtk/generic/gdbtk-hooks.c |  1 -
 gdbtk/generic/gdbtk.c       | 11 -----------
 gdbtk/generic/gdbtk.h       |  1 -
 3 files changed, 13 deletions(-)

diff --git a/gdbtk/generic/gdbtk-hooks.c b/gdbtk/generic/gdbtk-hooks.c
index f2a5771..f973c79 100644
--- a/gdbtk/generic/gdbtk-hooks.c
+++ b/gdbtk/generic/gdbtk-hooks.c
@@ -143,7 +143,6 @@ gdbtk_add_hooks (void)
   deprecated_query_hook = gdbtk_query;
   deprecated_warning_hook = gdbtk_warning;
 
-  deprecated_interactive_hook = gdbtk_interactive;
   deprecated_target_wait_hook = gdbtk_wait;
   deprecated_ui_load_progress_hook = gdbtk_load_hash;
 
diff --git a/gdbtk/generic/gdbtk.c b/gdbtk/generic/gdbtk.c
index 977c47d..b7b99c3 100644
--- a/gdbtk/generic/gdbtk.c
+++ b/gdbtk/generic/gdbtk.c
@@ -112,8 +112,6 @@ extern
 
 void gdbtk_init (void);
 
-void gdbtk_interactive (void);
-
 static void tk_command (const char *, int);
 
 static int target_should_use_timer (struct target_ops *t);
@@ -578,15 +576,6 @@ gdbtk_uninstall_notifier (void)
  * The rest of this file contains the start-up, and event handling code for gdbtk.
  */
 
-/* Come here during long calculations to check for GUI events.  Usually invoked
-   via the QUIT macro.  */
-
-void
-gdbtk_interactive (void)
-{
-  /* Tk_DoOneEvent (TK_DONT_WAIT|TK_IDLE_EVENTS); */
-}
-
 /* Start a timer which will keep the GUI alive while in target_wait. */
 void
 gdbtk_start_timer (void)
diff --git a/gdbtk/generic/gdbtk.h b/gdbtk/generic/gdbtk.h
index 8cd5482..7bb1f79 100644
--- a/gdbtk/generic/gdbtk.h
+++ b/gdbtk/generic/gdbtk.h
@@ -156,7 +156,6 @@ extern void gdbtk_stop_timer (void);
 extern void gdbtk_start_timer (void);
 extern long gdbtk_getpid(void);
 extern void gdbtk_ignorable_warning (const char *, const char *);
-extern void gdbtk_interactive (void);
 extern int x_event (int);
 extern int gdbtk_two_elem_cmd (char *, const char *);
 extern int target_is_native (struct target_ops *t);
--
2.14.5

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] gdbtk: Remove use deprecated_interactive_hook

Keith Seitz
On 6/18/19 3:32 AM, Andrew Burgess wrote:

> The deprecated_interactive_hook is currently setup to point to an
> empty function.  Removing this will allow a small clean up in GDB.
> The empty function used by deprecated_interactive_hook currently looks
> like this:
>
>     /* Come here during long calculations to check for GUI events.  Usually invoked
>        via the QUIT macro.  */
>
>     void
>     gdbtk_interactive (void)
>     {
>       /* Tk_DoOneEvent (TK_DONT_WAIT|TK_IDLE_EVENTS); */
>     }
>
> As far as I can tell this function has been empty for years.  If in
> the future we do ever want or need to implement something like
> gdbtk_interactive, then we would be better off adding a new observable
> to GDB, but I don't see a reason to add one at this point just so that
> gdbtk can call an empty function.
>
> ChangeLog:
>
> * gdbtk/generic/gdbtk-hooks.c (gdbtk_add_hooks): Don't setup
> deprecated_interactive_hook.
> * gdbtk/generic/gdbtk.c (gdbtk_interactive): Delete.
> * gdbtk/generic/gdbtk.h (gdbtk_interactive): Delete declaration.

Wowser, how time flies when you're working on a release!

I would approve this, but it appears that Patrick has already adjusted the code
based on the related patch getting into gdb:

commit d8772263cdb55564e93528cf16248d3479d23346 (HEAD -> master, origin/master, origin/HEAD)
Author: Patrick Monnerat <[hidden email]>
Date:   Thu Jun 20 14:58:09 2019 +0200

    Upgrade submodule, sync code.
   
    deprecated_interactive hook has disappeared: remove its (noop) use.
   
    * gdbtk/generic/gdbtk-hooks.c (gdbtk_add_hooks): remove setting of
      deprecated_interactive_hook.
    * gdbtk/generic/gdbtk.[ch] (gdbtk_interactive): remove.

I appreciate that you took the time to take a look, and, of course, thanks for
the patch.

Keith