[binutils-gdb] Remove bfd_boolean from gdb

Alan Modra amodra@sourceware.org
Sat Mar 7 21:13:20 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8574f95992b2aca7bcad01d018d19d7c603eb63f

commit 8574f95992b2aca7bcad01d018d19d7c603eb63f
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Mar 6 08:56:43 2026 +1030

    Remove bfd_boolean from gdb
    
    Replace a few vestiges of bfd_boolean in gdb with bool.  I haven't
    tried to replace FALSE/TRUE in gdb except when the type was clearly
    bool.  There may well be other occurrences of FALSE or TRUE that ought
    to be tidied.  Source that uses BOOL or a typedef enum boolean in
    particular isn't changed.

Diff:
---
 gdb/arc-linux-tdep.c              | 6 +++---
 gdb/compile/compile-object-load.c | 4 ++--
 gdb/elfread.c                     | 2 +-
 gdb/findcmd.c                     | 6 +++---
 gdb/ft32-tdep.c                   | 2 +-
 gdb/machoread.c                   | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gdb/arc-linux-tdep.c b/gdb/arc-linux-tdep.c
index 207235d3732..ca3dbf5a5fa 100644
--- a/gdb/arc-linux-tdep.c
+++ b/gdb/arc-linux-tdep.c
@@ -212,18 +212,18 @@ arc_linux_is_sigtramp (const frame_info_ptr &this_frame)
   if (!safe_frame_unwind_memory (this_frame, pc, {buf, insns_sz}))
     {
       /* Failed to unwind frame.  */
-      return FALSE;
+      return false;
     }
 
   /* Is that code the sigtramp instruction sequence?  */
   if (memcmp (buf, arc_sigtramp_insns, insns_sz) == 0)
-    return TRUE;
+    return true;
 
   /* No - look one instruction earlier in the code...  */
   if (!safe_frame_unwind_memory (this_frame, pc - 4, {buf, insns_sz}))
     {
       /* Failed to unwind frame.  */
-      return FALSE;
+      return false;
     }
 
   return (memcmp (buf, arc_sigtramp_insns, insns_sz) == 0);
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 27cd0c7c2f3..bbee2f7cc56 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -220,7 +220,7 @@ link_callbacks_warning (struct bfd_link_info *link_info, const char *xwarning,
 static void
 link_callbacks_undefined_symbol (struct bfd_link_info *link_info,
 				 const char *name, bfd *abfd, asection *section,
-				 bfd_vma address, bfd_boolean is_fatal)
+				 bfd_vma address, bool is_fatal)
 {
   warning (_("Cannot resolve relocation to \"%s\" "
 	     "from compiled module \"%s\" section \"%s\"."),
@@ -372,7 +372,7 @@ copy_section (bfd *abfd, asection *sect,
 
   sect_data_got = bfd_get_relocated_section_contents (abfd, &link_info,
 						      &link_order,
-						      sect_data.get (), FALSE,
+						      sect_data.get (), false,
 						      symbol_table.data ());
 
   if (sect_data_got == NULL)
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 7e38f623d12..7a647396f68 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -601,7 +601,7 @@ elf_rel_plt_read (minimal_symbol_reader &reader,
   if (relplt == NULL)
     return;
 
-  if (! bed->s->slurp_reloc_table (obfd, relplt, dyn_symbol_table, TRUE))
+  if (! bed->s->slurp_reloc_table (obfd, relplt, dyn_symbol_table, true))
     return;
 
   std::string string_buffer;
diff --git a/gdb/findcmd.c b/gdb/findcmd.c
index c4ee0ec97e4..1372c2ee348 100644
--- a/gdb/findcmd.c
+++ b/gdb/findcmd.c
@@ -28,7 +28,7 @@
 /* Copied from bfd_put_bits.  */
 
 static void
-put_bits (uint64_t data, gdb::byte_vector &buf, int bits, bfd_boolean big_p)
+put_bits (uint64_t data, gdb::byte_vector &buf, int bits, bool big_p)
 {
   int i;
   int bytes;
@@ -53,7 +53,7 @@ put_bits (uint64_t data, gdb::byte_vector &buf, int bits, bfd_boolean big_p)
 static gdb::byte_vector
 parse_find_args (const char *args, ULONGEST *max_countp,
 		 CORE_ADDR *start_addrp, ULONGEST *search_space_lenp,
-		 bfd_boolean big_p)
+		 bool big_p)
 {
   /* Default to using the specified type.  */
   char size = '\0';
@@ -210,7 +210,7 @@ static void
 find_command (const char *args, int from_tty)
 {
   struct gdbarch *gdbarch = get_current_arch ();
-  bfd_boolean big_p = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG;
+  bool big_p = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG;
   /* Command line parameters.
      These are initialized to avoid uninitialized warnings from -Wall.  */
   ULONGEST max_count = 0;
diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c
index 84b9ce657cb..fc796f44ae1 100644
--- a/gdb/ft32-tdep.c
+++ b/gdb/ft32-tdep.c
@@ -61,7 +61,7 @@ struct ft32_frame_cache
   /* Saved SP in this frame */
   CORE_ADDR saved_sp;
   /* Has the new frame been LINKed.  */
-  bfd_boolean established;
+  bool established;
 };
 
 /* Implement the "frame_align" gdbarch method.  */
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 334e3b41b6a..416eb6766fd 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -483,7 +483,7 @@ macho_add_oso_symfile (oso_el *oso, const gdb_bfd_ref_ptr &abfd,
 	  struct macho_sym_hash_entry *ent;
 
 	  ent = (struct macho_sym_hash_entry *)
-	    bfd_hash_lookup (&table, sym->name, TRUE, FALSE);
+	    bfd_hash_lookup (&table, sym->name, true, false);
 	  if (ent->sym != NULL)
 	    complaint (_("Duplicated symbol %s in symbol table"), sym->name);
 	  else
@@ -548,7 +548,7 @@ macho_add_oso_symfile (oso_el *oso, const gdb_bfd_ref_ptr &abfd,
 		  struct macho_sym_hash_entry *ent;
 
 		  ent = (struct macho_sym_hash_entry *)
-		    bfd_hash_lookup (&table, sym->name, FALSE, FALSE);
+		    bfd_hash_lookup (&table, sym->name, false, false);
 		  if (ent != NULL)
 		    addr = bfd_asymbol_value (ent->sym);
 		}


More information about the Gdb-cvs mailing list