]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Turn target_can_execute_reverse 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 target_can_execute_reverse from an object-like macro to
an inline function.

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

* mi/mi-main.c (exec_reverse_continue)
(mi_cmd_list_target_features): Update.
* infrun.c (set_exec_direction_func): Update.
* target.c (default_execution_direction): Update.
* reverse.c (exec_reverse_once): Update.
* target.h (target_can_execute_reverse): Now a function.

gdb/ChangeLog
gdb/infrun.c
gdb/mi/mi-main.c
gdb/reverse.c
gdb/target.c
gdb/target.h

index dbd1e1eadd33ba7fe87395e0c5f6b90a2e959d32..dcce8212ca09e7ed95658680ed28ef78583a8086 100644 (file)
@@ -1,3 +1,12 @@
+2020-09-28  Tom Tromey  <tom@tromey.com>
+
+       * mi/mi-main.c (exec_reverse_continue)
+       (mi_cmd_list_target_features): Update.
+       * infrun.c (set_exec_direction_func): Update.
+       * target.c (default_execution_direction): Update.
+       * reverse.c (exec_reverse_once): Update.
+       * target.h (target_can_execute_reverse): Now a function.
+
 2020-09-28  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-regs.c (tui_get_register)
index 118538dfbc01582eaea8831fe2c931c45b67bb76..e4bd692760c93b1c636e922bd4825da54305ce05 100644 (file)
@@ -9145,7 +9145,7 @@ static void
 set_exec_direction_func (const char *args, int from_tty,
                         struct cmd_list_element *cmd)
 {
-  if (target_can_execute_reverse)
+  if (target_can_execute_reverse ())
     {
       if (!strcmp (exec_direction, exec_forward))
        execution_direction = EXEC_FORWARD;
index 99da554c4449701b2a7855540e79effe9f324504..c5c7be7246a820d7051b88762e7430825fac79ba 100644 (file)
@@ -321,7 +321,7 @@ exec_reverse_continue (char **argv, int argc)
   if (dir == EXEC_REVERSE)
     error (_("Already in reverse mode."));
 
-  if (!target_can_execute_reverse)
+  if (!target_can_execute_reverse ())
     error (_("Target %s does not support this command."), target_shortname);
 
   scoped_restore save_exec_dir = make_scoped_restore (&execution_direction,
@@ -1684,7 +1684,7 @@ mi_cmd_list_target_features (const char *command, char **argv, int argc)
       ui_out_emit_list list_emitter (uiout, "features");
       if (mi_async_p ())
        uiout->field_string (NULL, "async");
-      if (target_can_execute_reverse)
+      if (target_can_execute_reverse ())
        uiout->field_string (NULL, "reverse");
       return;
     }
index 583e0d02da2150dbc87aae5bb711af5b8960cc13..4aa22251b27e4359f484a0acc520a104cabdf0cd 100644 (file)
@@ -44,7 +44,7 @@ exec_reverse_once (const char *cmd, const char *args, int from_tty)
     error (_("Already in reverse mode.  Use '%s' or 'set exec-dir forward'."),
           cmd);
 
-  if (!target_can_execute_reverse)
+  if (!target_can_execute_reverse ())
     error (_("Target %s does not support this command."), target_shortname);
 
   std::string reverse_command = string_printf ("%s %s", cmd, args ? args : "");
index ea1535713245e3dbb9087cffe71e1b2175e72d92..4f58daa6d22681fc45c2a7e9e025681604bdf10f 100644 (file)
@@ -525,7 +525,7 @@ default_get_ada_task_ptid (struct target_ops *self, long lwp, long tid)
 static enum exec_direction_kind
 default_execution_direction (struct target_ops *self)
 {
-  if (!target_can_execute_reverse)
+  if (!target_can_execute_reverse ())
     return EXEC_FORWARD;
   else if (!target_can_async_p ())
     return EXEC_FORWARD;
index f58334a6b8b1234e6d1cde6cf798df458a004c50..ea777f2fb3679bd7995e55e07f055551a2006f3e 100644 (file)
@@ -2117,8 +2117,11 @@ extern int target_ranged_break_num_registers (void);
 extern int target_masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask);
 
 /* Target can execute in reverse?  */
-#define target_can_execute_reverse \
-      current_top_target ()->can_execute_reverse ()
+static inline bool
+target_can_execute_reverse ()
+{
+  return current_top_target ()->can_execute_reverse ();
+}
 
 extern const struct target_desc *target_read_description (struct target_ops *);