From patchwork Sun Nov 27 17:00:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 61129 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4147C3858289 for ; Sun, 27 Nov 2022 17:00:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4147C3858289 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669568441; bh=6yNRCm+1G4WF+2NX6qjSZqx0rg/Y0dCSwNtKts6f1Qs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=OKIWwd2ZeZFwxxbnolsuwDJH43ed//wlSgwrDtRlU5nL+cXGIIsXEaiGq8tRpt+JD HJyffiKSxVOt8KYIMSJPSjBVZ2G7LcKlp/K5iCKGtbcyf/96TnpxKP4pSWgx9Lnz9U 95jjC+STY6RGNuA791xoNo30kKBH8flW/sMksNMg= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mailsec112.isp.belgacom.be (mailsec112.isp.belgacom.be [195.238.20.108]) by sourceware.org (Postfix) with ESMTPS id 4BFC43858C83 for ; Sun, 27 Nov 2022 17:00:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4BFC43858C83 X-ExtLoop: 1 X-IPAS-Result: A2DYBAChloNj/1uGgG1agRKcOIEWnDWBag8BAQEBAQEBAQEJRAQBAYUFhQomOBMBAgQBAQEBAwIDAQEBAQEBAwEBBgEBAQEBAQYEAYEchS9GgjUig38rCwFGhE6DI68GM4EBhHCaZoFngUCLVIV5gVVEgRWBPIE3hSCGVwSMOoRWKYdbAwkDBwVJQAMLGA0WMgoTMhtYDgkfHCUNBQ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B+32f MkIbzdzKh7NC/FKEg5LUcJvzbbx3BETdRVciw+IooUv+VKC7zJbi+ndb9bxK4CFEJA9ckGw4 ziuE37CKh4WPpmHwCaO8n+3rvTIgDnwVZ0bDrD+8eRl6HWLxm0XCQUOWB2kqOO+k1O/VshEA 1cX6ywjse44+SSWosLVDkT++SXY+0dGC58JS7x84Q2Wzu/Y8gDfB3McCDRMbNMvv8gzAzYnv rOUo+7U6fVUmOX9YRqgGn2891te5QB9waQ+iePogOfLDxQPYG3+s/4XcuteLQ== IronPort-HdrOrdr: A9a23:fUTTZq24WC3nszvDtSuF4QqjBGIkLtp133Aq2lEZdPU1SL3lqy nKpp8mPHDP6Qr5J0tQ/+xoVJPtfZqez+8N3WBpB8bZYOC+ghrUEGgA1/qc/9SDIU3DH4dmvM 8LT0EZMrLN5DNB4PoSjjPXLz5cqOP3iJxAUd2urUuEMWlRGsZdBn9Ce2Wm+r0cfng8OXPPLu v52iPvnUvERUgq X-IronPort-Anti-Spam-Filtered: true X-ProximusIPWarmup: true Received: from 91.134-128-109.adsl-dyn.isp.belgacom.be (HELO md.home) ([109.128.134.91]) by relay.proximus.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2022 18:00:14 +0100 To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFA] Use false/true for some inferior class members instead of 0/1 Date: Sun, 27 Nov 2022 18:00:06 +0100 Message-Id: <20221127170006.860389-1-philippe.waroquiers@skynet.be> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Philippe Waroquiers via Gdb-patches From: Philippe Waroquiers Reply-To: Philippe Waroquiers Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Some class members were changed to bool, but there was still some assignments or comparisons using 0/1. --- gdb/auxv.c | 2 +- gdb/darwin-nat.c | 2 +- gdb/gnu-nat.c | 2 +- gdb/inf-ptrace.c | 2 +- gdb/infcmd.c | 4 ++-- gdb/inferior.c | 4 ++-- gdb/infrun.c | 18 +++++++++--------- gdb/nto-procfs.c | 4 ++-- gdb/procfs.c | 2 +- gdb/remote.c | 2 +- gdb/target.c | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gdb/auxv.c b/gdb/auxv.c index 51723f9b17c..0ac74826aeb 100644 --- a/gdb/auxv.c +++ b/gdb/auxv.c @@ -234,7 +234,7 @@ memory_xfer_auxv (struct target_ops *ops, this function only when attaching to a process. */ - if (current_inferior ()->attach_flag != 0) + if (current_inferior ()->attach_flag) { enum target_xfer_status ret; diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index eca97c9bde9..66b3a152374 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -2037,7 +2037,7 @@ darwin_nat_target::attach (const char *args, int from_tty) inf = current_inferior (); inferior_appeared (inf, pid); - inf->attach_flag = 1; + inf->attach_flag = true; darwin_attach_pid (inf); diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index ae049cab3de..abbf4523de6 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2183,7 +2183,7 @@ gnu_nat_target::attach (const char *args, int from_tty) inferior->push_target (this); inferior_appeared (inferior, pid); - inferior->attach_flag = 1; + inferior->attach_flag = true; inf_update_procs (inf); diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index 8995ef517dd..ab669a7acc2 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -163,7 +163,7 @@ inf_ptrace_target::attach (const char *args, int from_tty) #endif inferior_appeared (inf, pid); - inf->attach_flag = 1; + inf->attach_flag = true; /* Always add a main thread. If some target extends the ptrace target, it should decorate the ptid later with more info. */ diff --git a/gdb/infcmd.c b/gdb/infcmd.c index f7bce0d0399..a27d3577b3a 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2494,7 +2494,7 @@ setup_inferior (int from_tty) struct inferior *inferior; inferior = current_inferior (); - inferior->needs_setup = 0; + inferior->needs_setup = false; /* If no exec file is yet known, try to determine it from the process itself. */ @@ -2677,7 +2677,7 @@ attach_command (const char *args, int from_tty) wait_for_inferior as soon as the target reports a stop. */ init_wait_for_inferior (); - inferior->needs_setup = 1; + inferior->needs_setup = true; if (target_is_non_stop_p ()) { diff --git a/gdb/inferior.c b/gdb/inferior.c index 7eb2bd97907..23cbfd63bde 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -223,7 +223,7 @@ exit_inferior_1 (struct inferior *inf, int silent) inf->vfork_child = NULL; } - inf->pending_detach = 0; + inf->pending_detach = false; /* Reset it. */ inf->control = inferior_control_state (NO_STOP_QUIETLY); @@ -270,7 +270,7 @@ inferior_appeared (struct inferior *inf, int pid) init_thread_list (); inf->pid = pid; - inf->has_exit_code = 0; + inf->has_exit_code = false; inf->exit_code = 0; gdb::observers::inferior_appeared.notify (inf); diff --git a/gdb/infrun.c b/gdb/infrun.c index 96346e1f25b..3613a4af79b 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -495,15 +495,15 @@ holding the child stopped. Try \"set detach-on-fork\" or \ with the shared region. Keep track of the parent. */ child_inf->vfork_parent = parent_inf; - child_inf->pending_detach = 0; + child_inf->pending_detach = false; parent_inf->vfork_child = child_inf; - parent_inf->pending_detach = 0; + parent_inf->pending_detach = false; } else { child_inf->aspace = new address_space (); child_inf->pspace = new program_space (child_inf->aspace); - child_inf->removable = 1; + child_inf->removable = true; clone_program_space (child_inf->pspace, parent_inf->pspace); } } @@ -585,7 +585,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ { child_inf->aspace = new address_space (); child_inf->pspace = new program_space (child_inf->aspace); - child_inf->removable = 1; + child_inf->removable = true; child_inf->symfile_flags = SYMFILE_NO_READ; clone_program_space (child_inf->pspace, parent_inf->pspace); } @@ -647,7 +647,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ gdb_assert (child_inf->vfork_parent == nullptr); gdb_assert (parent_inf->vfork_child == nullptr); child_inf->vfork_parent = parent_inf; - child_inf->pending_detach = 0; + child_inf->pending_detach = false; parent_inf->vfork_child = child_inf; parent_inf->pending_detach = detach_fork; } @@ -942,7 +942,7 @@ handle_vfork_child_exec_or_exit (int exec) /* follow-fork child, detach-on-fork on. */ - vfork_parent->pending_detach = 0; + vfork_parent->pending_detach = false; scoped_restore_current_pspace_and_thread restore_thread; @@ -998,7 +998,7 @@ handle_vfork_child_exec_or_exit (int exec) child a new address space. */ inf->pspace = new program_space (maybe_new_address_space ()); inf->aspace = inf->pspace->aspace; - inf->removable = 1; + inf->removable = true; set_current_program_space (inf->pspace); resume_parent = vfork_parent; @@ -1023,7 +1023,7 @@ handle_vfork_child_exec_or_exit (int exec) inf->pspace = new program_space (maybe_new_address_space ()); inf->aspace = inf->pspace->aspace; set_current_program_space (inf->pspace); - inf->removable = 1; + inf->removable = true; inf->symfile_flags = SYMFILE_NO_READ; clone_program_space (inf->pspace, vfork_parent->pspace); @@ -5563,7 +5563,7 @@ handle_inferior_event (struct execution_control_state *ecs) (LONGEST) ecs->ws.exit_status ()); /* Also record this in the inferior itself. */ - current_inferior ()->has_exit_code = 1; + current_inferior ()->has_exit_code = true; current_inferior ()->exit_code = (LONGEST) ecs->ws.exit_status (); /* Support the --return-child-result option. */ diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index ef9e0f05261..4a2968ea179 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -706,7 +706,7 @@ nto_procfs_target::attach (const char *args, int from_tty) ptid_t ptid = do_attach (ptid_t (pid)); inf = current_inferior (); inferior_appeared (inf, pid); - inf->attach_flag = 1; + inf->attach_flag = true; if (!inf->target_is_pushed (ops)) inf->push_target (ops); @@ -1286,7 +1286,7 @@ nto_procfs_target::create_inferior (const char *exec_file, inf = current_inferior (); inferior_appeared (inf, pid); - inf->attach_flag = 0; + inf->attach_flag = false; flags = _DEBUG_FLAG_KLC; /* Kill-on-Last-Close flag. */ errn = devctl (ctl_fd, DCMD_PROC_SET_FLAG, &flags, sizeof (flags), 0); diff --git a/gdb/procfs.c b/gdb/procfs.c index 141db3dd793..ac3d60ebf1c 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -1849,7 +1849,7 @@ do_attach (ptid_t ptid) inf = current_inferior (); inferior_appeared (inf, pi->pid); /* Let GDB know that the inferior was attached. */ - inf->attach_flag = 1; + inf->attach_flag = true; /* Create a procinfo for the current lwp. */ lwpid = proc_get_current_thread (pi); diff --git a/gdb/remote.c b/gdb/remote.c index 5118ecd0a31..53c4f19c5a4 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4625,7 +4625,7 @@ remote_target::process_initial_stop_replies (int from_tty) registers/memory. */ for (inferior *inf : all_non_exited_inferiors (this)) { - inf->needs_setup = 1; + inf->needs_setup = true; if (non_stop) { diff --git a/gdb/target.c b/gdb/target.c index 74925e139dc..b88df0f678b 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2489,7 +2489,7 @@ target_pre_inferior (int from_tty) /* attach_flag may be set if the previous process associated with the inferior was attached to. */ - current_inferior ()->attach_flag = 0; + current_inferior ()->attach_flag = false; current_inferior ()->highest_thread_num = 0;