]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2008-10-04 Michael Snyder <msnyder@vmware.com>
authorMichael Snyder <msnyder@vmware.com>
Sat, 4 Oct 2008 18:56:37 +0000 (18:56 +0000)
committerMichael Snyder <msnyder@vmware.com>
Sat, 4 Oct 2008 18:56:37 +0000 (18:56 +0000)
* target.c, target.h: Rename execdir to exec_direction.
* record.c, record.h: Ditto.
* reverse.c: Ditto.
* remote.c: Ditto.

* reverse.c (show_exec_direction_func): Don't error, just inform.

gdb/ChangeLog
gdb/record.c
gdb/record.h
gdb/remote.c
gdb/reverse.c
gdb/target.c
gdb/target.h

index d76205fa7e014e74da008b42f4ace7af3370b327..a1ffd2297c77f5b1bef57273a1336e01348fb6aa 100644 (file)
@@ -1,4 +1,11 @@
-2008-10-02  Michael Snyder  <msnyder@vmware.com>
+2008-10-04  Michael Snyder  <msnyder@vmware.com>
+
+       * target.c, target.h: Rename execdir to exec_direction.
+       * record.c, record.h: Ditto.
+       * reverse.c: Ditto.
+       * remote.c: Ditto.
+
+       * reverse.c (show_exec_direction_func): Don't error, just inform.
 
        * reverse.c (reverse-continue): Remove a comma from docs string,
        to avoid confusing output from 'apropos'.
index c7a8acb62652987ba5adf5b76df0fc76517b755b..f182ea134832300d9ef3fac4dc1b4c52d5c5b85a 100644 (file)
@@ -44,7 +44,7 @@ static int record_insn_num = 0;
 
 struct target_ops record_ops;
 int record_resume_step = 0;
-enum exec_direction_kind record_execdir = EXEC_FORWARD;
+enum exec_direction_kind record_exec_direction = EXEC_FORWARD;
 static int record_get_sig = 0;
 static sigset_t record_maskall;
 static int record_not_record = 0;
@@ -416,7 +416,7 @@ record_open (char *name, int from_tty)
 
   /* Reset */
   record_insn_num = 0;
-  record_execdir = EXEC_FORWARD;
+  record_exec_direction = EXEC_FORWARD;
   record_list = &record_first;
   record_list->next = NULL;
 
