* [PATCH] gdbserver/server: make some functions void
@ 2021-05-06 9:34 Tankut Baris Aktemur
2021-05-06 13:04 ` Simon Marchi
0 siblings, 1 reply; 2+ messages in thread
From: Tankut Baris Aktemur @ 2021-05-06 9:34 UTC (permalink / raw)
To: gdb-patches
The 'handle_v_attach', 'handle_v_run', and 'handle_v_kill' functions'
return values are unused. They indicate error/success result by
putting packets. Make the functions void.
Tested by rebuilding.
gdbserver/ChangeLog:
2021-05-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* server.cc (handle_v_attach)
(handle_v_run)
(handle_v_kill): Make void.
---
gdbserver/server.cc | 34 ++++++++++------------------------
1 file changed, 10 insertions(+), 24 deletions(-)
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index a5d9f85216d..32dcc05924e 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -2973,8 +2973,8 @@ resume (struct thread_resume *actions, size_t num_actions)
}
}
-/* Attach to a new program. Return 1 if successful, 0 if failure. */
-static int
+/* Attach to a new program. */
+static void
handle_v_attach (char *own_buf)
{
client_state &cs = get_client_state ();
@@ -2998,18 +2998,13 @@ handle_v_attach (char *own_buf)
}
else
prepare_resume_reply (own_buf, cs.last_ptid, &cs.last_status);
-
- return 1;
}
else
- {
- write_enn (own_buf);
- return 0;
- }
+ write_enn (own_buf);
}
-/* Run a new program. Return 1 if successful, 0 if failure. */
-static int
+/* Run a new program. */
+static void
handle_v_run (char *own_buf)
{
client_state &cs = get_client_state ();
@@ -3106,7 +3101,7 @@ handle_v_run (char *own_buf)
{
write_enn (own_buf);
free_vector_argv (new_argv);
- return 0;
+ return;
}
}
else
@@ -3127,18 +3122,13 @@ handle_v_run (char *own_buf)
query which is the main thread of the new inferior. */
if (non_stop)
cs.general_thread = cs.last_ptid;
-
- return 1;
}
else
- {
- write_enn (own_buf);
- return 0;
- }
+ write_enn (own_buf);
}
-/* Kill process. Return 1 if successful, 0 if failure. */
-static int
+/* Kill process. */
+static void
handle_v_kill (char *own_buf)
{
client_state &cs = get_client_state ();
@@ -3158,13 +3148,9 @@ handle_v_kill (char *own_buf)
cs.last_ptid = ptid_t (pid);
discard_queued_stop_replies (cs.last_ptid);
write_ok (own_buf);
- return 1;
}
else
- {
- write_enn (own_buf);
- return 0;
- }
+ write_enn (own_buf);
}
/* Handle all of the extended 'v' packets. */
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] gdbserver/server: make some functions void
2021-05-06 9:34 [PATCH] gdbserver/server: make some functions void Tankut Baris Aktemur
@ 2021-05-06 13:04 ` Simon Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2021-05-06 13:04 UTC (permalink / raw)
To: Tankut Baris Aktemur, gdb-patches
On 2021-05-06 5:34 a.m., Tankut Baris Aktemur via Gdb-patches wrote:
> The 'handle_v_attach', 'handle_v_run', and 'handle_v_kill' functions'
> return values are unused. They indicate error/success result by
> putting packets. Make the functions void.
This is ok, thanks.
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-06 13:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 9:34 [PATCH] gdbserver/server: make some functions void Tankut Baris Aktemur
2021-05-06 13:04 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).