From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1751) id EAAC93858D3C; Sun, 27 Nov 2022 20:07:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAAC93858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669579627; bh=jFS6dnZ7doXFEuqg2+d5JhpsGQosV69D14R8O9Z6y3s=; h=From:To:Subject:Date:From; b=kCDsiJcRoky/izihxFg9pK77dFnKhD/6KXHnqf493oC6zdrUww05Hv+Xjc9l5cKeY PL9cpLqvUZVinn3AimQeI+9txElJ5msyvGD8xSBpqMI0yUNaAZEpssN9ptHX/ab7WA LtPmkYwHFhz1uouP7LRCzKLBugGz9Xj9IsH++bvk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Philippe Waroquiers To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Use false/true for some inferior class members instead of 0/1 X-Act-Checkin: binutils-gdb X-Git-Author: Philippe Waroquiers X-Git-Refname: refs/heads/master X-Git-Oldrev: 4c35c4c6a779c79e456b7a5311f74aafc9026bd5 X-Git-Newrev: 30220b46d4cc34f4882525eb92b40725637cbba7 Message-Id: <20221127200707.EAAC93858D3C@sourceware.org> Date: Sun, 27 Nov 2022 20:07:07 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D30220b46d4cc= 34f4882525eb92b40725637cbba7 commit 30220b46d4cc34f4882525eb92b40725637cbba7 Author: Philippe Waroquiers Date: Sun Nov 27 17:57:08 2022 +0100 Use false/true for some inferior class members instead of 0/1 =20 Some class members were changed to bool, but there was still some assignments or comparisons using 0/1. =20 Approved-By: Simon Marchi Diff: --- 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. */ =20 - if (current_inferior ()->attach_flag !=3D 0) + if (current_inferior ()->attach_flag) { enum target_xfer_status ret; =20 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) =20 inf =3D current_inferior (); inferior_appeared (inf, pid); - inf->attach_flag =3D 1; + inf->attach_flag =3D true; =20 darwin_attach_pid (inf); =20 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_tt= y) inferior->push_target (this); =20 inferior_appeared (inferior, pid); - inferior->attach_flag =3D 1; + inferior->attach_flag =3D true; =20 inf_update_procs (inf); =20 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_t= ty) #endif =20 inferior_appeared (inf, pid); - inf->attach_flag =3D 1; + inf->attach_flag =3D true; =20 /* 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; =20 inferior =3D current_inferior (); - inferior->needs_setup =3D 0; + inferior->needs_setup =3D false; =20 /* 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 (); =20 - inferior->needs_setup =3D 1; + inferior->needs_setup =3D true; =20 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 =3D NULL; } =20 - inf->pending_detach =3D 0; + inf->pending_detach =3D false; /* Reset it. */ inf->control =3D inferior_control_state (NO_STOP_QUIETLY); =20 @@ -270,7 +270,7 @@ inferior_appeared (struct inferior *inf, int pid) init_thread_list (); =20 inf->pid =3D pid; - inf->has_exit_code =3D 0; + inf->has_exit_code =3D false; inf->exit_code =3D 0; =20 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 =3D parent_inf; - child_inf->pending_detach =3D 0; + child_inf->pending_detach =3D false; parent_inf->vfork_child =3D child_inf; - parent_inf->pending_detach =3D 0; + parent_inf->pending_detach =3D false; } else { child_inf->aspace =3D new address_space (); child_inf->pspace =3D new program_space (child_inf->aspace); - child_inf->removable =3D 1; + child_inf->removable =3D 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 =3D new address_space (); child_inf->pspace =3D new program_space (child_inf->aspace); - child_inf->removable =3D 1; + child_inf->removable =3D true; child_inf->symfile_flags =3D 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 =3D=3D nullptr); gdb_assert (parent_inf->vfork_child =3D=3D nullptr); child_inf->vfork_parent =3D parent_inf; - child_inf->pending_detach =3D 0; + child_inf->pending_detach =3D false; parent_inf->vfork_child =3D child_inf; parent_inf->pending_detach =3D detach_fork; } @@ -942,7 +942,7 @@ handle_vfork_child_exec_or_exit (int exec) =20 /* follow-fork child, detach-on-fork on. */ =20 - vfork_parent->pending_detach =3D 0; + vfork_parent->pending_detach =3D false; =20 scoped_restore_current_pspace_and_thread restore_thread; =20 @@ -998,7 +998,7 @@ handle_vfork_child_exec_or_exit (int exec) child a new address space. */ inf->pspace =3D new program_space (maybe_new_address_space ()); inf->aspace =3D inf->pspace->aspace; - inf->removable =3D 1; + inf->removable =3D true; set_current_program_space (inf->pspace); =20 resume_parent =3D vfork_parent; @@ -1023,7 +1023,7 @@ handle_vfork_child_exec_or_exit (int exec) inf->pspace =3D new program_space (maybe_new_address_space ()); inf->aspace =3D inf->pspace->aspace; set_current_program_space (inf->pspace); - inf->removable =3D 1; + inf->removable =3D true; inf->symfile_flags =3D SYMFILE_NO_READ; clone_program_space (inf->pspace, vfork_parent->pspace); =20 @@ -5563,7 +5563,7 @@ handle_inferior_event (struct execution_control_state= *ecs) (LONGEST) ecs->ws.exit_status ()); =20 /* Also record this in the inferior itself. */ - current_inferior ()->has_exit_code =3D 1; + current_inferior ()->has_exit_code =3D true; current_inferior ()->exit_code =3D (LONGEST) ecs->ws.exit_status (); =20 /* 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_t= ty) ptid_t ptid =3D do_attach (ptid_t (pid)); inf =3D current_inferior (); inferior_appeared (inf, pid); - inf->attach_flag =3D 1; + inf->attach_flag =3D true; =20 if (!inf->target_is_pushed (ops)) inf->push_target (ops); @@ -1286,7 +1286,7 @@ nto_procfs_target::create_inferior (const char *exec_= file, =20 inf =3D current_inferior (); inferior_appeared (inf, pid); - inf->attach_flag =3D 0; + inf->attach_flag =3D false; =20 flags =3D _DEBUG_FLAG_KLC; /* Kill-on-Last-Close flag. */ errn =3D 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 =3D current_inferior (); inferior_appeared (inf, pi->pid); /* Let GDB know that the inferior was attached. */ - inf->attach_flag =3D 1; + inf->attach_flag =3D true; =20 /* Create a procinfo for the current lwp. */ lwpid =3D 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 =3D 1; + inf->needs_setup =3D true; =20 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) =20 /* attach_flag may be set if the previous process associated with the inferior was attached to. */ - current_inferior ()->attach_flag =3D 0; + current_inferior ()->attach_flag =3D false; =20 current_inferior ()->highest_thread_num =3D 0;