aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2008-12-28 20:33:32 +0000
committerMichael Snyder <msnyder@vmware.com>2008-12-28 20:33:32 +0000
commitfc4cb1078578d8586ac55a94ffa0fa0c081575af (patch)
treecdc1676dc21fa2f0e0051622a480abae6bcae607
parent49133c575cfbdfb34fc55d26b323229ced906a39 (diff)
downloadgdb-fc4cb1078578d8586ac55a94ffa0fa0c081575af.zip
gdb-fc4cb1078578d8586ac55a94ffa0fa0c081575af.tar.gz
gdb-fc4cb1078578d8586ac55a94ffa0fa0c081575af.tar.bz2
2008-12-28 Michael Snyder <msnyder@vmware.com>
* Comments, spelling, white space clean-ups.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/gdbarch.h2
-rwxr-xr-xgdb/gdbarch.sh2
-rw-r--r--gdb/i386-linux-tdep.c19
-rw-r--r--gdb/i386-tdep.h5
-rw-r--r--gdb/linux-record.c44
-rw-r--r--gdb/linux-record.h7
-rw-r--r--gdb/record.c59
-rw-r--r--gdb/record.h8
9 files changed, 78 insertions, 72 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9e10ccd..5a38974 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-28 Michael Snyder <msnyder@vmware.com>
+
+ * Comments, spelling, white space clean-ups.
+
2008-12-26 Michael Snyder <msnyder@vmware.com>
* record.h: Don't export record_not_record.
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 19b1b1f..f158e9a 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -789,7 +789,7 @@ extern void set_gdbarch_static_transform_name (struct gdbarch *gdbarch, gdbarch_
extern int gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch);
extern void set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch, int sofun_address_maybe_missing);
-/* For the process record and replay target */
+/* For the process record and replay target. */
extern int gdbarch_process_record_p (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 8a827f4..fd6c92d 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -698,7 +698,7 @@ F:char *:static_transform_name:char *name:name
# Set if the address in N_SO or N_FUN stabs may be zero.
v:int:sofun_address_maybe_missing:::0:0::0
-# For the process record and replay target
+# For the process record and replay target.
M:int:process_record:CORE_ADDR addr:addr
M:void:process_record_dasm:void
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 6b8bf9b..54c0417 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -351,10 +351,11 @@ i386_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1);
}
-/* Parse the arguments of current system call instruction and record the
- values of the registers and memory that will be changed in current system
- call instruction to "record_arch_list". This instruction is "int 0x80" (Linux
+/* Parse the arguments of current system call instruction and record
+ the values of the registers and memory that will be changed into
+ "record_arch_list". This instruction is "int 0x80" (Linux
Kernel2.4) or "sysenter" (Linux Kernel 2.6).
+
Return -1 if something wrong. */
static linux_record_tdep_t linux_record_tdep;
@@ -373,7 +374,7 @@ i386_linux_intx80_sysenter_record (void)
return ret;
}
- /* Record the return of system call. */
+ /* Record the return value of the system call. */
if (record_arch_list_add_reg (I386_EAX_REGNUM))
{
return -1;
@@ -448,8 +449,8 @@ static int i386_linux_sc_reg_offset[] =
0 * 4 /* %gs */
};
-/* These macros are the size of the type that will be used in system
- call. The values of these macros are gotten from Linux Kernel
+/* These macros are the size of the type that will be used in a system
+ call. The values of these macros were obtained from Linux Kernel
source. */
#define I386_RECORD_SIZE__old_kernel_stat 32
#define I386_RECORD_SIZE_tms 16
@@ -519,8 +520,8 @@ static int i386_linux_sc_reg_offset[] =
#define I386_RECORD_SIZE_hayes_esp_config 12
/* These macros are the values of the second argument of system call
- "sys_ioctl". The values of these macros are gotten from Linux Kernel
- source. */
+ "sys_ioctl". The values of these macros were obtained from Linux
+ Kernel source. */
#define I386_RECORD_IOCTL_TCGETS 0x5401
#define I386_RECORD_IOCTL_TCSETS 0x5402
#define I386_RECORD_IOCTL_TCSETSW 0x5403
@@ -614,7 +615,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->sc_reg_offset = i386_linux_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (i386_linux_sc_reg_offset);
- /* Initial the linux_record_tdep */
+ /* Initialize the linux_record_tdep. */
linux_record_tdep.size__old_kernel_stat = I386_RECORD_SIZE__old_kernel_stat;
linux_record_tdep.size_tms = I386_RECORD_SIZE_tms;
linux_record_tdep.size_loff_t = I386_RECORD_SIZE_loff_t;
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index a5ba588..a698e74 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -107,8 +107,9 @@ struct gdbarch_tdep
struct type *i386_mmx_type;
struct type *i386_sse_type;
- int (*i386_intx80_record) (void);
- int (*i386_sysenter_record) (void);
+ /* Process record/replay target. */
+ int (*i386_intx80_record) (void); /* Parse intx80 args. */
+ int (*i386_sysenter_record) (void); /* Parse sysenter args. */
};
/* Floating-point registers. */
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index b5dae50..7436a5d 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -25,16 +25,16 @@
#include <stdint.h>
/* These macros are the values of the first argument of system call
- "sys_ptrace". The values of these macros are gotten from Linux Kernel
- source. */
+ "sys_ptrace". The values of these macros were obtained from Linux
+ Kernel source. */
#define RECORD_PTRACE_PEEKTEXT 1
#define RECORD_PTRACE_PEEKDATA 2
#define RECORD_PTRACE_PEEKUSR 3
/* These macros are the values of the first argument of system call
- "sys_socketcall". The values of these macros are gotten from Linux Kernel
- source. */
+ "sys_socketcall". The values of these macros were obtained from
+ Linux Kernel source. */
#define RECORD_SYS_SOCKET 1
#define RECORD_SYS_BIND 2
@@ -55,8 +55,8 @@
#define RECORD_SYS_RECVMSG 17
/* These macros are the values of the first argument of system call
- "sys_ipc". The values of these macros are gotten from Linux Kernel source.
- */
+ "sys_ipc". The values of these macros were obtained from Linux
+ Kernel source. */
#define RECORD_SEMOP 1
#define RECORD_SEMGET 2
@@ -72,23 +72,25 @@
#define RECORD_SHMCTL 24
/* These macros are the values of the first argument of system call
- "sys_quotactl". The values of these macros are gotten from Linux Kernel
- source. */
+ "sys_quotactl". The values of these macros were obtained from Linux
+ Kernel source. */
#define RECORD_Q_GETFMT 0x800004
#define RECORD_Q_GETINFO 0x800005
#define RECORD_Q_GETQUOTA 0x800007
-#define RECORD_Q_XGETQSTAT (('5'<<8)+(5))
-#define RECORD_Q_XGETQUOTA (('3'<<8)+(3))
-
-/* When the architecture process record get a Linux syscall instruction, it
- will get a Linux syscall number of this architecture and convert it to the
- Linux syscall number "num" which is internal to GDB.
- Most Linux syscalls across architectures in Linux would be similar and
- mostly differ by sizes of types and structures. This sizes are put
- to "tdep".
- Record the values of the registers and memory that will be changed in
- current system call.
+#define RECORD_Q_XGETQSTAT (('5' << 8) + 5)
+#define RECORD_Q_XGETQUOTA (('3' << 8) + 3)
+
+/* When the architecture process record get a Linux syscall
+ instruction, it will get a Linux syscall number of this
+ architecture and convert it to the Linux syscall number "num" which
+ is internal to GDB. Most Linux syscalls across architectures in
+ Linux would be similar and mostly differ by sizes of types and
+ structures. This sizes are put to "tdep".
+
+ Record the values of the registers and memory that will be changed
+ in current system call.
+
Return -1 if something wrong. */
int
@@ -275,7 +277,7 @@ record_linux_system_call (int num, linux_record_tdep_t * tdep)
/* sys_ioctl */
case 54:
- /* XXX there need add a lot of support of other ioctl requests. */
+ /* XXX Need to add a lot of support of other ioctl requests. */
regcache_raw_read (record_regcache, tdep->arg2, (gdb_byte *) & tmpu32);
if (tmpu32 == tdep->ioctl_FIOCLEX || tmpu32 == tdep->ioctl_FIONCLEX
|| tmpu32 == tdep->ioctl_FIONBIO || tmpu32 == tdep->ioctl_FIOASYNC
@@ -1278,7 +1280,7 @@ record_linux_system_call (int num, linux_record_tdep_t * tdep)
{
regcache_raw_read (record_regcache, tdep->arg3,
(gdb_byte *) & tmpu32);
- /*XXX the size of memory is not very clear */
+ /*XXX the size of memory is not very clear. */
if (record_arch_list_add_mem (tmpu32, 10))
{
return (-1);
diff --git a/gdb/linux-record.h b/gdb/linux-record.h
index b0dd048..4d1aba0 100644
--- a/gdb/linux-record.h
+++ b/gdb/linux-record.h
@@ -22,7 +22,7 @@
typedef struct linux_record_tdep_s
{
- /* The size of the type that will be use in system call. */
+ /* The size of the type that will be used in a system call. */
int size__old_kernel_stat;
int size_tms;
int size_loff_t;
@@ -91,7 +91,7 @@ typedef struct linux_record_tdep_s
int size_serial_icounter_struct;
int size_hayes_esp_config;
- /* the values of the second argument of system call "sys_ioctl". */
+ /* The values of the second argument of system call "sys_ioctl". */
int ioctl_TCGETS;
int ioctl_TCSETS;
int ioctl_TCSETSW;
@@ -158,7 +158,8 @@ typedef struct linux_record_tdep_s
int ioctl_TIOCSHAYESESP;
int ioctl_FIOQSIZE;
- /* The number of the registers that use to be the arguments of system call. */
+ /* The number of the registers that are used as the arguments of
+ a system call. */
int arg1;
int arg2;
int arg3;
diff --git a/gdb/record.c b/gdb/record.c
index 71900b0..5212f06 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -292,13 +292,13 @@ record_check_insn_num (int set_terminal)
gdb_assert (record_insn_num <= record_insn_max_num);
if (record_insn_num == record_insn_max_num)
{
- /* Ask user what to do */
+ /* Ask user what to do. */
if (record_stop_at_limit)
{
int q;
if (set_terminal)
target_terminal_ours ();
- q = yquery (_("Do you want to auto delete previous execute log entries when record/replay buffer becomes full (record-stop-at-limit)?"));
+ q = yquery (_("Do you want to auto delete previous execution log entries when record/replay buffer becomes full (record-stop-at-limit)?"));
if (set_terminal)
target_terminal_inferior ();
if (q)
@@ -365,7 +365,7 @@ record_message (struct gdbarch *gdbarch)
}
/* Things to clean up if we error or QUIT out of function that set
- in_record_wait (ie. command that called 'proceed'). */
+ in_record_wait (ie. command that caused target_wait to be called). */
static void
in_record_wait_cleanups (void *ignore)
{
@@ -406,7 +406,7 @@ record_open (char *name, int from_tty)
error (_("Process record: the current architecture doesn't support record function."));
}
- /* Check if record target is already running */
+ /* Check if record target is already running. */
if (RECORD_IS_USED)
{
if (!nquery
@@ -582,9 +582,9 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
is_breakpoint = 0;
breakpoint:
- /* Add gdbarch_decr_pc_after_break to pc because pc will
- be break at address add gdbarch_decr_pc_after_break
- when inferior non-step execute. */
+ /* Add gdbarch_decr_pc_after_break to pc because gdb will
+ expect the pc to be at address plus decr_pc_after_break
+ when the inferior stops at a breakpoint. */
if (is_breakpoint)
{
CORE_ADDR decr_pc_after_break =
@@ -653,13 +653,13 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
{
perror_with_name (_("Process record: sigaction failed"));
}
- /* If GDB is in terminal_inferior, it will not get the signal.
- And in GDB replay mode, GDB doesn't need to in terminal_inferior
- because inferior will not executed.
+ /* If GDB is in terminal_inferior mode, it will not get the signal.
+ And in GDB replay mode, GDB doesn't need to be in terminal_inferior
+ mode, because inferior will not executed.
Then set it to terminal_ours to make GDB get the signal. */
target_terminal_ours ();
- /* In EXEC_FORWARD mode, record_list point to the tail of prev
+ /* In EXEC_FORWARD mode, record_list points to the tail of prev
instruction. */
if (execution_direction == EXEC_FORWARD && record_list->next)
{
@@ -685,7 +685,7 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
break;
}
- /* set ptid, register and memory according to record_list */
+ /* Set ptid, register and memory according to record_list. */
if (record_list->type == record_reg)
{
/* reg */
@@ -697,14 +697,10 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
paddr_nz ((CORE_ADDR)record_list),
record_list->u.reg.num);
}
- /* MVS: This step fetches the reg from the target. */
regcache_cooked_read (regcache, record_list->u.reg.num, reg);
- /* MVS: This step writes the execution log reg to the target. */
regcache_cooked_write (regcache, record_list->u.reg.num,
record_list->u.reg.val);
- /* MVS: And this step saves the target reg in the exec log. */
memcpy (record_list->u.reg.val, reg, MAX_REGISTER_SIZE);
- /* MVS: Net result -- swap. */
}
else if (record_list->type == record_mem)
{
@@ -719,7 +715,6 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
record_list->u.mem.len);
}
- /* MVS: This step fetches 'mem' from the target. */
if (target_read_memory
(record_list->u.mem.addr, mem, record_list->u.mem.len))
{
@@ -728,7 +723,6 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
record_list->u.mem.len);
}
- /* MVS: This step writes from the exec log to the target. */
if (target_write_memory
(record_list->u.mem.addr, record_list->u.mem.val,
record_list->u.mem.len))
@@ -738,9 +732,7 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
paddr_nz (record_list->u.mem.addr),
record_list->u.mem.len);
}
- /* MVS: And this step writes target 'mem' to the exec log. */
memcpy (record_list->u.mem.val, mem, record_list->u.mem.len);
- /* MVS: Net result: swap. */
}
else
{
@@ -778,7 +770,8 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
{
if (record_debug > 1)
{
- fprintf_unfiltered (gdb_stdlog, "Process record: step.\n");
+ fprintf_unfiltered (gdb_stdlog,
+ "Process record: step.\n");
}
continue_flag = 0;
}
@@ -882,7 +875,7 @@ record_mourn_inferior (struct target_ops *ops)
target_mourn_inferior ();
}
-/* Close process record target before kill the inferior process. */
+/* Close process record target before killing the inferior process. */
static void
record_kill (void)
{
@@ -955,25 +948,25 @@ record_store_registers (struct regcache *regcache, int regno)
int n;
struct cleanup *old_cleanups;
- /* Let user choice if he want to write register or not. */
+ /* Let user choose if he wants to write register or not. */
if (regno < 0)
{
n =
nquery (_
- ("Becuse GDB is in replay mode, changing the value of a register will make the execute log unusable from this point onward. Change all register?"));
+ ("Because GDB is in replay mode, changing the value of a register will make the execution log unusable from this point onward. Change all registers?"));
}
else
{
n =
nquery (_
- ("Becuse GDB is in replay mode, changing the value of a register will make the execute log unusable from this point onward. Change register %s?"),
+ ("Because GDB is in replay mode, changing the value of a register will make the execution log unusable from this point onward. Change register %s?"),
gdbarch_register_name (get_regcache_arch (regcache),
regno));
}
if (!n)
{
- /* Invalidate the value of regcache that set in function
+ /* Invalidate the value of regcache that was set in function
"regcache_raw_write". */
if (regno < 0)
{
@@ -1017,8 +1010,8 @@ record_xfer_partial (struct target_ops *ops, enum target_object object,
{
if (RECORD_IS_REPLAY)
{
- /* Let user choice if he want to write memory or not. */
- if (!nquery (_("Because GDB is in replay mode, writing to memory will make the execute log unusable from this point onward. Write memory at address 0x%s?"),
+ /* Let user choose if he wants to write memory or not. */
+ if (!nquery (_("Because GDB is in replay mode, writing to memory will make the execution log unusable from this point onward. Write memory at address 0x%s?"),
paddr_nz (offset)))
{
return -1;
@@ -1075,8 +1068,9 @@ record_xfer_partial (struct target_ops *ops, enum target_object object,
/* record_insert_breakpoint
record_remove_breakpoint
- Behavior is conditional on RECORD_IS_REPLAY.
- We will not actually insert or remove breakpoints when replaying. */
+ Behavior is conditional on RECORD_IS_USED.
+ We will not actually insert or remove breakpoints when replaying,
+ nor when recording. */
static int
record_insert_breakpoint (struct bp_target_info *bp_tgt)
@@ -1121,7 +1115,7 @@ init_record_ops (void)
record_ops.to_detach = record_detach;
record_ops.to_mourn_inferior = record_mourn_inferior;
record_ops.to_kill = record_kill;
- record_ops.to_create_inferior = find_default_create_inferior; /* Make record suppport command "run". */
+ record_ops.to_create_inferior = find_default_create_inferior; /* Make record support command "run". */
record_ops.to_store_registers = record_store_registers;
record_ops.to_xfer_partial = record_xfer_partial;
record_ops.to_insert_breakpoint = record_insert_breakpoint;
@@ -1135,7 +1129,8 @@ static void
show_record_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("Debugging of process record target is %s.\n"), value);
+ fprintf_filtered (file, _("Debugging of process record target is %s.\n"),
+ value);
}
/* cmd_record_start -- alias for "target record". */
diff --git a/gdb/record.h b/gdb/record.h
index 6cb3480..fa4094d 100644
--- a/gdb/record.h
+++ b/gdb/record.h
@@ -46,10 +46,12 @@ enum record_type
};
/* This is the core struct of record function.
+
An entity of record_t is a record of the value change of a register
- ("record_reg") or a part of memory ("record_mem"). And Each instruction must
- has a record_t ("record_end") that point out this is the last record_t of
- this instruction.
+ ("record_reg") or a part of memory ("record_mem"). And each
+ instruction must has a record_t ("record_end") that points out this
+ is the last record_t of this instruction.
+
Each record_t is linked to "record_list" by "prev" and "next".
*/
typedef struct record_s