[binutils-gdb] gdb: change gdbarch_has_global_{solist, breakpoints} to bool

Simon Marchi via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4cdad01ef4b07fc396ce169361d1b31415452890

commit 4cdad01ef4b07fc396ce169361d1b31415452890
Author: Simon Marchi <[email protected]>
Date:   Fri Feb 27 15:05:22 2026 -0500

    gdb: change gdbarch_has_global_{solist,breakpoints} to bool
    
    Change-Id: I136cfd2fd42e8a3e3fbfc2e34a4b99e9f8fd438a
    Approved-By: Tom Tromey <[email protected]>

Diff:
---
 gdb/dicos-tdep.c          |  4 ++--
 gdb/gdbarch-gen.c         | 12 ++++++------
 gdb/gdbarch-gen.h         |  8 ++++----
 gdb/gdbarch_components.py |  8 ++++----
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/gdb/dicos-tdep.c b/gdb/dicos-tdep.c
index e1d44f0e58a..f6a071184d6 100644
--- a/gdb/dicos-tdep.c
+++ b/gdb/dicos-tdep.c
@@ -32,11 +32,11 @@ dicos_init_abi (struct gdbarch *gdbarch)
   /* Every process, although has its own address space, sees the same
      list of shared libraries.  There's no "main executable" in DICOS,
      so this accounts for all code.  */
-  set_gdbarch_has_global_solist (gdbarch, 1);
+  set_gdbarch_has_global_solist (gdbarch, true);
 
   /* The DICOS breakpoint API takes care of magically making
      breakpoints visible to all inferiors.  */
-  set_gdbarch_has_global_breakpoints (gdbarch, 1);
+  set_gdbarch_has_global_breakpoints (gdbarch, true);
 
   /* There's no (standard definition of) entry point or a guaranteed
      text location with a symbol where to place the call dummy, so we
diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c
index c670698b1f1..3ba67a79fbf 100644
--- a/gdb/gdbarch-gen.c
+++ b/gdb/gdbarch-gen.c
@@ -220,8 +220,8 @@ struct gdbarch
   gdbarch_dtrace_probe_is_enabled_ftype *dtrace_probe_is_enabled = nullptr;
   gdbarch_dtrace_enable_probe_ftype *dtrace_enable_probe = nullptr;
   gdbarch_dtrace_disable_probe_ftype *dtrace_disable_probe = nullptr;
-  int has_global_solist = 0;
-  int has_global_breakpoints = 0;
+  bool has_global_solist = false;
+  bool has_global_breakpoints = false;
   gdbarch_has_shared_address_space_ftype *has_shared_address_space = default_has_shared_address_space;
   gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
   gdbarch_guess_tracepoint_registers_ftype *guess_tracepoint_registers = default_guess_tracepoint_registers;
@@ -4698,7 +4698,7 @@ set_gdbarch_dtrace_disable_probe (struct gdbarch *gdbarch,
   gdbarch->dtrace_disable_probe = dtrace_disable_probe;
 }
 
-int
+bool
 gdbarch_has_global_solist (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -4710,12 +4710,12 @@ gdbarch_has_global_solist (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
-			       int has_global_solist)
+			       bool has_global_solist)
 {
   gdbarch->has_global_solist = has_global_solist;
 }
 
-int
+bool
 gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -4727,7 +4727,7 @@ gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch,
-				    int has_global_breakpoints)
+				    bool has_global_breakpoints)
 {
   gdbarch->has_global_breakpoints = has_global_breakpoints;
 }
diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h
index f01aa792179..4949d92d69e 100644
--- a/gdb/gdbarch-gen.h
+++ b/gdb/gdbarch-gen.h
@@ -1496,16 +1496,16 @@ extern void set_gdbarch_dtrace_disable_probe (struct gdbarch *gdbarch, gdbarch_d
    an address space, will see the same set of symbols at the same
    addresses. */
 
-extern int gdbarch_has_global_solist (struct gdbarch *gdbarch);
-extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, int has_global_solist);
+extern bool gdbarch_has_global_solist (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, bool has_global_solist);
 
 /* On some targets, even though each inferior has its own private
    address space, the debug interface takes care of making breakpoints
    visible to all address spaces automatically.  For such cases,
    this property should be set to true. */
 
-extern int gdbarch_has_global_breakpoints (struct gdbarch *gdbarch);
-extern void set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch, int has_global_breakpoints);
+extern bool gdbarch_has_global_breakpoints (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch, bool has_global_breakpoints);
 
 /* True if inferiors share an address space (e.g., uClinux). */
 
diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py
index 8bce7e7753c..cb88a15872a 100644
--- a/gdb/gdbarch_components.py
+++ b/gdb/gdbarch_components.py
@@ -2371,9 +2371,9 @@ This usually means that all processes, although may or may not share
 an address space, will see the same set of symbols at the same
 addresses.
 """,
-    type="int",
+    type="bool",
     name="has_global_solist",
-    predefault="0",
+    predefault="false",
     invalid=False,
 )
 
@@ -2384,9 +2384,9 @@ address space, the debug interface takes care of making breakpoints
 visible to all address spaces automatically.  For such cases,
 this property should be set to true.
 """,
-    type="int",
+    type="bool",
     name="has_global_breakpoints",
-    predefault="0",
+    predefault="false",
     invalid=False,
 )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.