]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove unused fetch_inferior_event and inferior_event_handler parameters
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 2 Jul 2020 12:37:26 +0000 (08:37 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 2 Jul 2020 12:40:44 +0000 (08:40 -0400)
I noticed that fetch_inferior_event receives the client_data parameter
from its caller, inferior_event_handler, but doesn't actually need it.
This patch removes it.  In turn, inferior_event_handler doesn't use its
parameter, so remove it too.

The `data` argument used when registering
remote_async_inferior_event_handler is changed to NULL, to avoid
confusion.  It could make people think that the value passed is used
somewhere, when in fact it's not.

gdb/ChangeLog:

* inf-loop.c (inferior_event_handler): Remove client_data param.
* inf-loop.h (inferior_event_handler): Likewise.
* infcmd.c (step_1): Adjust.
* infrun.c (proceed): Adjust.
(fetch_inferior_event): Remove client_data param.
(infrun_async_inferior_event_handler): Adjust.
* infrun.h (fetch_inferior_event): Remove `void *` param.
* linux-nat.c (handle_target_event): Adjust.
* record-btrace.c (record_btrace_handle_async_inferior_event):
Adjust.
* record-full.c (record_full_async_inferior_event_handler):
Adjust.
* remote.c (remote_async_inferior_event_handler): Adjust.

Change-Id: I3c2aa1eb0ea3e0985df096660d2dcd794674f2ea

gdb/ChangeLog
gdb/inf-loop.c
gdb/inf-loop.h
gdb/infcmd.c
gdb/infrun.c
gdb/infrun.h
gdb/linux-nat.c
gdb/record-btrace.c
gdb/record-full.c
gdb/remote.c

index 662e6b9ad1dfb3375ebbf22884fdc0054ab503a5..3d67327ea5144e49a3b698d7bba7732428d6f127 100644 (file)
@@ -1,3 +1,19 @@
+2020-07-02  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * inf-loop.c (inferior_event_handler): Remove client_data param.
+       * inf-loop.h (inferior_event_handler): Likewise.
+       * infcmd.c (step_1): Adjust.
+       * infrun.c (proceed): Adjust.
+       (fetch_inferior_event): Remove client_data param.
+       (infrun_async_inferior_event_handler): Adjust.
+       * infrun.h (fetch_inferior_event): Remove `void *` param.
+       * linux-nat.c (handle_target_event): Adjust.
+       * record-btrace.c (record_btrace_handle_async_inferior_event):
+       Adjust.
+       * record-full.c (record_full_async_inferior_event_handler):
+       Adjust.
+       * remote.c (remote_async_inferior_event_handler): Adjust.
+
 2020-07-01  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual.
index c40ae2394269ee64e4b5474bbef7ffcfa19b133c..cf746b8588cc231e5467f29164bc5ee785032681 100644 (file)
 /* General function to handle events in the inferior.  */
 
 void
-inferior_event_handler (enum inferior_event_type event_type, 
-                       gdb_client_data client_data)
+inferior_event_handler (enum inferior_event_type event_type)
 {
   switch (event_type)
     {
     case INF_REG_EVENT:
-      fetch_inferior_event (client_data);
+      fetch_inferior_event ();
       break;
 
     case INF_EXEC_COMPLETE:
index 4ddbcbcc69ae63d0b1639b3681aa0273d3d21369..ed27f5279dd1da7395aba482296750ef804dc1c7 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "target.h"             /* For enum inferior_event_type.  */
 
-extern void inferior_event_handler (enum inferior_event_type event_type, 
-                                   void* client_data);
+extern void inferior_event_handler (enum inferior_event_type event_type);
 
 #endif /* #ifndef INF_LOOP_H */
index 64eea883cb6a64470f91afa6f542567722a1ef16..cfc3169992544597a4e3b9eace310e431e5a6a07 100644 (file)
@@ -907,7 +907,7 @@ step_1 (int skip_subroutines, int single_inst, const char *count_string)
       thr->thread_fsm->clean_up (thr);
       proceeded = normal_stop ();
       if (!proceeded)
-       inferior_event_handler (INF_EXEC_COMPLETE, NULL);
+       inferior_event_handler (INF_EXEC_COMPLETE);
       all_uis_check_sync_execution_done ();
     }
 }
index 7bc405f103844cc527ba2c4b186b9f0d2123d9af..6b655d4430164268ee3aff92c9b1db2436e2131c 100644 (file)
@@ -2968,7 +2968,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
       /* The target for some reason decided not to resume.  */
       normal_stop ();
       if (target_can_async_p ())
-       inferior_event_handler (INF_EXEC_COMPLETE, NULL);
+       inferior_event_handler (INF_EXEC_COMPLETE);
       return;
     }
 
