gdb: remove unused fetch_inferior_event and inferior_event_handler parameters

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
This commit is contained in:
Simon Marchi 2020-07-02 08:37:26 -04:00
parent 0942c7ab94
commit b1a35af270
10 changed files with 31 additions and 18 deletions

View 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> 2020-07-01 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual. * tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual.

View File

@ -34,13 +34,12 @@
/* General function to handle events in the inferior. */ /* General function to handle events in the inferior. */
void void
inferior_event_handler (enum inferior_event_type event_type, inferior_event_handler (enum inferior_event_type event_type)
gdb_client_data client_data)
{ {
switch (event_type) switch (event_type)
{ {
case INF_REG_EVENT: case INF_REG_EVENT:
fetch_inferior_event (client_data); fetch_inferior_event ();
break; break;
case INF_EXEC_COMPLETE: case INF_EXEC_COMPLETE:

View File

@ -22,7 +22,6 @@
#include "target.h" /* For enum inferior_event_type. */ #include "target.h" /* For enum inferior_event_type. */
extern void inferior_event_handler (enum inferior_event_type event_type, extern void inferior_event_handler (enum inferior_event_type event_type);
void* client_data);
#endif /* #ifndef INF_LOOP_H */ #endif /* #ifndef INF_LOOP_H */

View File

@ -907,7 +907,7 @@ step_1 (int skip_subroutines, int single_inst, const char *count_string)
thr->thread_fsm->clean_up (thr); thr->thread_fsm->clean_up (thr);
proceeded = normal_stop (); proceeded = normal_stop ();
if (!proceeded) if (!proceeded)
inferior_event_handler (INF_EXEC_COMPLETE, NULL); inferior_event_handler (INF_EXEC_COMPLETE);
all_uis_check_sync_execution_done (); all_uis_check_sync_execution_done ();
} }
} }

View File

@ -2968,7 +2968,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
/* The target for some reason decided not to resume. */ /* The target for some reason decided not to resume. */
normal_stop (); normal_stop ();
if (target_can_async_p ()) if (target_can_async_p ())
inferior_event_handler (INF_EXEC_COMPLETE, NULL); inferior_event_handler (INF_EXEC_COMPLETE);
return; return;
} }
@ -3933,7 +3933,7 @@ all_uis_on_sync_execution_starting (void)
necessary cleanups. */ necessary cleanups. */
void void
fetch_inferior_event (void *client_data) fetch_inferior_event ()
{ {
struct execution_control_state ecss; struct execution_control_state ecss;
struct execution_control_state *ecs = &ecss; struct execution_control_state *ecs = &ecss;
@ -4050,7 +4050,7 @@ fetch_inferior_event (void *client_data)
if (!proceeded) if (!proceeded)
{ {
inferior_event_handler (INF_EXEC_COMPLETE, NULL); inferior_event_handler (INF_EXEC_COMPLETE);
cmd_done = 1; cmd_done = 1;
} }
@ -9422,7 +9422,7 @@ static const struct internalvar_funcs siginfo_funcs =
static void static void
infrun_async_inferior_event_handler (gdb_client_data data) 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 (); void _initialize_infrun ();

View File

@ -130,7 +130,7 @@ extern void stop_all_threads (void);
extern void prepare_for_detach (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); extern void init_wait_for_inferior (void);

View File

@ -4232,7 +4232,7 @@ sigchld_handler (int signo)
static void static void
handle_target_event (int error, gdb_client_data client_data) 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. */ /* Create/destroy the target events pipe. Returns previous state. */

View File

@ -325,7 +325,7 @@ record_btrace_auto_disable (void)
static void static void
record_btrace_handle_async_inferior_event (gdb_client_data data) 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. */ /* See record-btrace.h. */

View File

@ -905,7 +905,7 @@ static struct async_event_handler *record_full_async_inferior_event_token;
static void static void
record_full_async_inferior_event_handler (gdb_client_data data) 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. */ /* Open the process record target for 'core' files. */

View 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. */ /* Register extra event sources in the event loop. */
rs->remote_async_inferior_event_token rs->remote_async_inferior_event_token
= create_async_event_handler (remote_async_inferior_event_handler, = create_async_event_handler (remote_async_inferior_event_handler, NULL);
remote);
rs->notif_state = remote_notif_state_allocate (remote); rs->notif_state = remote_notif_state_allocate (remote);
/* Reset the target state; these things will be queried either by /* 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 /* Don't propogate error information up to the client. Instead let
the client find out about the error by querying the target. */ 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 static void
remote_async_inferior_event_handler (gdb_client_data data) remote_async_inferior_event_handler (gdb_client_data data)
{ {
inferior_event_handler (INF_REG_EVENT, data); inferior_event_handler (INF_REG_EVENT);
} }
int int