From: Andrew Burgess Date: Tue, 11 May 2021 12:40:24 +0000 (+0100) Subject: gdb: some int to bool conversion in remote.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f63ec5ccc5dca36398e570a500ad553729b19a3;p=binutils-gdb.git gdb: some int to bool conversion in remote.c 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7059ba2a51c..4bed8c2b604 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2021-05-14 Andrew Burgess + + * 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. + 2021-05-14 Kent Cheung * cp-valprint.c (cp_print_value): Replaced duplicate code. diff --git a/gdb/remote.c b/gdb/remote.c index 4dcc5515cea..aa98f5f951e 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -780,7 +780,7 @@ public: /* Remote specific methods. */ 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 = ¬if_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);