summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2008-10-04 18:56:37 +0000
committerMichael Snyder <msnyder@vmware.com>2008-10-04 18:56:37 +0000
commitdde9778f89ad5c4036bd23e78b40c7675df31572 (patch)
tree99a1792514849046a59d6729494c68931c082675
parentb4a30192bc12bde728e0b5912e3a55a3d8dcc36e (diff)
downloadbinutils-gdb-dde9778f89ad5c4036bd23e78b40c7675df31572.tar.gz
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.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/record.c44
-rw-r--r--gdb/record.h8
-rw-r--r--gdb/remote.c22
-rw-r--r--gdb/reverse.c18
-rw-r--r--gdb/target.c4
-rw-r--r--gdb/target.h12
7 files changed, 64 insertions, 53 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d76205fa7e0..a1ffd2297c7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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'.
diff --git a/gdb/record.c b/gdb/record.c
index c7a8acb6265..f182ea13483 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -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;
}
diff --git a/gdb/record.h b/gdb/record.h
index 174697576ae..c5b04dfe716 100644
--- a/gdb/record.h
+++ b/gdb/record.h
@@ -20,8 +20,10 @@
#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);
diff --git a/gdb/remote.c b/gdb/remote.c
index 5fe6371ece7..2bcb4da2294 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -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;
diff --git a/gdb/reverse.c b/gdb/reverse.c
index 4b3a0c883b5..661360c53f7 100644
--- a/gdb/reverse.c
+++ b/gdb/reverse.c
@@ -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);
}
diff --git a/gdb/target.c b/gdb/target.c
index e42c1b4e43a..879d317c902 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -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);
diff --git a/gdb/target.h b/gdb/target.h
index 88d07db4681..798d872fac7 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -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 *);