Turn target_have_steppable_watchpoint into function
authorTom Tromey <tom@tromey.com>
Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 29 Sep 2020 01:52:21 +0000 (19:52 -0600)
This changes the object-like macro target_have_steppable_watchpoint
into an inline function.

gdb/ChangeLog
2020-09-28  Tom Tromey  <tom@tromey.com>

* infrun.c (displaced_step_fixup, thread_still_needs_step_over)
(handle_signal_stop): Update.
* procfs.c (procfs_target::insert_watchpoint): Update.
* target.h (target_have_steppable_watchpoint): Now a function.

gdb/ChangeLog
gdb/infrun.c
gdb/procfs.c
gdb/target.h

index fb533aea58224863056aaba2a5f650ab75db5c74..fcfa751fd7f8a869480dde6f909424d5241e9618 100644 (file)
@@ -1,3 +1,10 @@
+2020-09-28  Tom Tromey  <tom@tromey.com>
+
+       * infrun.c (displaced_step_fixup, thread_still_needs_step_over)
+       (handle_signal_stop): Update.
+       * procfs.c (procfs_target::insert_watchpoint): Update.
+       * target.h (target_have_steppable_watchpoint): Now a function.
+
 2020-09-28  Tom Tromey  <tom@tromey.com>
 
        * infrun.c (set_schedlock_func): Update.
index 17b406d6a92a14b64fb236a7f4c329fb14e7ba34..daf10417842fecde9f066a4c767f34ab452745ea 100644 (file)
@@ -1889,7 +1889,7 @@ displaced_step_fixup (thread_info *event_thread, enum gdb_signal signal)
   if (signal == GDB_SIGNAL_TRAP
       && !(target_stopped_by_watchpoint ()
           && (gdbarch_have_nonsteppable_watchpoint (displaced->step_gdbarch)
-              || target_have_steppable_watchpoint)))
+              || target_have_steppable_watchpoint ())))
     {
       /* Fix up the resulting state.  */
       gdbarch_displaced_step_fixup (displaced->step_gdbarch,
@@ -2811,7 +2811,7 @@ thread_still_needs_step_over (struct thread_info *tp)
     what |= STEP_OVER_BREAKPOINT;
 
   if (tp->stepping_over_watchpoint
-      && !target_have_steppable_watchpoint)
+      && !target_have_steppable_watchpoint ())
     what |= STEP_OVER_WATCHPOINT;
 
   return what;
@@ -5933,7 +5933,7 @@ handle_signal_stop (struct execution_control_state *ecs)
   /* If necessary, step over this watchpoint.  We'll be back to display
      it in a moment.  */
   if (stopped_by_watchpoint
-      && (target_have_steppable_watchpoint
+      && (target_have_steppable_watchpoint ()
          || gdbarch_have_nonsteppable_watchpoint (gdbarch)))
     {
       /* At this point, we are stopped at an instruction which has
index a06f0357ec3e5351091c8f7e8d81383b9528eb90..c017f4a15517869f0fd3ec955831e05020ac691d 100644 (file)
@@ -3085,7 +3085,7 @@ procfs_target::insert_watchpoint (CORE_ADDR addr, int len,
                                  enum target_hw_bp_type type,
                                  struct expression *cond)
 {
-  if (!target_have_steppable_watchpoint
+  if (!target_have_steppable_watchpoint ()
       && !gdbarch_have_nonsteppable_watchpoint (target_gdbarch ()))
     /* When a hardware watchpoint fires off the PC will be left at
        the instruction following the one which caused the
index 9ebb0c3f6d046f0c3fe2fe9fec4174a379432028..695f1b2b7f6497185b40c28fed7698f7d9424534 100644 (file)
@@ -2009,8 +2009,11 @@ extern gdb::byte_vector target_thread_info_to_thread_handle
 
 /* Non-zero if we have steppable watchpoints  */
 
-#define target_have_steppable_watchpoint \
-  (current_top_target ()->have_steppable_watchpoint ())
+static inline bool
+target_have_steppable_watchpoint ()
+{
+  return current_top_target ()->have_steppable_watchpoint ();
+}
 
 /* Provide defaults for hardware watchpoint functions.  */