public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gdb: some int to bool conversion in remote.c
@ 2021-05-11 14:39 Andrew Burgess
  2021-05-11 14:39 ` [PATCH 2/2] gdb: avoid sending unnecessary wildcard vCont actions Andrew Burgess
  2021-05-13 17:24 ` [PATCH 1/2] gdb: some int to bool conversion in remote.c Tom Tromey
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Burgess @ 2021-05-11 14:39 UTC (permalink / raw)
  To: gdb-patches

Convert a couple of local variables from int to bool.  There should be
no user visible changes after this commit.

gdb/ChangeLog:

	* remote.c (check_pending_events_prevent_wildcard_vcont): Change
	argument type, update and re-wrap, header comment.
	(remote_target::commit_resumed): Convert any_process_wildcard and
	may_global_wildcard_vcont from int to bool.
---
 gdb/ChangeLog |  7 +++++++
 gdb/remote.c  | 31 ++++++++++++++-----------------
 2 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index d3a66599122..389835caa09 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -780,7 +780,7 @@ class remote_target : public process_stratum_target
   int stop_reply_queue_length ();
 
   void check_pending_events_prevent_wildcard_vcont
-    (int *may_global_wildcard_vcont);
+    (bool *may_global_wildcard_vcont);
 
   void discard_pending_stop_replies_in_queue ();
   struct stop_reply *remote_notif_remove_queued_reply (ptid_t ptid);
@@ -6634,9 +6634,6 @@ vcont_builder::push_action (ptid_t ptid, bool step, gdb_signal siggnal)
 void
 remote_target::commit_resumed ()
 {
-  int any_process_wildcard;
-  int may_global_wildcard_vcont;
-
   /* If connected in all-stop mode, we'd send the remote resume
      request directly from remote_resume.  Likewise if
      reverse-debugging, as there are no defined vCont actions for
@@ -6693,7 +6690,7 @@ remote_target::commit_resumed ()
      (vCont;c).  We can still send process-wide wildcards though.  */
 
   /* Start by assuming a global wildcard (vCont;c) is possible.  */
-  may_global_wildcard_vcont = 1;
+  bool may_global_wildcard_vcont = true;
 
   /* And assume every process is individually wildcard-able too.  */
   for (inferior *inf : all_non_exited_inferiors (this))
@@ -6721,7 +6718,7 @@ remote_target::commit_resumed ()
 
 	  /* And if we can't wildcard a process, we can't wildcard
 	     everything either.  */
-	  may_global_wildcard_vcont = 0;
+	  may_global_wildcard_vcont = false;
 	  continue;
 	}
 
@@ -6732,7 +6729,7 @@ remote_target::commit_resumed ()
 	 can't do a global wildcard, as that would resume the fork
 	 child.  */
       if (is_pending_fork_parent_thread (tp))
-	may_global_wildcard_vcont = 0;
+	may_global_wildcard_vcont = false;
     }
 
   /* We didn't have any resumed thread pending a vCont resume, so nothing to
@@ -6782,13 +6779,13 @@ remote_target::commit_resumed ()
   /* Now check whether we can send any process-wide wildcard.  This is
      to avoid sending a global wildcard in the case nothing is
      supposed to be resumed.  */
-  any_process_wildcard = 0;
+  bool any_process_wildcard = false;
 
   for (inferior *inf : all_non_exited_inferiors (this))
     {
       if (get_remote_inferior (inf)->may_wildcard_vcont)
 	{
-	  any_process_wildcard = 1;
+	  any_process_wildcard = true;
 	  break;
 	}
     }
@@ -7271,15 +7268,15 @@ remote_target::remove_new_fork_children (threads_listing_context *context)
       context->remove_thread (event->ws.value.related_pid);
 }
 
-/* Check whether any event pending in the vStopped queue would prevent
-   a global or process wildcard vCont action.  Clear
-   *may_global_wildcard if we can't do a global wildcard (vCont;c),
-   and clear the event inferior's may_wildcard_vcont flag if we can't
-   do a process-wide wildcard resume (vCont;c:pPID.-1).  */
+/* Check whether any event pending in the vStopped queue would prevent a
+   global or process wildcard vCont action.  Set *may_global_wildcard to
+   false if we can't do a global wildcard (vCont;c), and clear the event
+   inferior's may_wildcard_vcont flag if we can't do a process-wide
+   wildcard resume (vCont;c:pPID.-1).  */
 
 void
 remote_target::check_pending_events_prevent_wildcard_vcont
-  (int *may_global_wildcard)
+  (bool *may_global_wildcard)
 {
   struct notif_client *notif = &notif_client_stop;
 
@@ -7292,12 +7289,12 @@ remote_target::check_pending_events_prevent_wildcard_vcont
 
       if (event->ws.kind == TARGET_WAITKIND_FORKED
 	  || event->ws.kind == TARGET_WAITKIND_VFORKED)
-	*may_global_wildcard = 0;
+	*may_global_wildcard = false;
 
       /* This may be the first time we heard about this process.
 	 Regardless, we must not do a global wildcard resume, otherwise
 	 we'd resume this process too.  */
-      *may_global_wildcard = 0;
+      *may_global_wildcard = false;
       if (event->ptid != null_ptid)
 	{
 	  inferior *inf = find_inferior_ptid (this, event->ptid);
-- 
2.25.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-14 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 14:39 [PATCH 1/2] gdb: some int to bool conversion in remote.c Andrew Burgess
2021-05-11 14:39 ` [PATCH 2/2] gdb: avoid sending unnecessary wildcard vCont actions Andrew Burgess
2021-05-13 17:55   ` Simon Marchi
2021-05-14 12:49     ` Andrew Burgess
2021-05-14 12:52       ` Simon Marchi
2021-05-13 17:24 ` [PATCH 1/2] gdb: some int to bool conversion in remote.c Tom Tromey

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).