@@ -3933,7 +3933,7 @@ all_uis_on_sync_execution_starting (void)
    necessary cleanups.  */
 
 void
-fetch_inferior_event (void *client_data)
+fetch_inferior_event ()
 {
   struct execution_control_state ecss;
   struct execution_control_state *ecs = &ecss;
@@ -4050,7 +4050,7 @@ fetch_inferior_event (void *client_data)
 
            if (!proceeded)
              {
-               inferior_event_handler (INF_EXEC_COMPLETE, NULL);
+               inferior_event_handler (INF_EXEC_COMPLETE);
                cmd_done = 1;
              }
 
@@ -9422,7 +9422,7 @@ static const struct internalvar_funcs siginfo_funcs =
 static void
 infrun_async_inferior_event_handler (gdb_client_data data)
 {
-  inferior_event_handler (INF_REG_EVENT, NULL);
+  inferior_event_handler (INF_REG_EVENT);
 }
 
 void _initialize_infrun ();
index 980854135197c7fd2c66a0c8b40e5746ec10aa2d..49b28f01b6897fe341d753ecf57340245d96192d 100644 (file)
@@ -130,7 +130,7 @@ extern void stop_all_threads (void);
 
 extern void prepare_for_detach (void);
 
-extern void fetch_inferior_event (void *);
+extern void fetch_inferior_event ();
 
 extern void init_wait_for_inferior (void);
 
index 0a2bfdc57d48624936f4b85ab55f2194f3a7d75d..fde360f5080afaa5de2fe0bbba2c362dc5710144 100644 (file)
@@ -4232,7 +4232,7 @@ sigchld_handler (int signo)
 static void
 handle_target_event (int error, gdb_client_data client_data)
 {
-  inferior_event_handler (INF_REG_EVENT, NULL);
+  inferior_event_handler (INF_REG_EVENT);
 }
 
 /* Create/destroy the target events pipe.  Returns previous state.  */
index 226d56dfe3774dad2660a4a33f6801b516c426ce..718de62f28084bc093545af408f5431bd71789a4 100644 (file)
@@ -325,7 +325,7 @@ record_btrace_auto_disable (void)
 static void
 record_btrace_handle_async_inferior_event (gdb_client_data data)
 {
-  inferior_event_handler (INF_REG_EVENT, NULL);
+  inferior_event_handler (INF_REG_EVENT);
 }
 
 /* See record-btrace.h.  */
index 9d6e403e57611562a47419ffdcaa5d97d84d222e..1d8f1930a5b7fd67d427e85ee5bb2fb8d8cf3b73 100644 (file)
@@ -905,7 +905,7 @@ static struct async_event_handler *record_full_async_inferior_event_token;
 static void
 record_full_async_inferior_event_handler (gdb_client_data data)
 {
-  inferior_event_handler (INF_REG_EVENT, NULL);
+  inferior_event_handler (INF_REG_EVENT);
 }
 
 /* Open the process record target for 'core' files.  */
index d560c69eca41412904004c4911ae8816e21d973a..f7f99dc24fe8acc081de437368f7737d0cb337f6 100644 (file)
@@ -5605,8 +5605,7 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
 
   /* Register extra event sources in the event loop.  */
   rs->remote_async_inferior_event_token
-    = create_async_event_handler (remote_async_inferior_event_handler,
-                                 remote);
+    = create_async_event_handler (remote_async_inferior_event_handler, NULL);
   rs->notif_state = remote_notif_state_allocate (remote);
 
   /* Reset the target state; these things will be queried either by
@@ -14158,13 +14157,13 @@ remote_async_serial_handler (struct serial *scb, void *context)
 {
   /* Don't propogate error information up to the client.  Instead let
      the client find out about the error by querying the target.  */
-  inferior_event_handler (INF_REG_EVENT, NULL);
+  inferior_event_handler (INF_REG_EVENT);
 }
 
 static void
 remote_async_inferior_event_handler (gdb_client_data data)
 {
-  inferior_event_handler (INF_REG_EVENT, data);
+  inferior_event_handler (INF_REG_EVENT);
 }
 
 int