@@ -459,7 +459,7 @@ record_sig_handler (int signo)
 static void
 record_wait_cleanups (void *ignore)
 {
-  if (record_execdir == EXEC_REVERSE)
+  if (record_exec_direction == EXEC_REVERSE)
     {
       if (record_list->next)
        {
@@ -517,7 +517,7 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
 
       /* In EXEC_FORWARD mode, record_list point to the tail of prev
          instruction.  */
-      if (record_execdir == EXEC_FORWARD && record_list->next)
+      if (record_exec_direction == EXEC_FORWARD && record_list->next)
         {
          record_list = record_list->next;
        }
@@ -528,14 +528,14 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
       do
        {
          /* Check for beginning and end of log.  */
-         if (record_execdir == EXEC_REVERSE 
+         if (record_exec_direction == EXEC_REVERSE 
              && record_list == &record_first)
            {
              /* Hit beginning of record log in reverse.  */
              status->kind = TARGET_WAITKIND_NO_HISTORY;
              break;
            }
-         if (record_execdir != EXEC_REVERSE && !record_list->next)
+         if (record_exec_direction != EXEC_REVERSE && !record_list->next)
            {
              /* Hit end of record log going forward.  */
              status->kind = TARGET_WAITKIND_NO_HISTORY;
@@ -603,7 +603,7 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
                                      record_list->u.need_dasm);
                }
 
-             if (record_execdir == EXEC_FORWARD)
+             if (record_exec_direction == EXEC_FORWARD)
                {
                  need_dasm = record_list->u.need_dasm;
                }
@@ -612,7 +612,7 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
                  gdbarch_process_record_dasm (current_gdbarch);
                }
 
-             if (first_record_end && record_execdir == EXEC_REVERSE)
+             if (first_record_end && record_exec_direction == EXEC_REVERSE)
                {
                  /* When reverse excute, the first record_end is the part of
                     current instruction. */
@@ -666,7 +666,7 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
                        }
                    }
                }
-             if (record_execdir == EXEC_REVERSE)
+             if (record_exec_direction == EXEC_REVERSE)
                {
                  need_dasm = record_list->u.need_dasm;
                }
@@ -675,7 +675,7 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
 next:
          if (continue_flag)
            {
-             if (record_execdir == EXEC_REVERSE)
+             if (record_exec_direction == EXEC_REVERSE)
                {
                  if (record_list->prev)
                    record_list = record_list->prev;
@@ -924,26 +924,28 @@ record_remove_breakpoint (struct bp_target_info *bp_tgt)
 }
 
 static enum exec_direction_kind
-record_get_execdir (void)
+record_get_exec_direction (void)
 {
   if (record_debug > 1)
-    printf_filtered ("Record: execdir is %s\n",
-                    record_execdir == EXEC_FORWARD ? "forward" :
-                    record_execdir == EXEC_REVERSE ? "reverse" : "unknown");
-  return record_execdir;
+    printf_filtered ("Record: exec direction is %s\n",
+                    record_exec_direction == EXEC_FORWARD ? "forward" :
+                    record_exec_direction == EXEC_REVERSE ? "reverse" : 
+                    "unknown");
+  return record_exec_direction;
 }
 
 static int
-record_set_execdir (enum exec_direction_kind dir)
+record_set_exec_direction (enum exec_direction_kind dir)
 {
   if (record_debug)
-    printf_filtered ("Record: set execdir: %s\n",
+    printf_filtered ("Record: set exec direction: %s\n",
                     dir == EXEC_FORWARD ? "forward" :
-                    dir == EXEC_REVERSE ? "reverse" : "bad direction");
+                    dir == EXEC_REVERSE ? "reverse" : 
+                    "bad direction");
 
   /* FIXME: check target for capability.  */
   if (dir == EXEC_FORWARD || dir == EXEC_REVERSE)
-    return (record_execdir = dir);
+    return (record_exec_direction = dir);
   else
     return EXEC_ERROR;
 }
@@ -968,8 +970,8 @@ init_record_ops (void)
   record_ops.to_xfer_partial = record_xfer_partial;
   record_ops.to_insert_breakpoint = record_insert_breakpoint;
   record_ops.to_remove_breakpoint = record_remove_breakpoint;
-  record_ops.to_get_execdir = record_get_execdir;
-  record_ops.to_set_execdir = record_set_execdir;
+  record_ops.to_get_exec_direction = record_get_exec_direction;
+  record_ops.to_set_exec_direction = record_set_exec_direction;
   record_ops.to_stratum = record_stratum;
   record_ops.to_magic = OPS_MAGIC;
 }
index 174697576ae61541064a3e972287f29fcf811bcf..c5b04dfe716c822386a0994b09c42d70078645bb 100644 (file)
 #ifndef _RECORD_H_
 #define _RECORD_H_
 
-#define RECORD_IS_USED                         (current_target.beneath == &record_ops)
-#define RECORD_IS_REPLAY                       (record_list->next || record_execdir == EXEC_REVERSE)
+#define RECORD_IS_USED   \
+     (current_target.beneath == &record_ops)
+#define RECORD_IS_REPLAY \
+     (record_list->next || record_exec_direction == EXEC_REVERSE)
 #define RECORD_TARGET_SUPPORT_RECORD_WAIT      (record_ops.beneath->to_support_record_wait)
 
 typedef struct record_reg_s
@@ -76,7 +78,7 @@ extern struct regcache *record_regcache;
 extern struct target_ops record_ops;
 extern int record_resume_step;
 extern int record_regcache_raw_write_regnum;
-extern enum exec_direction_kind record_execdir;
+extern enum exec_direction_kind record_exec_direction;
 
 extern int record_arch_list_add_reg (int num);
 extern int record_arch_list_add_mem (CORE_ADDR addr, int len);
index 5fe6371ece791d1bf7fac13d9f4767873410ca9d..2bcb4da229471a8501abd160739ca65bbb30d65e 100644 (file)
@@ -7562,29 +7562,29 @@ remote_command (char *args, int from_tty)
 
 /* Reverse execution.
    TODO: set up as a capability.  */
-static enum exec_direction_kind remote_execdir = EXEC_FORWARD;
+static enum exec_direction_kind remote_exec_direction = EXEC_FORWARD;
 
-static enum exec_direction_kind remote_get_execdir (void)
+static enum exec_direction_kind remote_get_exec_direction (void)
 {
   if (remote_debug && info_verbose)
-    printf_filtered ("remote execdir is %s\n",
-                    remote_execdir == EXEC_FORWARD ? "forward" :
-                    remote_execdir == EXEC_REVERSE ? "reverse" :
+    printf_filtered ("remote exec direction is %s\n",
+                    remote_exec_direction == EXEC_FORWARD ? "forward" :
+                    remote_exec_direction == EXEC_REVERSE ? "reverse" :
                     "unknown");
-  return remote_execdir;
+  return remote_exec_direction;
 }
 
-static int remote_set_execdir (enum exec_direction_kind dir)
+static int remote_set_exec_direction (enum exec_direction_kind dir)
 {
   if (remote_debug && info_verbose)
-    printf_filtered ("Set remote execdir: %s\n",
+    printf_filtered ("Set remote exec direction: %s\n",
                     dir == EXEC_FORWARD ? "forward" :
                     dir == EXEC_REVERSE ? "reverse" :
                     "bad direction");
 
   /* TODO: check target for capability.  */
   if (dir == EXEC_FORWARD || dir == EXEC_REVERSE)
-    return (remote_execdir = dir);
+    return (remote_exec_direction = dir);
   else
     return EXEC_ERROR;
 }
@@ -7637,8 +7637,8 @@ Specify the serial device it is connected to\n\
   remote_ops.to_has_registers = 1;
   remote_ops.to_has_execution = 1;
   remote_ops.to_has_thread_control = tc_schedlock;     /* can lock scheduler */
-  remote_ops.to_get_execdir = remote_get_execdir;
-  remote_ops.to_set_execdir = remote_set_execdir;
+  remote_ops.to_get_exec_direction = remote_get_exec_direction;
+  remote_ops.to_set_exec_direction = remote_set_exec_direction;
   remote_ops.to_magic = OPS_MAGIC;
   remote_ops.to_memory_map = remote_memory_map;
   remote_ops.to_flash_erase = remote_flash_erase;
index 4b3a0c883b58a20629e0c3853fb14606197028b3..661360c53f7bb3bb85bded680301b669b850fd6a 100644 (file)
@@ -27,8 +27,8 @@
 #include "cli/cli-decode.h"
 
 /* User interface for reverse debugging:
-   Set exec-direction / show exec-direction commands
-   (returns error unles target implements to_set_execdir method).  */
+   Set exec-direction / show exec-direction commands (returns error 
+   unles target implements to_set_exec_direction method).  */
 
 static const char exec_forward[] = "forward";
 static const char exec_reverse[] = "reverse";
@@ -65,25 +65,25 @@ show_exec_direction_func (struct ui_file *out, int from_tty,
 
   switch (dir) {
   case EXEC_FORWARD:
-    fprintf_filtered (out, "Forward.\n");
+    fprintf_filtered (out, _("Forward\n"));
     break;
   case EXEC_REVERSE:
-    fprintf_filtered (out, "Reverse.\n");
+    fprintf_filtered (out, _("Reverse\n"));
     break;
   case EXEC_ERROR:
   default:
     fprintf_filtered,  (out, 
-                       _("Target `%s' does not support execution-direction."),
+                       _("Forward (target `%s' does not support exec-direction)\n"),
                        target_shortname);
     break;
   }
 }
 
 /* User interface:
-   reverse-step, reverse-next etc.
-   (returns error unles target implements to_set_execdir method).  */
+   reverse-step, reverse-next etc. (returns error unles 
+   target implements to_set_exec_direction method).  */
 
-static void execdir_default (void *notused)
+static void exec_direction_default (void *notused)
 {
   /* Return execution direction to default state.  */
   target_set_execution_direction (EXEC_FORWARD);
@@ -106,7 +106,7 @@ exec_reverse_once (char *cmd, char *args, int from_tty)
   if (target_set_execution_direction (EXEC_REVERSE) == EXEC_ERROR)
     error (_("Target %s does not support this command."), target_shortname);
 
-  make_cleanup (execdir_default, NULL);
+  make_cleanup (exec_direction_default, NULL);
   sprintf (reverse_command, "%s %s", cmd, args ? args : "");
   execute_command (reverse_command, from_tty);
 }
index e42c1b4e43a99b44f51c6e50df121c64ff1e38af..879d317c90298ae546080bccb7954bfe90b2c497 100644 (file)
@@ -465,8 +465,8 @@ update_current_target (void)
       INHERIT (to_find_memory_regions, t);
       INHERIT (to_make_corefile_notes, t);
       INHERIT (to_get_thread_local_address, t);
-      INHERIT (to_get_execdir, t);
-      INHERIT (to_set_execdir, t);
+      INHERIT (to_get_exec_direction, t);
+      INHERIT (to_set_exec_direction, t);
       /* Do not inherit to_read_description.  */
       /* Do not inherit to_search_memory.  */
       INHERIT (to_magic, t);
index 88d07db4681e230ddf91d9019c98c5e65355a30e..798d872fac7cdde3e0c0f1c9f7f3ab47d379b96c 100644 (file)
@@ -537,9 +537,9 @@ struct target_ops
                             CORE_ADDR *found_addrp);
 
     /* Set execution direction (forward/reverse).  */
-    int (*to_set_execdir) (enum exec_direction_kind);
+    int (*to_set_exec_direction) (enum exec_direction_kind);
     /* Get execution direction (forward/reverse).  */
-    enum exec_direction_kind (*to_get_execdir) (void);
+    enum exec_direction_kind (*to_get_exec_direction) (void);
 
     /* Default value is 0. Mean that this target doesn't support record wait.
        Need the help of infrun.c(handle_inferior_event). Set to 1 if this
@@ -1154,12 +1154,12 @@ extern int target_stopped_data_address_p (struct target_ops *);
    These will only be implemented by a target that supports reverse execution.
 */
 #define target_get_execution_direction() \
-    (current_target.to_get_execdir ? \
-     (*current_target.to_get_execdir) () : EXEC_ERROR)
+    (current_target.to_get_exec_direction ? \
+     (*current_target.to_get_exec_direction) () : EXEC_ERROR)
 
 #define target_set_execution_direction(DIR) \
-    (current_target.to_set_execdir ? \
-     (*current_target.to_set_execdir) (DIR) : EXEC_ERROR)
+    (current_target.to_set_exec_direction ? \
+     (*current_target.to_set_exec_direction) (DIR) : EXEC_ERROR)
 
 
 extern const struct target_desc *target_read_description (struct target_ops *);