diff options
author | Marcin Kościelnicki <koriakin@0x04.net> | 2015-10-30 15:51:59 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-10-30 15:51:59 +0000 |
commit | b80d067ff0a7d2fcca3f8c01abf4b7201e71b8f0 (patch) | |
tree | 2cdd5da8bfe5f9dfb9786463d33972d30b351d17 | |
parent | 933c5a623f247c63b642988a2984f5ce9b558d27 (diff) | |
download | gdb-b80d067ff0a7d2fcca3f8c01abf4b7201e71b8f0.zip gdb-b80d067ff0a7d2fcca3f8c01abf4b7201e71b8f0.tar.gz gdb-b80d067ff0a7d2fcca3f8c01abf4b7201e71b8f0.tar.bz2 |
gdb/linux-record: Support time, waitpid, pipe syscalls
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Add size_time_t.
* amd64-linux-tdep.c (amd64_linux_init_abi): Add size_time_t.
(amd64_x32_linux_init_abi): Add size_time_t.
* arm-linux-tdep.c (arm_linux_init_abi): Add size_time_t.
* i386-linux-tdep.c (i386_linux_init_abi): Add size_time_t.
* linux-record.c (record_linux_system_call): Add time, waitpid, pipe
handling.
* linux-record.h (struct linux_record_tdep): Add size_time_t.
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Add size_time_t.
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/aarch64-linux-tdep.c | 1 | ||||
-rw-r--r-- | gdb/amd64-linux-tdep.c | 2 | ||||
-rw-r--r-- | gdb/arm-linux-tdep.c | 1 | ||||
-rw-r--r-- | gdb/i386-linux-tdep.c | 1 | ||||
-rw-r--r-- | gdb/linux-record.c | 23 | ||||
-rw-r--r-- | gdb/linux-record.h | 1 | ||||
-rw-r--r-- | gdb/ppc-linux-tdep.c | 2 |
8 files changed, 43 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dacfcca..413e12c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 2015-10-30 Marcin Kościelnicki <koriakin@0x04.net> + * aarch64-linux-tdep.c (aarch64_linux_init_abi): Add size_time_t. + * amd64-linux-tdep.c (amd64_linux_init_abi): Add size_time_t. + (amd64_x32_linux_init_abi): Add size_time_t. + * arm-linux-tdep.c (arm_linux_init_abi): Add size_time_t. + * i386-linux-tdep.c (i386_linux_init_abi): Add size_time_t. + * linux-record.c (record_linux_system_call): Add time, waitpid, pipe + handling. + * linux-record.h (struct linux_record_tdep): Add size_time_t. + * ppc-linux-tdep.c (ppc_init_linux_record_tdep): Add size_time_t. + +2015-10-30 Marcin Kościelnicki <koriakin@0x04.net> + * linux-record.c (record_linux_msghdr): Fix msg_namelen handling. 2015-10-30 Marcin Kościelnicki <koriakin@0x04.net> diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 0a3fbb3..a1dcd5b 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -1062,6 +1062,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) aarch64_linux_record_tdep.size_hayes_esp_config = 12; aarch64_linux_record_tdep.size_size_t = 8; aarch64_linux_record_tdep.size_iovec = 16; + aarch64_linux_record_tdep.size_time_t = 8; /* These values are the second argument of system call "sys_ioctl". They are obtained from Linux Kernel source. */ diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index 0b068c3..829d9b7 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1959,6 +1959,7 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) amd64_linux_record_tdep.size_hayes_esp_config = 12; amd64_linux_record_tdep.size_size_t = 8; amd64_linux_record_tdep.size_iovec = 16; + amd64_linux_record_tdep.size_time_t = 8; /* These values are the second argument of system call "sys_fcntl" and "sys_fcntl64". They are obtained from Linux Kernel source. */ @@ -2175,6 +2176,7 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) amd64_x32_linux_record_tdep.size_hayes_esp_config = 12; amd64_x32_linux_record_tdep.size_size_t = 8; amd64_x32_linux_record_tdep.size_iovec = 16; + amd64_x32_linux_record_tdep.size_time_t = 8; /* These values are the second argument of system call "sys_fcntl" and "sys_fcntl64". They are obtained from Linux Kernel source. */ diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index a820e74..73e1271 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -1550,6 +1550,7 @@ arm_linux_init_abi (struct gdbarch_info info, arm_linux_record_tdep.size_hayes_esp_config = 12; arm_linux_record_tdep.size_size_t = 4; arm_linux_record_tdep.size_iovec = 8; + arm_linux_record_tdep.size_time_t = 4; /* These values are the second argument of system call "sys_ioctl". They are obtained from Linux Kernel source. */ diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 8847ad3..86fe09e 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -869,6 +869,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) i386_linux_record_tdep.size_hayes_esp_config = 12; i386_linux_record_tdep.size_size_t = 4; i386_linux_record_tdep.size_iovec = 8; + i386_linux_record_tdep.size_time_t = 4; /* These values are the second argument of system call "sys_ioctl". They are obtained from Linux Kernel source. */ diff --git a/gdb/linux-record.c b/gdb/linux-record.c index 8832ef4..dbd8f14 100644 --- a/gdb/linux-record.c +++ b/gdb/linux-record.c @@ -272,13 +272,31 @@ record_linux_system_call (enum gdb_syscall syscall, case gdb_sys_write: case gdb_sys_open: case gdb_sys_close: + break; + case gdb_sys_waitpid: + regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest); + if (tmpulongest) + if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, + tdep->size_int)) + return -1; + break; + case gdb_sys_creat: case gdb_sys_link: case gdb_sys_unlink: case gdb_sys_execve: case gdb_sys_chdir: + break; + case gdb_sys_time: + regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest); + if (tmpulongest) + if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, + tdep->size_time_t)) + return -1; + break; + case gdb_sys_mknod: case gdb_sys_chmod: case gdb_sys_lchown16: @@ -330,7 +348,12 @@ record_linux_system_call (enum gdb_syscall syscall, case gdb_sys_mkdir: case gdb_sys_rmdir: case gdb_sys_dup: + break; + case gdb_sys_pipe: + regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest); + if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, + tdep->size_int * 2)) break; case gdb_sys_times: diff --git a/gdb/linux-record.h b/gdb/linux-record.h index 9af0bdb..3683edc 100644 --- a/gdb/linux-record.h +++ b/gdb/linux-record.h @@ -89,6 +89,7 @@ struct linux_record_tdep int size_hayes_esp_config; int size_size_t; int size_iovec; + int size_time_t; /* The values of the second argument of system call "sys_ioctl". */ int ioctl_TCGETS; diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index cf71cf3..ab20e78 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -1479,6 +1479,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, record_tdep->size_serial_icounter_struct = 80; record_tdep->size_size_t = 8; record_tdep->size_iovec = 16; + record_tdep->size_time_t = 8; } else if (wordsize == 4) { @@ -1545,6 +1546,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, record_tdep->size_serial_icounter_struct = 80; record_tdep->size_size_t = 4; record_tdep->size_iovec = 8; + record_tdep->size_time_t = 4; } else internal_error (__FILE__, __LINE__, _("unexpected wordsize")); |