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 2/4] Don't use BFD TRUE/FALSE constants
Date: Sat, 07 Mar 2026 11:20:47 -0700	[thread overview]
Message-ID: <20260307-no-bfd-boolean-v1-2-186424bf8238@tromey.com> (raw)
In-Reply-To: <20260307-no-bfd-boolean-v1-0-186424bf8238@tromey.com>

This patch replaces uses of the BFD TRUE/FALSE constants with the
corresponding C++ constants.

Note that some uses of TRUE and FALSE remain:

* Mach code (Darwin and Hurd).  I don't know if this is typical and
  anyway I can't build this code.
* Curses code
* Windows code
---
 gdb/arc-linux-tdep.c              | 6 +++---
 gdb/compile/compile-object-load.c | 2 +-
 gdb/elfread.c                     | 2 +-
 gdb/machoread.c                   | 4 ++--
 4 files changed, 7 insertions(+), 7 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 e31be539741..bbee2f7cc56 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -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/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);
 		}

-- 
2.49.0


  parent reply	other threads:[~2026-03-07 18:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-07 18:20 [PATCH 0/4] Remove some bfd_boolean uses Tom Tromey
2026-03-07 18:20 ` [PATCH 1/4] Use bool, not bfd_boolean Tom Tromey
2026-03-07 18:20 ` Tom Tromey [this message]
2026-03-07 18:20 ` [PATCH 3/4] Drop use of bfd_boolean from findcmd.c Tom Tromey
2026-08-07 12:54   ` Guinevere Larsen
2026-03-07 18:20 ` [PATCH 4/4] Poison bfd_boolean Tom Tromey
2026-08-07 12:55 ` [PATCH 0/4] Remove some bfd_boolean uses Guinevere Larsen
2026-08-21 16:42   ` Tom Tromey

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=20260307-no-bfd-boolean-v1-2-186424bf8238@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