Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 5/5] Add some uses of bool to progspace and exec_file_attach
Date: Tue, 10 Nov 2026 19:06:59 -0700	[thread overview]
Message-ID: <20261110-minor-assert-v1-5-bb33660ca557@tromey.com> (raw)
In-Reply-To: <20261110-minor-assert-v1-0-bb33660ca557@tromey.com>

This changes the program_space fields 'executing_startup' and
'breakpoints_not_allowed' to be bool; and changes exec_file_attach to
use bool.  These are just some minor cleanups I noticed while working
on this series.
---
 gdb/breakpoint.c | 4 ++--
 gdb/exec.c       | 4 ++--
 gdb/infrun.c     | 2 +-
 gdb/progspace.h  | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index a23f5998b20..7a1be7f01f8 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -8693,14 +8693,14 @@ enable_watchpoints_after_interactive_call_stop (void)
 void
 disable_breakpoints_before_startup (void)
 {
-  current_program_space->executing_startup = 1;
+  current_program_space->executing_startup = true;
   update_global_location_list (UGLL_DONT_INSERT);
 }
 
 void
 enable_breakpoints_after_startup (void)
 {
-  current_program_space->executing_startup = 0;
+  current_program_space->executing_startup = false;
   breakpoint_re_set ();
 }
 
diff --git a/gdb/exec.c b/gdb/exec.c
index 000b1170145..9e5495ed953 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -400,7 +400,7 @@ exec_file_attach (const char *filename, int from_tty)
     }
   else
     {
-      int load_via_target = 0;
+      bool load_via_target = false;
       const char *scratch_pathname, *canonical_pathname;
       int scratch_chan;
       char **matching;
@@ -410,7 +410,7 @@ exec_file_attach (const char *filename, int from_tty)
 	  if (target_filesystem_is_local ())
 	    filename += strlen (TARGET_SYSROOT_PREFIX);
 	  else
-	    load_via_target = 1;
+	    load_via_target = true;
 	}
 
       gdb::unique_xmalloc_ptr<char> canonical_storage, scratch_storage;
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 08fac30e9e8..a2ea1e39e58 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1235,7 +1235,7 @@ handle_vfork_done (thread_info *event_thread)
   gdb_assert (event_thread->inf->thread_waiting_for_vfork_done == event_thread);
 
   event_thread->inf->thread_waiting_for_vfork_done = nullptr;
-  event_thread->inf->pspace->breakpoints_not_allowed = 0;
+  event_thread->inf->pspace->breakpoints_not_allowed = false;
 
   /* On non-stop targets, we stopped all the inferior's threads in follow_fork,
      resume them now.  On all-stop targets, everything that needs to be resumed
diff --git a/gdb/progspace.h b/gdb/progspace.h
index a5e5f0ea3f5..9b97b932eac 100644
--- a/gdb/progspace.h
+++ b/gdb/progspace.h
@@ -392,11 +392,11 @@ struct program_space
      targets, or for PIE executables, until we connect and ask the
      target for the final relocation offsets, the symbols we've used
      to set breakpoints point at the wrong addresses.  */
-  int executing_startup = 0;
+  bool executing_startup = false;
 
   /* True if no breakpoints should be inserted in this program
      space.  */
-  int breakpoints_not_allowed = 0;
+  bool breakpoints_not_allowed = false;
 
   /* The object file that the main symbol table was loaded from
      (e.g. the argument to the "symbol-file" or "file" command).  */

-- 
2.49.0


      parent reply	other threads:[~2026-11-11  2:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  2:06 [PATCH 0/5] Minor updates to program space and setting the exec file Tom Tromey
2026-11-11  2:06 ` [PATCH 1/5] Reject null pointers in program_space::set_exec_bfd Tom Tromey
2026-11-11  2:06 ` [PATCH 2/5] Hoist call to gdb_bfd_check_format_matches in exec.c Tom Tromey
2026-11-11  2:06 ` [PATCH 3/5] Have program_space::set_exec_bfd do more work Tom Tromey
2026-11-11  2:06 ` [PATCH 4/5] Mark two program_space fields as private Tom Tromey
2026-11-11  2:06 ` Tom Tromey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261110-minor-assert-v1-5-bb33660ca557@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox