]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: change gdbarch_have_nonsteppable_watchpoint to bool
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 27 Feb 2026 20:05:11 +0000 (15:05 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 9 Mar 2026 17:15:46 +0000 (13:15 -0400)
There is one unnecessary call to
set_gdbarch_have_nonsteppable_watchpoint that passes false (which is the
default), in arc-tdep.c, but I left it there because there is an
insightful comment and I didn't feel like deleting it.

Change-Id: Iccb9851c1cf28f48a075649b1dbc7c9388383df3
Approved-By: Tom Tromey <tom@tromey.com>
15 files changed:
gdb/aarch64-tdep.c
gdb/arc-tdep.c
gdb/arm-tdep.c
gdb/cris-tdep.c
gdb/gdbarch-gen.c
gdb/gdbarch-gen.h
gdb/gdbarch_components.py
gdb/hppa-tdep.c
gdb/lm32-tdep.c
gdb/loongarch-tdep.c
gdb/mips-tdep.c
gdb/or1k-tdep.c
gdb/riscv-tdep.c
gdb/rs6000-tdep.c
gdb/xtensa-tdep.c

index 5904e65f3bc06e2e9c9ac8ed42a4bf83d46e1efe..dad4598617fc0234921f7e0a4de7a58bbe986afb 100644 (file)
@@ -4783,7 +4783,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
                                       aarch64_breakpoint::kind_from_pc);
   set_gdbarch_sw_breakpoint_from_kind (gdbarch,
                                       aarch64_breakpoint::bp_from_kind);
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
   set_gdbarch_get_next_pcs (gdbarch, aarch64_software_single_step);
 
   /* Information about registers, etc.  */
index d1c1998bce8ca6ab0a4759338743bd84b11413e5..ca08bb5a2945b1ecc9ff502bdbfc80daae5718b1 100644 (file)
@@ -2336,7 +2336,7 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
      significant delay, like one or two instructions, depending on type of
      memory where write is performed (CCM or external) and next instruction
      after the memory write.  */
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 0);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, false);
 
   /* This doesn't include possible long-immediate value.  */
   set_gdbarch_max_insn_length (gdbarch, 4);
index 2435a5398b81d88f63ddd179cb2bae30ca57241f..727848fcf57d56cbe391db1da35e37d84935be14 100644 (file)
@@ -10794,7 +10794,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     tdep->arm_abi = ARM_ABI_APCS;
 
   /* Watchpoints are not steppable.  */
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   /* We used to default to FPA for generic ARM, but almost nobody
      uses that now, and we now provide a way for the user to force
index cb9d07009eba38167a56a0dcee5093eec684ea24..d59db69c60d538b37cda2576314e7ea75e6a483c 100644 (file)
@@ -4009,7 +4009,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_cannot_fetch_register
        (gdbarch, crisv32_cannot_fetch_register);
 
-      set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+      set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
       set_gdbarch_single_step_through_delay
        (gdbarch, crisv32_single_step_through_delay);
index 97a04979abebc4f05dd4fe9c9fbe4b1d279fc5c4..d25bcca54810f43e407c32c8160c44193857e4f1 100644 (file)
@@ -162,7 +162,7 @@ struct gdbarch
   gdbarch_adjust_dwarf2_addr_ftype *adjust_dwarf2_addr = default_adjust_dwarf2_addr;
   gdbarch_adjust_dwarf2_line_ftype *adjust_dwarf2_line = default_adjust_dwarf2_line;
   bool cannot_step_breakpoint = false;
-  int have_nonsteppable_watchpoint = 0;
+  bool have_nonsteppable_watchpoint = false;
   gdbarch_address_class_type_flags_ftype *address_class_type_flags = nullptr;
   gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name = nullptr;
   gdbarch_execute_dwarf_cfa_vendor_op_ftype *execute_dwarf_cfa_vendor_op = default_execute_dwarf_cfa_vendor_op;
@@ -3478,7 +3478,7 @@ set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
   gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
 }
 
-int
+bool
 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -3490,7 +3490,7 @@ gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
 
 void
 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
-                                         int have_nonsteppable_watchpoint)
+                                         bool have_nonsteppable_watchpoint)
 {
   gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
 }
index 941477f08a350013ec137953333bb485075e5a88..7fd40c9dc90eaab694276337317a49f714c0c4b9 100644 (file)
@@ -893,8 +893,8 @@ extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, bool ca
 /* See comment in target.h about continuable, steppable and
    non-steppable watchpoints. */
 
-extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
-extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
+extern bool gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
+extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, bool have_nonsteppable_watchpoint);
 
 extern bool gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
 
