summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2008-10-06 01:13:37 +0000
committerMichael Snyder <msnyder@specifix.com>2008-10-06 01:13:37 +0000
commit5202b160fbd2a6754aded911918da89dbf177360 (patch)
tree476119a663fb44ec0e922fec29f99a04d90a2204
parent6f04a1cd12b5bbe73b0bf2b15fb26ce635d03495 (diff)
downloadgdb-5202b160fbd2a6754aded911918da89dbf177360.tar.gz
2008-10-05 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.
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/record.c40
-rw-r--r--gdb/record.h11
-rw-r--r--gdb/remote.c22
-rw-r--r--gdb/reverse.c8
-rw-r--r--gdb/target.c4
-rw-r--r--gdb/target.h12
7 files changed, 61 insertions, 47 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a6f363d1258..825735a18d8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2008-10-05 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.
+
+ * infrun.c (use_displaced_stepping): Disallow displaced
+ stepping if using record/replay target.
+ * infrun.c (handle_inferior_event): Fix typo in comment.
+
2008-10-03 Michael Snyder <msnyder@vmware.com>
* linux-record.c (record_linux_system_call): Cast sizeof
diff --git a/gdb/record.c b/gdb/record.c
index 3620d808f53..51243cf0746 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -47,7 +47,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;
@@ -444,7 +444,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;
@@ -487,7 +487,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)
{
@@ -545,7 +545,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;
}
@@ -556,14 +556,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;
@@ -631,7 +631,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;
}
@@ -640,7 +640,7 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
gdbarch_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. */
@@ -694,7 +694,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;
}
@@ -703,7 +703,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;
@@ -952,26 +952,26 @@ 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");
/* 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;
}
@@ -996,8 +996,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..ea06d65cef8 100644
--- a/gdb/record.h
+++ b/gdb/record.h
@@ -20,9 +20,12 @@
#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_TARGET_SUPPORT_RECORD_WAIT (record_ops.beneath->to_support_record_wait)
+#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 +79,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 38f7b42fa5c..f5434a3a2b3 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7133,29 +7133,29 @@ remote_command (char *args, int from_tty)
/* Reverse execution.
FIXME: 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");
/* FIXME: check target for capability. */
if (dir == EXEC_FORWARD || dir == EXEC_REVERSE)
- return (remote_execdir = dir);
+ return (remote_exec_direction = dir);
else
return EXEC_ERROR;
}
@@ -7208,8 +7208,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 8a529d69c78..68f09cd4748 100644
--- a/gdb/reverse.c
+++ b/gdb/reverse.c
@@ -28,7 +28,7 @@
/* User interface for reverse debugging:
Set exec-direction / show exec-direction commands
- (returns error unles target implements to_set_execdir method). */
+ (returns error unles target implements to_set_exec_direction method). */
static const char exec_forward[] = "forward";
static const char exec_reverse[] = "reverse";
@@ -83,9 +83,9 @@ show_exec_direction_func (struct ui_file *out, int from_tty,
/* User interface:
reverse-step, reverse-next etc.
- (returns error unles target implements to_set_execdir method). */
+ (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);
@@ -108,7 +108,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 c905bdc34be..17473767b06 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -486,8 +486,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 2dfdcd248a4..69a30c455d8 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -536,9 +536,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
@@ -1147,12 +1147,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 *);