[binutils-gdb] gdb: change gdbarch_has_dos_based_file_system 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=2edcc6ee9067f8feaad7f7136d2faffcf487cf52

commit 2edcc6ee9067f8feaad7f7136d2faffcf487cf52
Author: Simon Marchi <[email protected]>
Date:   Fri Feb 27 15:05:25 2026 -0500

    gdb: change gdbarch_has_dos_based_file_system to bool
    
    Change-Id: I62125fd2657224bf112dd031b9251597dfdf3b06
    Approved-By: Tom Tromey <[email protected]>

Diff:
---
 gdb/gdbarch-gen.c         | 6 +++---
 gdb/gdbarch-gen.h         | 4 ++--
 gdb/gdbarch_components.py | 4 ++--
 gdb/i386-go32-tdep.c      | 2 +-
 gdb/windows-tdep.c        | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c
index e1f8759a8ee..52211c13802 100644
--- a/gdb/gdbarch-gen.c
+++ b/gdb/gdbarch-gen.c
@@ -226,7 +226,7 @@ struct gdbarch
   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;
   gdbarch_auto_wide_charset_ftype *auto_wide_charset = default_auto_wide_charset;
-  int has_dos_based_file_system = 0;
+  bool has_dos_based_file_system = false;
   gdbarch_gen_return_address_ftype *gen_return_address = default_gen_return_address;
   gdbarch_info_proc_ftype *info_proc = nullptr;
   gdbarch_core_info_proc_ftype *core_info_proc = nullptr;
@@ -4800,7 +4800,7 @@ set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch,
   gdbarch->auto_wide_charset = auto_wide_charset;
 }
 
-int
+bool
 gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -4812,7 +4812,7 @@ gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch,
-				       int has_dos_based_file_system)
+				       bool has_dos_based_file_system)
 {
   gdbarch->has_dos_based_file_system = has_dos_based_file_system;
 }
diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h
index 3225a0857eb..03b4ee0561c 100644
--- a/gdb/gdbarch-gen.h
+++ b/gdb/gdbarch-gen.h
@@ -1538,8 +1538,8 @@ extern void set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch, gdbarch_auto
    is, absolute paths include a drive name, and the backslash is
    considered a directory separator. */
 
-extern int gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch);
-extern void set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch, int has_dos_based_file_system);
+extern bool gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch, bool has_dos_based_file_system);
 
 /* Generate bytecodes to collect the return address in a frame.
    Since the bytecodes run on the target, possibly with GDB not even
diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py
index 6fdc576283c..1b1e73bbe66 100644
--- a/gdb/gdbarch_components.py
+++ b/gdb/gdbarch_components.py
@@ -2443,9 +2443,9 @@ If true, the target OS has DOS-based file system semantics.  That
 is, absolute paths include a drive name, and the backslash is
 considered a directory separator.
 """,
-    type="int",
+    type="bool",
     name="has_dos_based_file_system",
-    predefault="0",
+    predefault="false",
     invalid=False,
 )
 
diff --git a/gdb/i386-go32-tdep.c b/gdb/i386-go32-tdep.c
index c9967eb5789..13c4b51c3f9 100644
--- a/gdb/i386-go32-tdep.c
+++ b/gdb/i386-go32-tdep.c
@@ -36,7 +36,7 @@ i386_go32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   if (!tdesc_has_registers (info.target_desc))
     tdep->tdesc = i386_target_description (X86_XSTATE_X87_MASK, false);
 
-  set_gdbarch_has_dos_based_file_system (gdbarch, 1);
+  set_gdbarch_has_dos_based_file_system (gdbarch, true);
 
   set_gdbarch_wchar_bit (gdbarch, 16);
   set_gdbarch_wchar_signed (gdbarch, false);
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index ee04ed10f24..a79d1b5e02e 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -947,7 +947,7 @@ windows_init_abi_common (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   /* Canonical paths on this target look like
      `c:\Program Files\Foo App\mydll.dll', for example.  */
-  set_gdbarch_has_dos_based_file_system (gdbarch, 1);
+  set_gdbarch_has_dos_based_file_system (gdbarch, true);
 
   set_gdbarch_make_solib_ops (gdbarch, make_windows_solib_ops);
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.