This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
This patch add code make process record and replay can record I386 Linux system call execute log. 2008-11-16 Hui Zhu <teawater@gmail.com> I386 Linux process record and replay support. * i386-linux-tdep.c (linux_record_tdep): New variable. This struct has the argument for the function "record_linux_system_call". (i386_linux_intx80_sysenter_record): New function. Parse the system call instruction and call function "record_linux_system_call" record execute log. (i386_linux_init_abi): Initialize "linux_record_tdep". Set "i386_linux_intx80_sysenter_record" to "i386_intx80_record" and "i386_sysenter_record". i386-linux-tdep.c | 318 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 318 insertions(+) Following is the diff with the previous patch: @@ -11,7 +11,7 @@ /* Supported register note sections. */ static struct core_regset_section i386_linux_regset_sections[] = { -@@ -346,6 +350,37 @@ i386_linux_write_pc (struct regcache *re +@@ -346,6 +350,37 @@ restarted. */ regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1); } @@ -20,7 +20,7 @@ + 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 + Kernel2.4) or "sysenter" (Linux Kernel 2.6). -+ Return -1 if something wrong. */ ++ Return -1 if something wrong. */ + +static linux_record_tdep_t linux_record_tdep; + @@ -38,7 +38,7 @@ + return ret; + } + -+ /* Record the return of system call. */ ++ /* Record the return of system call. */ + if (record_arch_list_add_reg (I386_EAX_REGNUM)) + { + return -1; @@ -49,12 +49,13 @@ /* The register sets used in GNU/Linux ELF core-dumps are identical to -@@ -413,6 +448,144 @@ static int i386_linux_sc_reg_offset[] = +@@ -413,6 +448,145 @@ 0 * 4 /* %gs */ }; -+/* These macros are the size of the type that will be use in system call. The values of -+ these macros are gotten from Linux Kernel source. */ ++/* 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 ++ source. */ +#define I386_RECORD_SIZE__old_kernel_stat 32 +#define I386_RECORD_SIZE_tms 16 +#define I386_RECORD_SIZE_loff_t 8 @@ -124,7 +125,7 @@ + +/* 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. */ ++ source. */ +#define I386_RECORD_IOCTL_TCGETS 0x5401 +#define I386_RECORD_IOCTL_TCSETS 0x5402 +#define I386_RECORD_IOCTL_TCSETSW 0x5403 @@ -194,7 +195,7 @@ static void i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { -@@ -440,6 +613,150 @@ i386_linux_init_abi (struct gdbarch_info +@@ -440,6 +614,150 @@ tdep->sc_reg_offset = i386_linux_sc_reg_offset; tdep->sc_num_regs = ARRAY_SIZE (i386_linux_sc_reg_offset);
Attachment:
9-i386-linux-tdep.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |