• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révisionb1a35af2704842ff1a90626b0148c0fc93f995f6 (tree)
l'heure2020-07-02 21:40:44
AuteurSimon Marchi <simon.marchi@poly...>
CommiterSimon Marchi

Message de Log

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

Change Summary

Modification

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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+
117 2020-07-01 Tom Tromey <tom@tromey.com>
218
319 * tui/tui-data.h (struct tui_win_info) <name>: Now pure virtual.
--- a/gdb/inf-loop.c
+++ b/gdb/inf-loop.c
@@ -34,13 +34,12 @@
3434 /* General function to handle events in the inferior. */
3535
3636 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)
3938 {
4039 switch (event_type)
4140 {
4241 case INF_REG_EVENT:
43- fetch_inferior_event (client_data);
42+ fetch_inferior_event ();
4443 break;
4544
4645 case INF_EXEC_COMPLETE:
--- a/gdb/inf-loop.h
+++ b/gdb/inf-loop.h
@@ -22,7 +22,6 @@
2222
2323 #include "target.h" /* For enum inferior_event_type. */
2424
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);
2726
2827 #endif /* #ifndef INF_LOOP_H */
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -907,7 +907,7 @@ step_1 (int skip_subroutines, int single_inst, const char *count_string)
907907 thr->thread_fsm->clean_up (thr);
908908 proceeded = normal_stop ();
909909 if (!proceeded)
910- inferior_event_handler (INF_EXEC_COMPLETE, NULL);
910+ inferior_event_handler (INF_EXEC_COMPLETE);
911911 all_uis_check_sync_execution_done ();
912912 }
913913 }
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2968,7 +2968,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
29682968 /* The target for some reason decided not to resume. */
29692969 normal_stop ();
29702970 if (target_can_async_p ())
2971- inferior_event_handler (INF_EXEC_COMPLETE, NULL);
2971+ inferior_event_handler (INF_EXEC_COMPLETE);
29722972 return;
29732973 }
29742974
@@ -3933,7 +3933,7 @@ all_uis_on_sync_execution_starting (void)
39333933 necessary cleanups. */
39343934
39353935 void
3936-fetch_inferior_event (void *client_data)
3936+fetch_inferior_event ()
39373937 {
39383938 struct execution_control_state ecss;
39393939 struct execution_control_state *ecs = &ecss;
@@ -4050,7 +4050,7 @@ fetch_inferior_event (void *client_data)
40504050
40514051 if (!proceeded)
40524052 {
4053- inferior_event_handler (INF_EXEC_COMPLETE, NULL);
4053+ inferior_event_handler (INF_EXEC_COMPLETE);
40544054 cmd_done = 1;
40554055 }
40564056
@@ -9422,7 +9422,7 @@ static const struct internalvar_funcs siginfo_funcs =
94229422 static void
94239423 infrun_async_inferior_event_handler (gdb_client_data data)
94249424 {
9425- inferior_event_handler (INF_REG_EVENT, NULL);
9425+ inferior_event_handler (INF_REG_EVENT);
94269426 }
94279427
94289428 void _initialize_infrun ();
--- a/gdb/infrun.h
+++ b/gdb/infrun.h
@@ -130,7 +130,7 @@ extern void stop_all_threads (void);
130130
131131 extern void prepare_for_detach (void);
132132
133-extern void fetch_inferior_event (void *);
133+extern void fetch_inferior_event ();
134134
135135 extern void init_wait_for_inferior (void);
136136
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4232,7 +4232,7 @@ sigchld_handler (int signo)
42324232 static void
42334233 handle_target_event (int error, gdb_client_data client_data)
42344234 {
4235- inferior_event_handler (INF_REG_EVENT, NULL);
4235+ inferior_event_handler (INF_REG_EVENT);
42364236 }
42374237
42384238 /* Create/destroy the target events pipe. Returns previous state. */
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -325,7 +325,7 @@ record_btrace_auto_disable (void)
325325 static void
326326 record_btrace_handle_async_inferior_event (gdb_client_data data)
327327 {
328- inferior_event_handler (INF_REG_EVENT, NULL);
328+ inferior_event_handler (INF_REG_EVENT);
329329 }
330330
331331 /* See record-btrace.h. */
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -905,7 +905,7 @@ static struct async_event_handler *record_full_async_inferior_event_token;
905905 static void
906906 record_full_async_inferior_event_handler (gdb_client_data data)
907907 {
908- inferior_event_handler (INF_REG_EVENT, NULL);
908+ inferior_event_handler (INF_REG_EVENT);
909909 }
910910
911911 /* Open the process record target for 'core' files. */
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5605,8 +5605,7 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
56055605
56065606 /* Register extra event sources in the event loop. */
56075607 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);
56105609 rs->notif_state = remote_notif_state_allocate (remote);
56115610
56125611 /* Reset the target state; these things will be queried either by
@@ -14158,13 +14157,13 @@ remote_async_serial_handler (struct serial *scb, void *context)
1415814157 {
1415914158 /* Don't propogate error information up to the client. Instead let
1416014159 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);
1416214161 }
1416314162
1416414163 static void
1416514164 remote_async_inferior_event_handler (gdb_client_data data)
1416614165 {
14167- inferior_event_handler (INF_REG_EVENT, data);
14166+ inferior_event_handler (INF_REG_EVENT);
1416814167 }
1416914168
1417014169 int