index d326012c3a58a01bb31193b19d00abdfab7fd313..50be82c578deb2f614f3ad698325a99b72f74fb9 100644 (file)
@@ -1537,9 +1537,9 @@ Value(
 See comment in target.h about continuable, steppable and
 non-steppable watchpoints.
 """,
-    type="int",
+    type="bool",
     name="have_nonsteppable_watchpoint",
-    predefault="0",
+    predefault="false",
     invalid=False,
 )
 
index 302511b604f85d2d46a9230fa4af6cbba08dc918..92b6c34789a06fb07c9f54cb252d43bf00905e6b 100644 (file)
@@ -3089,7 +3089,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
      it by removing all eventpoints; stepping past the instruction
      that caused the trigger; reinserting eventpoints; and checking
      whether any watched location changed.  */
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   /* Inferior function call methods.  */
   switch (tdep->bytes_per_address)
index 1a885b2be8942b9cb89d198dbd6ce6e95b5fa96a..2f7c21d6a21f882c52abc41ebd00e60384bf0443 100644 (file)
@@ -524,7 +524,7 @@ lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Breakpoints.  */
   set_gdbarch_breakpoint_kind_from_pc (gdbarch, lm32_breakpoint::kind_from_pc);
   set_gdbarch_sw_breakpoint_from_kind (gdbarch, lm32_breakpoint::bp_from_kind);
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   /* Calling functions in the inferior.  */
   set_gdbarch_push_dummy_call (gdbarch, lm32_push_dummy_call);
index 664d78a01ada97bb7a509588ceeb5f5768c96576..6b706195e9e06c851643e0a84aee83addc3e96d9 100644 (file)
@@ -2218,7 +2218,7 @@ loongarch_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_get_next_pcs (gdbarch, loongarch_software_single_step);
   set_gdbarch_breakpoint_kind_from_pc (gdbarch, loongarch_breakpoint::kind_from_pc);
   set_gdbarch_sw_breakpoint_from_kind (gdbarch, loongarch_breakpoint::bp_from_kind);
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   /* Frame unwinders. Use DWARF debug info if available, otherwise use our own unwinder.  */
   set_gdbarch_dwarf2_reg_to_regnum (gdbarch, loongarch_dwarf2_reg_to_regnum);
index 27ac746bcf964262c268ddd5defbe80a3e743c53..c34c4d6c21f1fb0c0dbd43bfe8abc3bee17dd6c4 100644 (file)
@@ -8725,7 +8725,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
      being used as guards for target_stopped_by_watchpoint, why not have
      target_stopped_by_watchpoint return the type of watchpoint that the code
      is sitting on?  */
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   set_gdbarch_skip_trampoline_code (gdbarch, mips_skip_trampoline_code);
 
index c7ee152cdfce60af830b448fb19219b6e2b0730c..55efa76234cc488aee9b61deb812a74b05e0abf9 100644 (file)
@@ -1182,7 +1182,7 @@ or1k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
                                       or1k_breakpoint::kind_from_pc);
   set_gdbarch_sw_breakpoint_from_kind (gdbarch,
                                       or1k_breakpoint::bp_from_kind);
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   /* Register architecture */
   set_gdbarch_num_regs (gdbarch, OR1K_NUM_REGS);
index bc6b60699c38dc131320c37b74e711d468737b9f..452859b45ac4d5800d6d153e3675f298a594f118 100644 (file)
@@ -4320,7 +4320,7 @@ riscv_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_return_value_as_value (gdbarch, riscv_return_value);
   set_gdbarch_breakpoint_kind_from_pc (gdbarch, riscv_breakpoint_kind_from_pc);
   set_gdbarch_sw_breakpoint_from_kind (gdbarch, riscv_sw_breakpoint_from_kind);
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   /* Functions to analyze frames.  */
   set_gdbarch_skip_prologue (gdbarch, riscv_skip_prologue);
index f6b8963b9cc2130a996e1db2b0630bb7deac3c93..a68309d2a868bfa0acd32952e3aa9d5d9e967f53 100644 (file)
@@ -8342,7 +8342,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_gen_return_address (gdbarch, rs6000_gen_return_address);
 
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   set_gdbarch_num_regs (gdbarch, PPC_NUM_REGS);
 
index 388b57dcaee52ca16389173c25f23ee42c18ef4c..9ec5653e968f47bca061224c107559c63114aa84 100644 (file)
@@ -3226,7 +3226,7 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   frame_unwind_append_unwinder (gdbarch, &xtensa_unwind);
   dwarf2_append_unwinders (gdbarch);
 
-  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+  set_gdbarch_have_nonsteppable_watchpoint (gdbarch, true);
 
   xtensa_add_reggroups (gdbarch);
   set_gdbarch_register_reggroup_p (gdbarch, xtensa_register_reggroup_p);