GNU Binutils with patches for OS216
Révision | b1a35af2704842ff1a90626b0148c0fc93f995f6 (tree) |
---|---|
l'heure | 2020-07-02 21:40:44 |
Auteur | Simon Marchi <simon.marchi@poly...> |
Commiter | Simon Marchi |
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
@@ -1,3 +1,19 @@ | ||
1 | +2020-07-02 Simon Marchi <simon.marchi@polymtl.ca> | |
2 | + | |
3 | + * inf-loop.c (inferior_event_handler): Remove client_data param. | |
4 | + * inf-loop.h (inferior_event_handler): Likewise. | |
5 | + * infcmd.c (step_1): Adjust. | |
6 | + * infrun.c (proceed): Adjust. | |
7 | + (fetch_inferior_event): Remove client_data param. | |
8 | + (infrun_async_inferior_event_handler): Adjust. | |
9 | + * infrun.h (fetch_inferior_event): Remove `void *` param. | |
10 | + * linux-nat.c (handle_target_event): Adjust. | |
11 | + * record-btrace.c (record_btrace_handle_async_inferior_event): | |
12 | + Adjust. | |
13 | + * record-full.c (record_full_async_inferior_event_handler): | |
14 | + Adjust. | |
15 | + * remote.c (remote_async_inferior_event_handler): Adjust. | |
16 | + | |
1 | 17 | 2020-07-01 Tom Tromey <tom@tromey.com> |
2 | 18 | |
3 | 19 | * tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual. |
@@ -34,13 +34,12 @@ | ||
34 | 34 | /* General function to handle events in the inferior. */ |
35 | 35 | |
36 | 36 | void |
37 | -inferior_event_handler (enum inferior_event_type event_type, | |
38 | - gdb_client_data client_data) | |
37 | +inferior_event_handler (enum inferior_event_type event_type) | |
39 | 38 | { |
40 | 39 | switch (event_type) |
41 | 40 | { |
42 | 41 | case INF_REG_EVENT: |
43 | - fetch_inferior_event (client_data); | |
42 | + fetch_inferior_event (); | |
44 | 43 | break; |
45 | 44 | |
46 | 45 | case INF_EXEC_COMPLETE: |
@@ -22,7 +22,6 @@ | ||
22 | 22 | |
23 | 23 | #include "target.h" /* For enum inferior_event_type. */ |
24 | 24 | |
25 | -extern void inferior_event_handler (enum inferior_event_type event_type, | |
26 | - void* client_data); | |
25 | +extern void inferior_event_handler (enum inferior_event_type event_type); | |
27 | 26 | |
28 | 27 | #endif /* #ifndef INF_LOOP_H */ |
@@ -907,7 +907,7 @@ step_1 (int skip_subroutines, int single_inst, const char *count_string) | ||
907 | 907 | thr->thread_fsm->clean_up (thr); |
908 | 908 | proceeded = normal_stop (); |
909 | 909 | if (!proceeded) |
910 | - inferior_event_handler (INF_EXEC_COMPLETE, NULL); | |
910 | + inferior_event_handler (INF_EXEC_COMPLETE); | |
911 | 911 | all_uis_check_sync_execution_done (); |
912 | 912 | } |
913 | 913 | } |
@@ -2968,7 +2968,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal) | ||
2968 | 2968 | /* The target for some reason decided not to resume. */ |
2969 | 2969 | normal_stop (); |
2970 | 2970 | if (target_can_async_p ()) |
2971 | - inferior_event_handler (INF_EXEC_COMPLETE, NULL); | |
2971 | + inferior_event_handler (INF_EXEC_COMPLETE); | |
2972 | 2972 | return; |
2973 | 2973 | } |
2974 | 2974 |
@@ -3933,7 +3933,7 @@ all_uis_on_sync_execution_starting (void) | ||
3933 | 3933 | necessary cleanups. */ |
3934 | 3934 | |
3935 | 3935 | void |
3936 | -fetch_inferior_event (void *client_data) | |
3936 | +fetch_inferior_event () | |
3937 | 3937 | { |
3938 | 3938 | struct execution_control_state ecss; |
3939 | 3939 | struct execution_control_state *ecs = &ecss; |
@@ -4050,7 +4050,7 @@ fetch_inferior_event (void *client_data) | ||
4050 | 4050 | |
4051 | 4051 | if (!proceeded) |
4052 | 4052 | { |
4053 | - inferior_event_handler (INF_EXEC_COMPLETE, NULL); | |
4053 | + inferior_event_handler (INF_EXEC_COMPLETE); | |
4054 | 4054 | cmd_done = 1; |
4055 | 4055 | } |
4056 | 4056 |
@@ -9422,7 +9422,7 @@ static const struct internalvar_funcs siginfo_funcs = | ||
9422 | 9422 | static void |
9423 | 9423 | infrun_async_inferior_event_handler (gdb_client_data data) |
9424 | 9424 | { |
9425 | - inferior_event_handler (INF_REG_EVENT, NULL); | |
9425 | + inferior_event_handler (INF_REG_EVENT); | |
9426 | 9426 | } |
9427 | 9427 | |
9428 | 9428 | void _initialize_infrun (); |
@@ -130,7 +130,7 @@ extern void stop_all_threads (void); | ||
130 | 130 | |
131 | 131 | extern void prepare_for_detach (void); |
132 | 132 | |
133 | -extern void fetch_inferior_event (void *); | |
133 | +extern void fetch_inferior_event (); | |
134 | 134 | |
135 | 135 | extern void init_wait_for_inferior (void); |
136 | 136 |
@@ -4232,7 +4232,7 @@ sigchld_handler (int signo) | ||
4232 | 4232 | static void |
4233 | 4233 | handle_target_event (int error, gdb_client_data client_data) |
4234 | 4234 | { |
4235 | - inferior_event_handler (INF_REG_EVENT, NULL); | |
4235 | + inferior_event_handler (INF_REG_EVENT); | |
4236 | 4236 | } |
4237 | 4237 | |
4238 | 4238 | /* Create/destroy the target events pipe. Returns previous state. */ |
@@ -325,7 +325,7 @@ record_btrace_auto_disable (void) | ||
325 | 325 | static void |
326 | 326 | record_btrace_handle_async_inferior_event (gdb_client_data data) |
327 | 327 | { |
328 | - inferior_event_handler (INF_REG_EVENT, NULL); | |
328 | + inferior_event_handler (INF_REG_EVENT); | |
329 | 329 | } |
330 | 330 | |
331 | 331 | /* See record-btrace.h. */ |
@@ -905,7 +905,7 @@ static struct async_event_handler *record_full_async_inferior_event_token; | ||
905 | 905 | static void |
906 | 906 | record_full_async_inferior_event_handler (gdb_client_data data) |
907 | 907 | { |
908 | - inferior_event_handler (INF_REG_EVENT, NULL); | |
908 | + inferior_event_handler (INF_REG_EVENT); | |
909 | 909 | } |
910 | 910 | |
911 | 911 | /* Open the process record target for 'core' files. */ |
@@ -5605,8 +5605,7 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p) | ||
5605 | 5605 | |
5606 | 5606 | /* Register extra event sources in the event loop. */ |
5607 | 5607 | rs->remote_async_inferior_event_token |
5608 | - = create_async_event_handler (remote_async_inferior_event_handler, | |
5609 | - remote); | |
5608 | + = create_async_event_handler (remote_async_inferior_event_handler, NULL); | |
5610 | 5609 | rs->notif_state = remote_notif_state_allocate (remote); |
5611 | 5610 | |
5612 | 5611 | /* Reset the target state; these things will be queried either by |
@@ -14158,13 +14157,13 @@ remote_async_serial_handler (struct serial *scb, void *context) | ||
14158 | 14157 | { |
14159 | 14158 | /* Don't propogate error information up to the client. Instead let |
14160 | 14159 | the client find out about the error by querying the target. */ |
14161 | - inferior_event_handler (INF_REG_EVENT, NULL); | |
14160 | + inferior_event_handler (INF_REG_EVENT); | |
14162 | 14161 | } |
14163 | 14162 | |
14164 | 14163 | static void |
14165 | 14164 | remote_async_inferior_event_handler (gdb_client_data data) |
14166 | 14165 | { |
14167 | - inferior_event_handler (INF_REG_EVENT, data); | |
14166 | + inferior_event_handler (INF_REG_EVENT); | |
14168 | 14167 | } |
14169 | 14168 | |
14170 | 14169 | int |