* gdb/linux-record fixes
@ 2015-10-17 21:41 Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 08/11] gdb/linux-record: Fix newfstatat handling Marcin Kościelnicki
` (11 more replies)
0 siblings, 12 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches
When working on process record and replay support for s390-linux,
I found quite a few problems in syscall handling. I fixed the most
important of these in this patchset. Please review.
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 11/11] gdb/linux-record: Fix struct sizes for x32 + aarch64.
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (6 preceding siblings ...)
2015-10-17 21:41 ` [PATCH 07/11] gdb/linux-record: Fix [sg]etgroups16 syscall Marcin Kościelnicki
@ 2015-10-17 21:41 ` Marcin Kościelnicki
2015-10-17 21:49 ` [PATCH 02/11] gdb/linux-record: Fix size_[ug]id values Marcin Kościelnicki
` (3 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
While x32 syscall interface is mostly shared with x86_64, some syscalls
are truly 32-bit. Correct sizes accordingly. Also, size of struct termios
is 36 bytes in syscall interface, 60 in glibc. Correct that mistake (also
made on aarch64).
---
gdb/aarch64-linux-tdep.c | 2 +-
gdb/amd64-linux-tdep.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index a1dcd5b..aa35196 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1053,7 +1053,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_epoll_event = 12;
aarch64_linux_record_tdep.size_itimerspec = 32;
aarch64_linux_record_tdep.size_mq_attr = 64;
- aarch64_linux_record_tdep.size_termios = 60;
+ aarch64_linux_record_tdep.size_termios = 36;
aarch64_linux_record_tdep.size_termios2 = 44;
aarch64_linux_record_tdep.size_pid_t = 4;
aarch64_linux_record_tdep.size_winsize = 8;
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 829d9b7..ee21635 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1950,7 +1950,7 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_linux_record_tdep.size_epoll_event = 12;
amd64_linux_record_tdep.size_itimerspec = 32;
amd64_linux_record_tdep.size_mq_attr = 64;
- amd64_linux_record_tdep.size_termios = 60;
+ amd64_linux_record_tdep.size_termios = 36;
amd64_linux_record_tdep.size_termios2 = 44;
amd64_linux_record_tdep.size_pid_t = 4;
amd64_linux_record_tdep.size_winsize = 8;
@@ -2133,7 +2133,7 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
= gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_x32_linux_record_tdep.size_ulong
= gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
- amd64_x32_linux_record_tdep.size_msghdr = 56;
+ amd64_x32_linux_record_tdep.size_msghdr = 28;
amd64_x32_linux_record_tdep.size_itimerval = 32;
amd64_x32_linux_record_tdep.size_stat = 144;
amd64_x32_linux_record_tdep.size_old_utsname = 325;
@@ -2154,7 +2154,7 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_sigset_t = 8;
amd64_x32_linux_record_tdep.size_siginfo_t = 128;
amd64_x32_linux_record_tdep.size_cap_user_data_t = 8;
- amd64_x32_linux_record_tdep.size_stack_t = 24;
+ amd64_x32_linux_record_tdep.size_stack_t = 12;
amd64_x32_linux_record_tdep.size_off_t = 8;
amd64_x32_linux_record_tdep.size_stat64 = 144;
amd64_x32_linux_record_tdep.size_gid_t = 4;
@@ -2167,15 +2167,15 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_epoll_event = 12;
amd64_x32_linux_record_tdep.size_itimerspec = 32;
amd64_x32_linux_record_tdep.size_mq_attr = 64;
- amd64_x32_linux_record_tdep.size_termios = 60;
+ amd64_x32_linux_record_tdep.size_termios = 36;
amd64_x32_linux_record_tdep.size_termios2 = 44;
amd64_x32_linux_record_tdep.size_pid_t = 4;
amd64_x32_linux_record_tdep.size_winsize = 8;
amd64_x32_linux_record_tdep.size_serial_struct = 72;
amd64_x32_linux_record_tdep.size_serial_icounter_struct = 80;
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_size_t = 4;
+ amd64_x32_linux_record_tdep.size_iovec = 8;
amd64_x32_linux_record_tdep.size_time_t = 8;
/* These values are the second argument of system call "sys_fcntl"
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 06/11] gdb/linux-record: Support time, waitpid, pipe syscalls
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 08/11] gdb/linux-record: Fix newfstatat handling Marcin Kościelnicki
@ 2015-10-17 21:41 ` Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 03/11] gdb/linux-record: Fix sizes of sigaction and sigset_t Marcin Kościelnicki
` (9 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
---
gdb/aarch64-linux-tdep.c | 1 +
gdb/amd64-linux-tdep.c | 2 ++
gdb/arm-linux-tdep.c | 1 +
gdb/i386-linux-tdep.c | 1 +
gdb/linux-record.c | 23 +++++++++++++++++++++++
gdb/linux-record.h | 1 +
gdb/ppc-linux-tdep.c | 2 ++
7 files changed, 31 insertions(+)
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"));
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 07/11] gdb/linux-record: Fix [sg]etgroups16 syscall
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (5 preceding siblings ...)
2015-10-17 21:41 ` [PATCH 01/11] gdb/linux-record: Remove size_siginfo Marcin Kościelnicki
@ 2015-10-17 21:41 ` Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 11/11] gdb/linux-record: Fix struct sizes for x32 + aarch64 Marcin Kościelnicki
` (4 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
Memory size for getgroups16 needs to be multiplied by entry count, and only
needs recording if the pointer is non-NULL. setgroups16, on the other hand,
doesn't write to user memory and doesn't need special handling at all.
---
gdb/linux-record.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index dbd8f14..25cbda1 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -628,16 +628,19 @@ record_linux_system_call (enum gdb_syscall syscall,
case gdb_sys_getgroups16:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
- if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_old_gid_t))
- return -1;
+ if (tmpulongest)
+ {
+ ULONGEST gidsetsize;
+
+ regcache_raw_read_unsigned (regcache, tdep->arg1,
+ &gidsetsize);
+ tmpint = tdep->size_old_gid_t * (int) gidsetsize;
+ if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, tmpint))
+ return -1;
+ }
break;
case gdb_sys_setgroups16:
- regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
- if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_old_gid_t))
- return -1;
break;
case gdb_old_select:
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 08/11] gdb/linux-record: Fix newfstatat handling
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
@ 2015-10-17 21:41 ` Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 06/11] gdb/linux-record: Support time, waitpid, pipe syscalls Marcin Kościelnicki
` (10 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
The struct stat pointer is in the third argument, not the second.
---
gdb/linux-record.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 25cbda1..9f38c0b 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -1112,13 +1112,19 @@ Do you want to stop the program?"),
case gdb_sys_newstat:
case gdb_sys_newlstat:
case gdb_sys_newfstat:
- case gdb_sys_newfstatat:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
tdep->size_stat))
return -1;
break;
+ case gdb_sys_newfstatat:
+ regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
+ if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
+ tdep->size_stat))
+ return -1;
+ break;
+
case gdb_sys_uname:
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 09/11] gdb/linux-record: Fix old_select syscall handling
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (2 preceding siblings ...)
2015-10-17 21:41 ` [PATCH 03/11] gdb/linux-record: Fix sizes of sigaction and sigset_t Marcin Kościelnicki
@ 2015-10-17 21:41 ` Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 04/11] gdb/linux-record: Fix readdir and getdents handling Marcin Kościelnicki
` (7 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
We have to use extract_unsigned_integer to read paramaters structure - target
pointers can have different endianness and size.
---
gdb/linux-record.c | 45 ++++++++++++++++++++++++++-------------------
1 file changed, 26 insertions(+), 19 deletions(-)
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 9f38c0b..091ac8a 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -645,38 +645,45 @@ record_linux_system_call (enum gdb_syscall syscall,
case gdb_old_select:
{
- struct sel_arg_struct
- {
- CORE_ADDR n;
- CORE_ADDR inp;
- CORE_ADDR outp;
- CORE_ADDR exp;
- CORE_ADDR tvp;
- } sel;
+ unsigned long sz_sel_arg = tdep->size_long + tdep->size_pointer * 4;
+ gdb_byte *a = (gdb_byte *) alloca (sz_sel_arg);
+ CORE_ADDR inp, outp, exp, tvp;
regcache_raw_read_unsigned (regcache, tdep->arg1,
&tmpulongest);
if (tmpulongest)
{
- if (target_read_memory (tmpulongest, (gdb_byte *) &sel,
- sizeof(sel)))
+ if (target_read_memory (tmpulongest, a, sz_sel_arg))
{
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading memory "
"at addr = 0x%s len = %lu.\n",
OUTPUT_REG (tmpulongest, tdep->arg1),
- (unsigned long) sizeof (sel));
+ sz_sel_arg);
return -1;
}
- if (record_full_arch_list_add_mem (sel.inp, tdep->size_fd_set))
- return -1;
- if (record_full_arch_list_add_mem (sel.outp, tdep->size_fd_set))
- return -1;
- if (record_full_arch_list_add_mem (sel.exp, tdep->size_fd_set))
- return -1;
- if (record_full_arch_list_add_mem (sel.tvp, tdep->size_timeval))
- return -1;
+ /* Skip n. */
+ a += tdep->size_long;
+ inp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
+ a += tdep->size_pointer;
+ outp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
+ a += tdep->size_pointer;
+ exp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
+ a += tdep->size_pointer;
+ tvp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
+ if (inp)
+ if (record_full_arch_list_add_mem (inp, tdep->size_fd_set))
+ return -1;
+ if (outp)
+ if (record_full_arch_list_add_mem (outp, tdep->size_fd_set))
+ return -1;
+ if (exp)
+ if (record_full_arch_list_add_mem (exp, tdep->size_fd_set))
+ return -1;
+ if (tvp)
+ if (record_full_arch_list_add_mem (tvp, tdep->size_timeval))
+ return -1;
}
}
break;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 01/11] gdb/linux-record: Remove size_siginfo
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (4 preceding siblings ...)
2015-10-17 21:41 ` [PATCH 04/11] gdb/linux-record: Fix readdir and getdents handling Marcin Kościelnicki
@ 2015-10-17 21:41 ` Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 07/11] gdb/linux-record: Fix [sg]etgroups16 syscall Marcin Kościelnicki
` (5 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
It's a duplicate of size_siginfo_t.
---
gdb/aarch64-linux-tdep.c | 1 -
gdb/amd64-linux-tdep.c | 2 --
gdb/arm-linux-tdep.c | 1 -
gdb/i386-linux-tdep.c | 1 -
gdb/linux-record.c | 2 +-
gdb/linux-record.h | 1 -
gdb/ppc-linux-tdep.c | 2 --
7 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 2204c92..4169200 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1054,7 +1054,6 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_epoll_event = 12;
aarch64_linux_record_tdep.size_itimerspec = 32;
aarch64_linux_record_tdep.size_mq_attr = 64;
- aarch64_linux_record_tdep.size_siginfo = 128;
aarch64_linux_record_tdep.size_termios = 60;
aarch64_linux_record_tdep.size_termios2 = 44;
aarch64_linux_record_tdep.size_pid_t = 4;
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 021dca6..59c318d 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1950,7 +1950,6 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_linux_record_tdep.size_epoll_event = 12;
amd64_linux_record_tdep.size_itimerspec = 32;
amd64_linux_record_tdep.size_mq_attr = 64;
- amd64_linux_record_tdep.size_siginfo = 128;
amd64_linux_record_tdep.size_termios = 60;
amd64_linux_record_tdep.size_termios2 = 44;
amd64_linux_record_tdep.size_pid_t = 4;
@@ -2167,7 +2166,6 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_epoll_event = 12;
amd64_x32_linux_record_tdep.size_itimerspec = 32;
amd64_x32_linux_record_tdep.size_mq_attr = 64;
- amd64_x32_linux_record_tdep.size_siginfo = 128;
amd64_x32_linux_record_tdep.size_termios = 60;
amd64_x32_linux_record_tdep.size_termios2 = 44;
amd64_x32_linux_record_tdep.size_pid_t = 4;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index dc0a8a9..4a100c8 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1542,7 +1542,6 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_itimerspec
= arm_linux_record_tdep.size_timespec * 2;
arm_linux_record_tdep.size_mq_attr = 32;
- arm_linux_record_tdep.size_siginfo = 128;
arm_linux_record_tdep.size_termios = 36;
arm_linux_record_tdep.size_termios2 = 44;
arm_linux_record_tdep.size_pid_t = 4;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index d02c527..8dce146 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -861,7 +861,6 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_itimerspec
= i386_linux_record_tdep.size_timespec * 2;
i386_linux_record_tdep.size_mq_attr = 32;
- i386_linux_record_tdep.size_siginfo = 128;
i386_linux_record_tdep.size_termios = 36;
i386_linux_record_tdep.size_termios2 = 44;
i386_linux_record_tdep.size_pid_t = 4;
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 5873365..d1e02f4 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -2092,7 +2092,7 @@ Do you want to stop the program?"),
case gdb_sys_waitid:
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_siginfo))
+ tdep->size_siginfo_t))
return -1;
regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
diff --git a/gdb/linux-record.h b/gdb/linux-record.h
index 6d29985..839bd31 100644
--- a/gdb/linux-record.h
+++ b/gdb/linux-record.h
@@ -81,7 +81,6 @@ struct linux_record_tdep
int size_epoll_event;
int size_itimerspec;
int size_mq_attr;
- int size_siginfo;
int size_termios;
int size_termios2;
int size_pid_t;
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 460c503..79d115e 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1473,7 +1473,6 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_epoll_event = 16;
record_tdep->size_itimerspec = 32;
record_tdep->size_mq_attr = 64;
- record_tdep->size_siginfo = 128;
record_tdep->size_termios = 44;
record_tdep->size_pid_t = 4;
record_tdep->size_winsize = 8;
@@ -1541,7 +1540,6 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_epoll_event = 16;
record_tdep->size_itimerspec = 16;
record_tdep->size_mq_attr = 32;
- record_tdep->size_siginfo = 128;
record_tdep->size_termios = 44;
record_tdep->size_pid_t = 4;
record_tdep->size_winsize = 8;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 04/11] gdb/linux-record: Fix readdir and getdents handling
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (3 preceding siblings ...)
2015-10-17 21:41 ` [PATCH 09/11] gdb/linux-record: Fix old_select syscall handling Marcin Kościelnicki
@ 2015-10-17 21:41 ` Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 01/11] gdb/linux-record: Remove size_siginfo Marcin Kościelnicki
` (6 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
getdents buffer size is given in bytes, not dirent entries (which have
variable size anyway). We don't need size_dirent and size_dirent64 for
this reason.
readdir, on the other hand, needs size of old_linux_dirent, which is
a somewhat different structure. Accordingly, rename size_dirent
to size_old_dirent.
---
gdb/aarch64-linux-tdep.c | 3 +--
gdb/amd64-linux-tdep.c | 8 ++++----
gdb/arm-linux-tdep.c | 3 +--
gdb/i386-linux-tdep.c | 3 +--
gdb/linux-record.c | 19 +++----------------
gdb/linux-record.h | 3 +--
gdb/ppc-linux-tdep.c | 6 ++----
7 files changed, 13 insertions(+), 32 deletions(-)
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 57cb973..0a3fbb3 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1009,8 +1009,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_old_gid_t = 2;
aarch64_linux_record_tdep.size_old_uid_t = 2;
aarch64_linux_record_tdep.size_fd_set = 128;
- aarch64_linux_record_tdep.size_dirent = 280;
- aarch64_linux_record_tdep.size_dirent64 = 280;
+ aarch64_linux_record_tdep.size_old_dirent = 280;
aarch64_linux_record_tdep.size_statfs = 120;
aarch64_linux_record_tdep.size_statfs64 = 120;
aarch64_linux_record_tdep.size_sockaddr = 16;
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 3bca3c8..0b068c3 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1905,8 +1905,8 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
but sys_getresuid. */
amd64_linux_record_tdep.size_old_uid_t = 2;
amd64_linux_record_tdep.size_fd_set = 128;
- amd64_linux_record_tdep.size_dirent = 280;
- amd64_linux_record_tdep.size_dirent64 = 280;
+ /* ADM64 doesn't need this size because it doesn't have sys_readdir. */
+ amd64_linux_record_tdep.size_old_dirent = 280;
amd64_linux_record_tdep.size_statfs = 120;
amd64_linux_record_tdep.size_statfs64 = 120;
amd64_linux_record_tdep.size_sockaddr = 16;
@@ -2121,8 +2121,8 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
but sys_getresuid. */
amd64_x32_linux_record_tdep.size_old_uid_t = 2;
amd64_x32_linux_record_tdep.size_fd_set = 128;
- amd64_x32_linux_record_tdep.size_dirent = 280;
- amd64_x32_linux_record_tdep.size_dirent64 = 280;
+ /* ADM64 doesn't need this size because it doesn't have sys_readdir. */
+ amd64_x32_linux_record_tdep.size_old_dirent = 268;
amd64_x32_linux_record_tdep.size_statfs = 120;
amd64_x32_linux_record_tdep.size_statfs64 = 120;
amd64_x32_linux_record_tdep.size_sockaddr = 16;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 88d818d..a820e74 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1496,8 +1496,7 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_old_gid_t = 2;
arm_linux_record_tdep.size_old_uid_t = 2;
arm_linux_record_tdep.size_fd_set = 128;
- arm_linux_record_tdep.size_dirent = 268;
- arm_linux_record_tdep.size_dirent64 = 276;
+ arm_linux_record_tdep.size_old_dirent = 268;
arm_linux_record_tdep.size_statfs = 64;
arm_linux_record_tdep.size_statfs64 = 84;
arm_linux_record_tdep.size_sockaddr = 16;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 0bf2cdc..8847ad3 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -815,8 +815,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_old_gid_t = 2;
i386_linux_record_tdep.size_old_uid_t = 2;
i386_linux_record_tdep.size_fd_set = 128;
- i386_linux_record_tdep.size_dirent = 268;
- i386_linux_record_tdep.size_dirent64 = 276;
+ i386_linux_record_tdep.size_old_dirent = 268;
i386_linux_record_tdep.size_statfs = 64;
i386_linux_record_tdep.size_statfs64 = 84;
i386_linux_record_tdep.size_sockaddr = 16;
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index d1e02f4..e950e8d 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -689,7 +689,7 @@ record_linux_system_call (enum gdb_syscall syscall,
case gdb_old_readdir:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_dirent))
+ tdep->size_old_dirent))
return -1;
break;
@@ -1344,14 +1344,14 @@ Do you want to stop the program?"),
break;
case gdb_sys_getdents:
+ case gdb_sys_getdents64:
{
ULONGEST count;
regcache_raw_read_unsigned (regcache, tdep->arg2,
&tmpulongest);
regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
- if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_dirent * count))
+ if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, count))
return -1;
}
break;
@@ -1745,19 +1745,6 @@ Do you want to stop the program?"),
case gdb_sys_madvise:
break;
- case gdb_sys_getdents64:
- {
- ULONGEST count;
-
- regcache_raw_read_unsigned (regcache, tdep->arg2,
- &tmpulongest);
- regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
- if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_dirent64 * count))
- return -1;
- }
- break;
-
case gdb_sys_fcntl64:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
if (tmpulongest == tdep->fcntl_F_GETLK64)
diff --git a/gdb/linux-record.h b/gdb/linux-record.h
index 839bd31..9af0bdb 100644
--- a/gdb/linux-record.h
+++ b/gdb/linux-record.h
@@ -39,8 +39,7 @@ struct linux_record_tdep
int size_old_gid_t;
int size_old_uid_t;
int size_fd_set;
- int size_dirent;
- int size_dirent64;
+ int size_old_dirent;
int size_statfs;
int size_statfs64;
int size_sockaddr;
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 896f410..cf71cf3 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1432,8 +1432,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_old_gid_t = 4;
record_tdep->size_old_uid_t = 4;
record_tdep->size_fd_set = 128;
- record_tdep->size_dirent = 280;
- record_tdep->size_dirent64 = 280;
+ record_tdep->size_old_dirent = 280;
record_tdep->size_statfs = 120;
record_tdep->size_statfs64 = 120;
record_tdep->size_sockaddr = 16;
@@ -1499,8 +1498,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_old_gid_t = 4;
record_tdep->size_old_uid_t = 4;
record_tdep->size_fd_set = 128;
- record_tdep->size_dirent = 268;
- record_tdep->size_dirent64 = 280;
+ record_tdep->size_old_dirent = 268;
record_tdep->size_statfs = 64;
record_tdep->size_statfs64 = 88;
record_tdep->size_sockaddr = 16;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 03/11] gdb/linux-record: Fix sizes of sigaction and sigset_t
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 08/11] gdb/linux-record: Fix newfstatat handling Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 06/11] gdb/linux-record: Support time, waitpid, pipe syscalls Marcin Kościelnicki
@ 2015-10-17 21:41 ` Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 09/11] gdb/linux-record: Fix old_select syscall handling Marcin Kościelnicki
` (8 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:41 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
The values were mistakenly set to size of glibc's sigset_t (128 bytes)
and sigaction (140 or 152 bytes) instead of the kernel ones. The kernel
has 4 or 8 byte old_sigset_t, 8 byte sigset_t, 16 or 32 byte old_sigaction,
20 or 32 byte sigaction.
---
gdb/aarch64-linux-tdep.c | 8 ++++----
gdb/amd64-linux-tdep.c | 16 ++++++++--------
gdb/arm-linux-tdep.c | 6 +++---
gdb/i386-linux-tdep.c | 6 +++---
gdb/ppc-linux-tdep.c | 16 ++++++++--------
5 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 4169200..57cb973 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1000,8 +1000,8 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_flock = 32;
aarch64_linux_record_tdep.size_oldold_utsname = 45;
aarch64_linux_record_tdep.size_ustat = 32;
- aarch64_linux_record_tdep.size_old_sigaction = 152;
- aarch64_linux_record_tdep.size_old_sigset_t = 128;
+ aarch64_linux_record_tdep.size_old_sigaction = 32;
+ aarch64_linux_record_tdep.size_old_sigset_t = 8;
aarch64_linux_record_tdep.size_rlimit = 16;
aarch64_linux_record_tdep.size_rusage = 144;
aarch64_linux_record_tdep.size_timeval = 16;
@@ -1037,8 +1037,8 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_NFS_FHSIZE = 32;
aarch64_linux_record_tdep.size_knfsd_fh = 132;
aarch64_linux_record_tdep.size_TASK_COMM_LEN = 16;
- aarch64_linux_record_tdep.size_sigaction = 152;
- aarch64_linux_record_tdep.size_sigset_t = 128;
+ aarch64_linux_record_tdep.size_sigaction = 32;
+ aarch64_linux_record_tdep.size_sigset_t = 8;
aarch64_linux_record_tdep.size_siginfo_t = 128;
aarch64_linux_record_tdep.size_cap_user_data_t = 8;
aarch64_linux_record_tdep.size_stack_t = 24;
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 59c318d..3bca3c8 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1890,10 +1890,10 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_linux_record_tdep.size_ustat = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigaction
but sys_rt_sigaction. */
- amd64_linux_record_tdep.size_old_sigaction = 152;
+ amd64_linux_record_tdep.size_old_sigaction = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigpending
but sys_rt_sigpending. */
- amd64_linux_record_tdep.size_old_sigset_t = 128;
+ amd64_linux_record_tdep.size_old_sigset_t = 8;
amd64_linux_record_tdep.size_rlimit = 16;
amd64_linux_record_tdep.size_rusage = 144;
amd64_linux_record_tdep.size_timeval = 16;
@@ -1933,8 +1933,8 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_linux_record_tdep.size_NFS_FHSIZE = 32;
amd64_linux_record_tdep.size_knfsd_fh = 132;
amd64_linux_record_tdep.size_TASK_COMM_LEN = 16;
- amd64_linux_record_tdep.size_sigaction = 152;
- amd64_linux_record_tdep.size_sigset_t = 128;
+ amd64_linux_record_tdep.size_sigaction = 32;
+ amd64_linux_record_tdep.size_sigset_t = 8;
amd64_linux_record_tdep.size_siginfo_t = 128;
amd64_linux_record_tdep.size_cap_user_data_t = 8;
amd64_linux_record_tdep.size_stack_t = 24;
@@ -2106,10 +2106,10 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_ustat = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigaction
but sys_rt_sigaction. */
- amd64_x32_linux_record_tdep.size_old_sigaction = 152;
+ amd64_x32_linux_record_tdep.size_old_sigaction = 16;
/* ADM64 doesn't need this size because it doesn't have sys_sigpending
but sys_rt_sigpending. */
- amd64_x32_linux_record_tdep.size_old_sigset_t = 128;
+ amd64_x32_linux_record_tdep.size_old_sigset_t = 4;
amd64_x32_linux_record_tdep.size_rlimit = 16;
amd64_x32_linux_record_tdep.size_rusage = 144;
amd64_x32_linux_record_tdep.size_timeval = 16;
@@ -2149,8 +2149,8 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_NFS_FHSIZE = 32;
amd64_x32_linux_record_tdep.size_knfsd_fh = 132;
amd64_x32_linux_record_tdep.size_TASK_COMM_LEN = 16;
- amd64_x32_linux_record_tdep.size_sigaction = 152;
- amd64_x32_linux_record_tdep.size_sigset_t = 128;
+ amd64_x32_linux_record_tdep.size_sigaction = 20;
+ amd64_x32_linux_record_tdep.size_sigset_t = 8;
amd64_x32_linux_record_tdep.size_siginfo_t = 128;
amd64_x32_linux_record_tdep.size_cap_user_data_t = 8;
amd64_x32_linux_record_tdep.size_stack_t = 24;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 940f01f..88d818d 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1487,8 +1487,8 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_flock = 16;
arm_linux_record_tdep.size_oldold_utsname = 45;
arm_linux_record_tdep.size_ustat = 20;
- arm_linux_record_tdep.size_old_sigaction = 140;
- arm_linux_record_tdep.size_old_sigset_t = 128;
+ arm_linux_record_tdep.size_old_sigaction = 16;
+ arm_linux_record_tdep.size_old_sigset_t = 4;
arm_linux_record_tdep.size_rlimit = 8;
arm_linux_record_tdep.size_rusage = 72;
arm_linux_record_tdep.size_timeval = 8;
@@ -1524,7 +1524,7 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_NFS_FHSIZE = 32;
arm_linux_record_tdep.size_knfsd_fh = 132;
arm_linux_record_tdep.size_TASK_COMM_LEN = 16;
- arm_linux_record_tdep.size_sigaction = 140;
+ arm_linux_record_tdep.size_sigaction = 20;
arm_linux_record_tdep.size_sigset_t = 8;
arm_linux_record_tdep.size_siginfo_t = 128;
arm_linux_record_tdep.size_cap_user_data_t = 12;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index af9c28a..0bf2cdc 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -806,8 +806,8 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_flock = 16;
i386_linux_record_tdep.size_oldold_utsname = 45;
i386_linux_record_tdep.size_ustat = 20;
- i386_linux_record_tdep.size_old_sigaction = 140;
- i386_linux_record_tdep.size_old_sigset_t = 128;
+ i386_linux_record_tdep.size_old_sigaction = 16;
+ i386_linux_record_tdep.size_old_sigset_t = 4;
i386_linux_record_tdep.size_rlimit = 8;
i386_linux_record_tdep.size_rusage = 72;
i386_linux_record_tdep.size_timeval = 8;
@@ -843,7 +843,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_NFS_FHSIZE = 32;
i386_linux_record_tdep.size_knfsd_fh = 132;
i386_linux_record_tdep.size_TASK_COMM_LEN = 16;
- i386_linux_record_tdep.size_sigaction = 140;
+ i386_linux_record_tdep.size_sigaction = 20;
i386_linux_record_tdep.size_sigset_t = 8;
i386_linux_record_tdep.size_siginfo_t = 128;
i386_linux_record_tdep.size_cap_user_data_t = 12;
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 79d115e..896f410 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1423,8 +1423,8 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_flock = 32;
record_tdep->size_oldold_utsname = 45;
record_tdep->size_ustat = 32;
- record_tdep->size_old_sigaction = 152;
- record_tdep->size_old_sigset_t = 128;
+ record_tdep->size_old_sigaction = 32;
+ record_tdep->size_old_sigset_t = 8;
record_tdep->size_rlimit = 16;
record_tdep->size_rusage = 144;
record_tdep->size_timeval = 16;
@@ -1457,8 +1457,8 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_NFS_FHSIZE = 32;
record_tdep->size_knfsd_fh = 132;
record_tdep->size_TASK_COMM_LEN = 32;
- record_tdep->size_sigaction = 152;
- record_tdep->size_sigset_t = 128;
+ record_tdep->size_sigaction = 32;
+ record_tdep->size_sigset_t = 8;
record_tdep->size_siginfo_t = 128;
record_tdep->size_cap_user_data_t = 8;
record_tdep->size_stack_t = 24;
@@ -1490,8 +1490,8 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_flock = 16;
record_tdep->size_oldold_utsname = 45;
record_tdep->size_ustat = 20;
- record_tdep->size_old_sigaction = 152;
- record_tdep->size_old_sigset_t = 128;
+ record_tdep->size_old_sigaction = 16;
+ record_tdep->size_old_sigset_t = 4;
record_tdep->size_rlimit = 8;
record_tdep->size_rusage = 72;
record_tdep->size_timeval = 8;
@@ -1524,8 +1524,8 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_NFS_FHSIZE = 32;
record_tdep->size_knfsd_fh = 132;
record_tdep->size_TASK_COMM_LEN = 32;
- record_tdep->size_sigaction = 140;
- record_tdep->size_sigset_t = 128;
+ record_tdep->size_sigaction = 20;
+ record_tdep->size_sigset_t = 8;
record_tdep->size_siginfo_t = 128;
record_tdep->size_cap_user_data_t = 4;
record_tdep->size_stack_t = 12;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 10/11] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (8 preceding siblings ...)
2015-10-17 21:49 ` [PATCH 02/11] gdb/linux-record: Fix size_[ug]id values Marcin Kościelnicki
@ 2015-10-17 21:49 ` Marcin Kościelnicki
2015-10-17 21:49 ` [PATCH 05/11] gdb/linux-record: Fix msghdr parsing on 64-bit targets Marcin Kościelnicki
2015-10-19 15:37 ` gdb/linux-record fixes Pedro Alves
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:49 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
---
gdb/ppc-linux-tdep.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index ab20e78..f6dfb5a 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1455,7 +1455,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_pollfd = 8;
record_tdep->size_NFS_FHSIZE = 32;
record_tdep->size_knfsd_fh = 132;
- record_tdep->size_TASK_COMM_LEN = 32;
+ record_tdep->size_TASK_COMM_LEN = 16;
record_tdep->size_sigaction = 32;
record_tdep->size_sigset_t = 8;
record_tdep->size_siginfo_t = 128;
@@ -1522,7 +1522,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_pollfd = 8;
record_tdep->size_NFS_FHSIZE = 32;
record_tdep->size_knfsd_fh = 132;
- record_tdep->size_TASK_COMM_LEN = 32;
+ record_tdep->size_TASK_COMM_LEN = 16;
record_tdep->size_sigaction = 20;
record_tdep->size_sigset_t = 8;
record_tdep->size_siginfo_t = 128;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 02/11] gdb/linux-record: Fix size_[ug]id values
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (7 preceding siblings ...)
2015-10-17 21:41 ` [PATCH 11/11] gdb/linux-record: Fix struct sizes for x32 + aarch64 Marcin Kościelnicki
@ 2015-10-17 21:49 ` Marcin Kościelnicki
2015-10-17 21:49 ` [PATCH 10/11] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too Marcin Kościelnicki
` (2 subsequent siblings)
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:49 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
i386 and arm wrongly set them to 2, when it should be 4. size_[ug]id is used
by getgroups32 etc syscalls, while size_old_[ug]id is used for getgroups16
and friends.
---
gdb/arm-linux-tdep.c | 4 ++--
gdb/i386-linux-tdep.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 4a100c8..940f01f 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1531,8 +1531,8 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_stack_t = 12;
arm_linux_record_tdep.size_off_t = arm_linux_record_tdep.size_long;
arm_linux_record_tdep.size_stat64 = 96;
- arm_linux_record_tdep.size_gid_t = 2;
- arm_linux_record_tdep.size_uid_t = 2;
+ arm_linux_record_tdep.size_gid_t = 4;
+ arm_linux_record_tdep.size_uid_t = 4;
arm_linux_record_tdep.size_PAGE_SIZE = 4096;
arm_linux_record_tdep.size_flock64 = 24;
arm_linux_record_tdep.size_user_desc = 16;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 8dce146..af9c28a 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -850,8 +850,8 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_stack_t = 12;
i386_linux_record_tdep.size_off_t = i386_linux_record_tdep.size_long;
i386_linux_record_tdep.size_stat64 = 96;
- i386_linux_record_tdep.size_gid_t = 2;
- i386_linux_record_tdep.size_uid_t = 2;
+ i386_linux_record_tdep.size_gid_t = 4;
+ i386_linux_record_tdep.size_uid_t = 4;
i386_linux_record_tdep.size_PAGE_SIZE = 4096;
i386_linux_record_tdep.size_flock64 = 24;
i386_linux_record_tdep.size_user_desc = 16;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 05/11] gdb/linux-record: Fix msghdr parsing on 64-bit targets
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (9 preceding siblings ...)
2015-10-17 21:49 ` [PATCH 10/11] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too Marcin Kościelnicki
@ 2015-10-17 21:49 ` Marcin Kościelnicki
2015-10-19 15:37 ` gdb/linux-record fixes Pedro Alves
11 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-17 21:49 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
The code failed to account for padding between the int and subsequent
pointer present on 64-bit architectures.
---
gdb/linux-record.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index e950e8d..8832ef4 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -162,7 +162,9 @@ record_linux_msghdr (struct regcache *regcache,
tdep->size_int,
byte_order)))
return -1;
- a += tdep->size_int;
+ /* We have read an int, but skip size_pointer bytes to account for alignment
+ of the next field on 64-bit targets. */
+ a += tdep->size_pointer;
/* msg_iov msg_iovlen */
addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: gdb/linux-record fixes
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
` (10 preceding siblings ...)
2015-10-17 21:49 ` [PATCH 05/11] gdb/linux-record: Fix msghdr parsing on 64-bit targets Marcin Kościelnicki
@ 2015-10-19 15:37 ` Pedro Alves
2015-10-19 17:18 ` Marcin Kościelnicki
11 siblings, 1 reply; 49+ messages in thread
From: Pedro Alves @ 2015-10-19 15:37 UTC (permalink / raw)
To: Marcin Kościelnicki, gdb-patches
Hi Marcin,
Thanks for working on this.
On 10/17/2015 10:41 PM, Marcin KoÅcielnicki wrote:
> When working on process record and replay support for s390-linux,
> I found quite a few problems in syscall handling. I fixed the most
> important of these in this patchset. Please review.
I'm assuming none of the bugs you're fixing are presently covered by the
reverse debugging testsuite (testsuite/gdb.reverse/)? E.g,. sounds like a
test that steps forward over pipe/time/waitpid calls and then backwards
would exercise patch #06?
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: gdb/linux-record fixes
2015-10-19 15:37 ` gdb/linux-record fixes Pedro Alves
@ 2015-10-19 17:18 ` Marcin Kościelnicki
2015-10-20 11:07 ` Pedro Alves
0 siblings, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-19 17:18 UTC (permalink / raw)
To: Pedro Alves, gdb-patches
On 19/10/15 17:37, Pedro Alves wrote:
> Hi Marcin,
>
> Thanks for working on this.
>
> On 10/17/2015 10:41 PM, Marcin KoÅcielnicki wrote:
>> When working on process record and replay support for s390-linux,
>> I found quite a few problems in syscall handling. I fixed the most
>> important of these in this patchset. Please review.
>
> I'm assuming none of the bugs you're fixing are presently covered by the
> reverse debugging testsuite (testsuite/gdb.reverse/)? E.g,. sounds like a
> test that steps forward over pipe/time/waitpid calls and then backwards
> would exercise patch #06?
Yeah, they're not covered by the testsuite. Actually, there seem to be
only two tests in gdb.reverse suite that even touch syscalls:
sigall-reverse (signal, sigprocmask, exit_group) and watch-reverse
(read, write). No wonder that syscall handling is buggy...
Stepping forward and backward over pipe/time/waitpid would indeed do the
trick for patch #6. Some others are trickier to test, though - for
example to test #3 (overlong sigaction/sigset_t) you'd need to manually
invoke the actual linux syscalls, taking care to pull the right struct
definitions from kernel headers, and make sure they're located near the
end of segment bounduary (so that accessing after the end causes an
error) - the glibc wrappers will always allocate relevant structs on
stack, which almost certainly has extra bytes after the struct, hiding
the bug.
BTW, I was thinking of a self-testing approach for linux-record:
- if gdb debugging is enabled, record changes on each instruction twice:
before and after execution
- memory/register contents recorded in "before" stage should match
contents previously recorded in "after" stage, if any (ie. if it's not
the first time we see a register or a memory byte). If there's a
mismatch, record missed something.
Unfortunately, that's a non-starter for multithreaded programs, or for
progams involving shared memory :(
>
> Thanks,
> Pedro Alves
>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: gdb/linux-record fixes
2015-10-19 17:18 ` Marcin Kościelnicki
@ 2015-10-20 11:07 ` Pedro Alves
2015-10-20 11:16 ` Marcin Kościelnicki
0 siblings, 1 reply; 49+ messages in thread
From: Pedro Alves @ 2015-10-20 11:07 UTC (permalink / raw)
To: Marcin Kościelnicki, Yao Qi; +Cc: gdb-patches
On 10/19/2015 06:17 PM, Marcin KoÅcielnicki wrote:
> Yeah, they're not covered by the testsuite. Actually, there seem to be
> only two tests in gdb.reverse suite that even touch syscalls:
> sigall-reverse (signal, sigprocmask, exit_group) and watch-reverse
> (read, write). No wonder that syscall handling is buggy...
>
> Stepping forward and backward over pipe/time/waitpid would indeed do the
> trick for patch #6.
Can I convince you to add that to the patch (and likewise to others that
might not be overly hard)?
BTW, you'll also need to include ChangeLog entries. Please check here:
https://sourceware.org/gdb/wiki/ContributionChecklist
> Some others are trickier to test, though - for
> example to test #3 (overlong sigaction/sigset_t) you'd need to manually
> invoke the actual linux syscalls, taking care to pull the right struct
> definitions from kernel headers, and make sure they're located near the
> end of segment bounduary (so that accessing after the end causes an
> error) - the glibc wrappers will always allocate relevant structs on
> stack, which almost certainly has extra bytes after the struct, hiding
> the bug.
OOC, how did you first notice the bug?
>
> BTW, I was thinking of a self-testing approach for linux-record:
>
> - if gdb debugging is enabled, record changes on each instruction twice:
> before and after execution
> - memory/register contents recorded in "before" stage should match
> contents previously recorded in "after" stage, if any (ie. if it's not
> the first time we see a register or a memory byte). If there's a
> mismatch, record missed something.
>
> Unfortunately, that's a non-starter for multithreaded programs, or for
> progams involving shared memory :(
Sounds like a good idea. I don't see multithreading being an issue,
as target record doesn't really work with multithreaded programs to begin
with. Also, I don't think we'd want it behind the usual "set debug record"
knob, as that sounds like it could actually change the record target's
behavior, and heisenbugs. Probably put it under its own
"maint set record self-check on" or some such knob.
This reminds me that Yao once wrote a test that did something like
that (registers only, no gdb magic):
https://sourceware.org/ml/gdb-patches/2015-05/msg00482.html
Not sure what happened to that.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: gdb/linux-record fixes
2015-10-20 11:07 ` Pedro Alves
@ 2015-10-20 11:16 ` Marcin Kościelnicki
2015-10-22 13:39 ` Marcin Kościelnicki
0 siblings, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-20 11:16 UTC (permalink / raw)
To: Pedro Alves, Yao Qi; +Cc: gdb-patches
On 20/10/15 13:07, Pedro Alves wrote:
> On 10/19/2015 06:17 PM, Marcin KoÅcielnicki wrote:
>
>> Yeah, they're not covered by the testsuite. Actually, there seem to be
>> only two tests in gdb.reverse suite that even touch syscalls:
>> sigall-reverse (signal, sigprocmask, exit_group) and watch-reverse
>> (read, write). No wonder that syscall handling is buggy...
>>
>> Stepping forward and backward over pipe/time/waitpid would indeed do the
>> trick for patch #6.
>
> Can I convince you to add that to the patch (and likewise to others that
> might not be overly hard)?
I'll do that, if I'm not overcome by dejaGNU... I have no idea how that
stuff works at the moment.
> BTW, you'll also need to include ChangeLog entries. Please check here:
>
> https://sourceware.org/gdb/wiki/ContributionChecklist
OK, will do.
>> Some others are trickier to test, though - for
>> example to test #3 (overlong sigaction/sigset_t) you'd need to manually
>> invoke the actual linux syscalls, taking care to pull the right struct
>> definitions from kernel headers, and make sure they're located near the
>> end of segment bounduary (so that accessing after the end causes an
>> error) - the glibc wrappers will always allocate relevant structs on
>> stack, which almost certainly has extra bytes after the struct, hiding
>> the bug.
>
> OOC, how did you first notice the bug?
I'm working on s390 support, and noticed a lot of weirdness when filling
the size_* fields for the new target and comparing with others. I dug
down into syscall handling code and noticed a lot more problems. I also
stepped through getgroups syscall on i386 to make sure size mismatches
really cause problems (getgroups was recorded wrong because of the gid
size issue).
>>
>> BTW, I was thinking of a self-testing approach for linux-record:
>>
>> - if gdb debugging is enabled, record changes on each instruction twice:
>> before and after execution
>> - memory/register contents recorded in "before" stage should match
>> contents previously recorded in "after" stage, if any (ie. if it's not
>> the first time we see a register or a memory byte). If there's a
>> mismatch, record missed something.
>>
>> Unfortunately, that's a non-starter for multithreaded programs, or for
>> progams involving shared memory :(
>
> Sounds like a good idea. I don't see multithreading being an issue,
> as target record doesn't really work with multithreaded programs to begin
> with. Also, I don't think we'd want it behind the usual "set debug record"
> knob, as that sounds like it could actually change the record target's
> behavior, and heisenbugs. Probably put it under its own
> "maint set record self-check on" or some such knob.
>
> This reminds me that Yao once wrote a test that did something like
> that (registers only, no gdb magic):
>
> https://sourceware.org/ml/gdb-patches/2015-05/msg00482.html
>
> Not sure what happened to that.
>
> Thanks,
> Pedro Alves
>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: gdb/linux-record fixes
2015-10-20 11:16 ` Marcin Kościelnicki
@ 2015-10-22 13:39 ` Marcin Kościelnicki
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
2015-10-29 13:03 ` gdb/linux-record fixes Pedro Alves
0 siblings, 2 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:39 UTC (permalink / raw)
To: Pedro Alves, Yao Qi; +Cc: gdb-patches
On 20/10/15 13:15, Marcin KoÅcielnicki wrote:
> On 20/10/15 13:07, Pedro Alves wrote:
>> On 10/19/2015 06:17 PM, Marcin KoÅcielnicki wrote:
>>
>>> Yeah, they're not covered by the testsuite. Actually, there seem to be
>>> only two tests in gdb.reverse suite that even touch syscalls:
>>> sigall-reverse (signal, sigprocmask, exit_group) and watch-reverse
>>> (read, write). No wonder that syscall handling is buggy...
>>>
>>> Stepping forward and backward over pipe/time/waitpid would indeed do the
>>> trick for patch #6.
>>
>> Can I convince you to add that to the patch (and likewise to others that
>> might not be overly hard)?
>
> I'll do that, if I'm not overcome by dejaGNU... I have no idea how that
> stuff works at the moment.
>
>> BTW, you'll also need to include ChangeLog entries. Please check here:
>>
>> https://sourceware.org/gdb/wiki/ContributionChecklist
>
> OK, will do.
>
Here comes v2:
- ChangeLog entries added
- I've split the last patch in two (termios and x32)
- test cases are included that exercise #2 (getresuid), #5 (readmsg), #6
(time, waitpid, pipe), #8 (fstatat), #12 (readv); testing the rest would
be rather contrived
Unfortunately, my waitpid test appears to trigger another bug - going
over a fork with a breakpoint active while recording causes an error:
record-full.c:1716: internal-error: record_full_remove_breakpoint:
removing unknown breakpoint
I'll try to debug this problem this weekend. Should I remove the
waitpid test from this patchset for now, or mark it as an expected-fail
somehow?
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls.
2015-10-22 13:39 ` Marcin Kościelnicki
@ 2015-10-22 13:39 ` Marcin Kościelnicki
2015-10-22 13:43 ` [PATCH v2 11/13] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too Marcin Kościelnicki
` (12 more replies)
2015-10-29 13:03 ` gdb/linux-record fixes Pedro Alves
1 sibling, 13 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:39 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
gdb/testsuite/ChangeLog:
* gdb.reverse/linux-fstatat-reverse.c: New test.
* gdb.reverse/linux-fstatat-reverse.exp: New file.
* gdb.reverse/linux-getresuid-reverse.c: New test.
* gdb.reverse/linux-getresuid-reverse.exp: New file.
* gdb.reverse/linux-pipe-reverse.c: New test.
* gdb.reverse/linux-pipe-reverse.exp: New file.
* gdb.reverse/linux-readv-reverse.c: New test.
* gdb.reverse/linux-readv-reverse.exp: New file.
* gdb.reverse/linux-recvmsg-reverse.c: New test.
* gdb.reverse/linux-recvmsg-reverse.exp: New file.
* gdb.reverse/linux-time-reverse.c: New test.
* gdb.reverse/linux-time-reverse.exp: New file.
* gdb.reverse/linux-waitpid-reverse.c: New test.
* gdb.reverse/linux-waitpid-reverse.exp: New file.
---
gdb/testsuite/ChangeLog | 17 ++++
gdb/testsuite/gdb.reverse/linux-fstatat-reverse.c | 39 ++++++++++
.../gdb.reverse/linux-fstatat-reverse.exp | 63 +++++++++++++++
.../gdb.reverse/linux-getresuid-reverse.c | 38 +++++++++
.../gdb.reverse/linux-getresuid-reverse.exp | 70 +++++++++++++++++
gdb/testsuite/gdb.reverse/linux-pipe-reverse.c | 36 +++++++++
gdb/testsuite/gdb.reverse/linux-pipe-reverse.exp | 63 +++++++++++++++
gdb/testsuite/gdb.reverse/linux-readv-reverse.c | 46 +++++++++++
gdb/testsuite/gdb.reverse/linux-readv-reverse.exp | 66 ++++++++++++++++
gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.c | 90 ++++++++++++++++++++++
.../gdb.reverse/linux-recvmsg-reverse.exp | 73 ++++++++++++++++++
gdb/testsuite/gdb.reverse/linux-time-reverse.c | 38 +++++++++
gdb/testsuite/gdb.reverse/linux-time-reverse.exp | 63 +++++++++++++++
gdb/testsuite/gdb.reverse/linux-waitpid-reverse.c | 41 ++++++++++
.../gdb.reverse/linux-waitpid-reverse.exp | 63 +++++++++++++++
15 files changed, 806 insertions(+)
create mode 100644 gdb/testsuite/gdb.reverse/linux-fstatat-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/linux-getresuid-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/linux-getresuid-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/linux-pipe-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/linux-pipe-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/linux-readv-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/linux-readv-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/linux-time-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/linux-time-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/linux-waitpid-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/linux-waitpid-reverse.exp
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1313aa2..8e65781 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,20 @@
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
+ * gdb.reverse/linux-fstatat-reverse.c: New test.
+ * gdb.reverse/linux-fstatat-reverse.exp: New file.
+ * gdb.reverse/linux-getresuid-reverse.c: New test.
+ * gdb.reverse/linux-getresuid-reverse.exp: New file.
+ * gdb.reverse/linux-pipe-reverse.c: New test.
+ * gdb.reverse/linux-pipe-reverse.exp: New file.
+ * gdb.reverse/linux-readv-reverse.c: New test.
+ * gdb.reverse/linux-readv-reverse.exp: New file.
+ * gdb.reverse/linux-recvmsg-reverse.c: New test.
+ * gdb.reverse/linux-recvmsg-reverse.exp: New file.
+ * gdb.reverse/linux-time-reverse.c: New test.
+ * gdb.reverse/linux-time-reverse.exp: New file.
+ * gdb.reverse/linux-waitpid-reverse.c: New test.
+ * gdb.reverse/linux-waitpid-reverse.exp: New file.
+
2015-10-21 Simon Marchi <simon.marchi@polymtl.ca>
PR python/18073
diff --git a/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.c b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.c
new file mode 100644
index 0000000..21091b5
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.c
@@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+void marker1 ()
+{
+}
+
+void marker2 ()
+{
+}
+
+struct stat buf;
+
+int main() {
+ marker1();
+ int fd = open("/", O_PATH);
+ fstatat(fd, ".", &buf, 0);
+ marker2();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp
new file mode 100644
index 0000000..23652e4
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp
@@ -0,0 +1,63 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests linux fstatat syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+
+if ![istarget "*linux*"] then {
+ verbose "Skipping linux syscall reverse tests."
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (0)
+# will be remembered. If not, new contents (mode of /) will be used,
+# and the test will fail.
+
+gdb_test "print buf.st_mode" ".* = 0" "check fstatat record"
diff --git a/gdb/testsuite/gdb.reverse/linux-getresuid-reverse.c b/gdb/testsuite/gdb.reverse/linux-getresuid-reverse.c
new file mode 100644
index 0000000..7aa2004
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-getresuid-reverse.c
@@ -0,0 +1,38 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+
+void marker1 ()
+{
+}
+
+void marker2 ()
+{
+}
+
+uid_t ruid = -1, euid = -1, suid = -1;
+gid_t rgid = -1, egid = -1, sgid = -1;
+
+int main() {
+ marker1();
+ getresuid(&ruid, &euid, &suid);
+ getresgid(&rgid, &egid, &sgid);
+ marker2();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/linux-getresuid-reverse.exp b/gdb/testsuite/gdb.reverse/linux-getresuid-reverse.exp
new file mode 100644
index 0000000..5a45486
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-getresuid-reverse.exp
@@ -0,0 +1,70 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests linux getresuid/getresgid syscalls for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+
+if ![istarget "*linux*"] then {
+ verbose "Skipping linux getresuid/getresgid reverse tests."
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (the actual uid/gid) will be used,
+# and the test will fail (we hope the test user doesn't actually have uid of
+# -1). Do it this way instead of printing uid/gid directly, since uid_t/gid_t
+# is likely to be unsigned.
+
+gdb_test "print ruid == (uid_t)-1" ".* = 1" "check ruid record"
+gdb_test "print euid == (uid_t)-1" ".* = 1" "check euid record"
+gdb_test "print suid == (uid_t)-1" ".* = 1" "check suid record"
+gdb_test "print rgid == (gid_t)-1" ".* = 1" "check rgid record"
+gdb_test "print egid == (gid_t)-1" ".* = 1" "check egid record"
+gdb_test "print sgid == (gid_t)-1" ".* = 1" "check sgid record"
diff --git a/gdb/testsuite/gdb.reverse/linux-pipe-reverse.c b/gdb/testsuite/gdb.reverse/linux-pipe-reverse.c
new file mode 100644
index 0000000..56aae3c
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-pipe-reverse.c
@@ -0,0 +1,36 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+
+void marker1 ()
+{
+}
+
+void marker2 ()
+{
+}
+
+int fds[2] = { -1, -1 };
+
+int main() {
+ marker1();
+ pipe(fds);
+ marker2();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/linux-pipe-reverse.exp b/gdb/testsuite/gdb.reverse/linux-pipe-reverse.exp
new file mode 100644
index 0000000..5dfbbe7
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-pipe-reverse.exp
@@ -0,0 +1,63 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests linux pipe syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+
+if ![istarget "*linux*"] then {
+ verbose "Skipping linux syscall reverse tests."
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (the file fds from pipe) will be
+# used, and the test will fail.
+
+gdb_test "print fds" ".* = {-1, -1}" "check pipe record"
diff --git a/gdb/testsuite/gdb.reverse/linux-readv-reverse.c b/gdb/testsuite/gdb.reverse/linux-readv-reverse.c
new file mode 100644
index 0000000..f62c2a8
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-readv-reverse.c
@@ -0,0 +1,46 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/uio.h>
+
+void marker1 ()
+{
+}
+
+void marker2 ()
+{
+}
+
+int fds[2] = { -1, -1 };
+char buf[5];
+const struct iovec v[4] = {
+ { &buf[1], 1 },
+ { &buf[0], 1 },
+ { &buf[3], 1 },
+ { &buf[2], 1 },
+};
+
+int main() {
+ marker1();
+ pipe(fds);
+ write(fds[1], "UNIX", 4);
+ readv(fds[0], v, 4);
+ marker2();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/linux-readv-reverse.exp b/gdb/testsuite/gdb.reverse/linux-readv-reverse.exp
new file mode 100644
index 0000000..5701652
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-readv-reverse.exp
@@ -0,0 +1,66 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests linux pipe syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+
+if ![istarget "*linux*"] then {
+ verbose "Skipping linux syscall reverse tests."
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents ("")
+# will be remembered. If not, new contents ("NUXI") will be
+# used, and the test will fail.
+
+gdb_test "print (int)buf\[0]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[1]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[2]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[3]" ".* = 0" "check readv record"
diff --git a/gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.c b/gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.c
new file mode 100644
index 0000000..d9a9508
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.c
@@ -0,0 +1,90 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <unistd.h>
+
+void marker1 ()
+{
+}
+
+void marker2 ()
+{
+}
+
+char wdata[] = "abcdef";
+
+struct iovec wv[1] = {
+ {wdata, 6},
+};
+
+char wc[CMSG_SPACE(sizeof (struct ucred)) + CMSG_SPACE(sizeof (int))];
+
+struct msghdr wmsg = {
+ 0, 0,
+ wv, 1,
+ wc, sizeof wc,
+ 0,
+};
+
+char rdata[5] = "xxxx";
+
+struct iovec rv[2] = {
+ {&rdata[2], 2},
+ {&rdata[0], 2},
+};
+
+char rc[CMSG_SPACE(sizeof (struct ucred)) + 7];
+
+struct msghdr rmsg = {
+ 0, 0,
+ rv, 2,
+ rc, sizeof rc,
+ 0,
+};
+
+int fds[2];
+
+int main() {
+ int itrue = 1;
+ /* prepare cmsg to send */
+ struct cmsghdr *cm1 = CMSG_FIRSTHDR(&wmsg);
+ cm1->cmsg_len = CMSG_LEN(sizeof (struct ucred));
+ cm1->cmsg_level = AF_UNIX;
+ cm1->cmsg_type = SCM_CREDENTIALS;
+ struct ucred *uc = (void *)CMSG_DATA(cm1);
+ uc->pid = getpid();
+ uc->uid = getuid();
+ uc->gid = getgid();
+ struct cmsghdr *cm2 = CMSG_NXTHDR(&wmsg, cm1);
+ cm2->cmsg_len = CMSG_LEN(sizeof (int));
+ cm2->cmsg_level = AF_UNIX;
+ cm2->cmsg_type = SCM_RIGHTS;
+ int *pfd = (void *)CMSG_DATA(cm2);
+ *pfd = 2;
+ /* do the syscalls */
+ marker1();
+ socketpair(AF_UNIX, SOCK_DGRAM, 0, fds);
+ setsockopt(fds[0], SOL_SOCKET, SO_PASSCRED, &itrue, sizeof itrue);
+ sendmsg(fds[1], &wmsg, 0);
+ recvmsg(fds[0], &rmsg, 0);
+ marker2();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.exp
new file mode 100644
index 0000000..e4d2370
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-recvmsg-reverse.exp
@@ -0,0 +1,73 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests linux socketpair and recvmsg syscalls for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+
+if ![istarget "*linux*"] then {
+ verbose "Skipping linux syscall reverse tests."
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents will
+# be remembered. If not, new contents will be used, and the test will fail.
+
+# rdata should be "xxxx", not "cdab"
+gdb_test "print rdata" ".* = \"xxxx\"" "check recvmsg record - rdata"
+
+# rmsg.msg_flags should be zeros, not MSG_TRUNC | MSG_CTRUNC
+gdb_test "print rmsg.msg_flags" ".* = 0" "check recvmsg record - rmsg"
+
+# rmsg.msg_controllen should be sizeof rc, not actual size of control data
+# (7 bytes less)
+gdb_test "print rmsg.msg_controllen - sizeof rc" ".* = 0" "check recvmsg record - rmsg"
+
+# rc should be zeros, not received cmsg
+gdb_test "print ((struct cmsghdr *)rc)->cmsg_len" ".* = 0" "check recvmsg record - cmsg"
diff --git a/gdb/testsuite/gdb.reverse/linux-time-reverse.c b/gdb/testsuite/gdb.reverse/linux-time-reverse.c
new file mode 100644
index 0000000..ab6cba8
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-time-reverse.c
@@ -0,0 +1,38 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <time.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+void marker1 ()
+{
+}
+
+void marker2 ()
+{
+}
+
+time_t time_global = -1;
+
+int main() {
+ marker1();
+ syscall(SYS_time, &time_global);
+ marker2();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/linux-time-reverse.exp b/gdb/testsuite/gdb.reverse/linux-time-reverse.exp
new file mode 100644
index 0000000..04ffe10
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-time-reverse.exp
@@ -0,0 +1,63 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests linux time syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+
+if ![istarget "*linux*"] then {
+ verbose "Skipping linux syscall reverse tests."
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (current time) will be used,
+# and the test will fail.
+
+gdb_test "print time_global" ".* = -1" "check time record"
diff --git a/gdb/testsuite/gdb.reverse/linux-waitpid-reverse.c b/gdb/testsuite/gdb.reverse/linux-waitpid-reverse.c
new file mode 100644
index 0000000..31aaef0
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-waitpid-reverse.c
@@ -0,0 +1,41 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+
+void marker1 ()
+{
+}
+
+void marker2 ()
+{
+}
+
+int status;
+
+int main() {
+ marker1();
+ if (!fork()) {
+ _exit(123);
+ } else {
+ waitpid(-1, &status, 0);
+ }
+ marker2();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/linux-waitpid-reverse.exp b/gdb/testsuite/gdb.reverse/linux-waitpid-reverse.exp
new file mode 100644
index 0000000..9aa85a5
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/linux-waitpid-reverse.exp
@@ -0,0 +1,63 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests linux waitpid syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+
+if ![istarget "*linux*"] then {
+ verbose "Skipping linux syscall reverse tests."
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (status) will be # used, and
+# the test will fail.
+
+gdb_test "print status" ".* = -1" "check waitpid record"
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 11/13] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
@ 2015-10-22 13:43 ` Marcin Kościelnicki
2015-10-22 13:45 ` [PATCH v2 13/13] gdb/linux-record: Fix struct sizes for x32 Marcin Kościelnicki
` (11 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:43 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
gdb/ChangeLog:
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Fix TASK_COMM_LEN.
---
gdb/ChangeLog | 4 ++++
gdb/ppc-linux-tdep.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e48abcc..166f2e9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * ppc-linux-tdep.c (ppc_init_linux_record_tdep): Fix TASK_COMM_LEN.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* linux-record.c (record_linux_system_call): Fix old_select.
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index ab20e78..f6dfb5a 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1455,7 +1455,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_pollfd = 8;
record_tdep->size_NFS_FHSIZE = 32;
record_tdep->size_knfsd_fh = 132;
- record_tdep->size_TASK_COMM_LEN = 32;
+ record_tdep->size_TASK_COMM_LEN = 16;
record_tdep->size_sigaction = 32;
record_tdep->size_sigset_t = 8;
record_tdep->size_siginfo_t = 128;
@@ -1522,7 +1522,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_pollfd = 8;
record_tdep->size_NFS_FHSIZE = 32;
record_tdep->size_knfsd_fh = 132;
- record_tdep->size_TASK_COMM_LEN = 32;
+ record_tdep->size_TASK_COMM_LEN = 16;
record_tdep->size_sigaction = 20;
record_tdep->size_sigset_t = 8;
record_tdep->size_siginfo_t = 128;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 13/13] gdb/linux-record: Fix struct sizes for x32
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
2015-10-22 13:43 ` [PATCH v2 11/13] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too Marcin Kościelnicki
@ 2015-10-22 13:45 ` Marcin Kościelnicki
2015-10-22 13:45 ` [PATCH v2 03/13] gdb/linux-record: Fix size_[ug]id values Marcin Kościelnicki
` (10 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:45 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
While x32 syscall interface is mostly shared with x86_64, some syscalls
are truly 32-bit. Correct sizes accordingly.
gdb/ChangeLog:
* amd64-linux-tdep.c (amd64_x32_linux_init_abi): Fix size_msghdr,
size_stack_t, size_size_t, size_iovec.
---
gdb/ChangeLog | 5 +++++
gdb/amd64-linux-tdep.c | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 90364ce..2502fed 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * amd64-linux-tdep.c (amd64_x32_linux_init_abi): Fix size_msghdr,
+ size_stack_t, size_size_t, size_iovec.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Fix size_termios.
* amd64-linux-tdep.c (amd64_linux_init_abi): Fix size_termios.
(amd64_x32_linux_init_abi): Fix size_termios.
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index b0950f2..ee21635 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -2133,7 +2133,7 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
= gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
amd64_x32_linux_record_tdep.size_ulong
= gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
- amd64_x32_linux_record_tdep.size_msghdr = 56;
+ amd64_x32_linux_record_tdep.size_msghdr = 28;
amd64_x32_linux_record_tdep.size_itimerval = 32;
amd64_x32_linux_record_tdep.size_stat = 144;
amd64_x32_linux_record_tdep.size_old_utsname = 325;
@@ -2154,7 +2154,7 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_sigset_t = 8;
amd64_x32_linux_record_tdep.size_siginfo_t = 128;
amd64_x32_linux_record_tdep.size_cap_user_data_t = 8;
- amd64_x32_linux_record_tdep.size_stack_t = 24;
+ amd64_x32_linux_record_tdep.size_stack_t = 12;
amd64_x32_linux_record_tdep.size_off_t = 8;
amd64_x32_linux_record_tdep.size_stat64 = 144;
amd64_x32_linux_record_tdep.size_gid_t = 4;
@@ -2174,8 +2174,8 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_serial_struct = 72;
amd64_x32_linux_record_tdep.size_serial_icounter_struct = 80;
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_size_t = 4;
+ amd64_x32_linux_record_tdep.size_iovec = 8;
amd64_x32_linux_record_tdep.size_time_t = 8;
/* These values are the second argument of system call "sys_fcntl"
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 03/13] gdb/linux-record: Fix size_[ug]id values
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
2015-10-22 13:43 ` [PATCH v2 11/13] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too Marcin Kościelnicki
2015-10-22 13:45 ` [PATCH v2 13/13] gdb/linux-record: Fix struct sizes for x32 Marcin Kościelnicki
@ 2015-10-22 13:45 ` Marcin Kościelnicki
2015-10-22 13:45 ` [PATCH v2 12/13] gdb/linux-record: Fix size_termios for x32, amd64, aarch64 Marcin Kościelnicki
` (9 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:45 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
i386 and arm wrongly set them to 2, when it should be 4. size_[ug]id is used
by getgroups32 etc syscalls, while size_old_[ug]id is used for getgroups16
and friends.
gdb/ChangeLog:
* arm-linux-tdep.c (arm_linux_init_abi): Fix size_[ug]id.
* i386-linux-tdep.c (i386_linux_init_abi): Fix size_[ug]id.
---
gdb/ChangeLog | 5 +++++
gdb/arm-linux-tdep.c | 4 ++--
gdb/i386-linux-tdep.c | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 128ee16..c88a331 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * arm-linux-tdep.c (arm_linux_init_abi): Fix size_[ug]id.
+ * i386-linux-tdep.c (i386_linux_init_abi): Fix size_[ug]id.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove size_siginfo.
* amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_siginfo.
(amd64_x32_linux_init_abi): Remove size_siginfo.
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 4a100c8..940f01f 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1531,8 +1531,8 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_stack_t = 12;
arm_linux_record_tdep.size_off_t = arm_linux_record_tdep.size_long;
arm_linux_record_tdep.size_stat64 = 96;
- arm_linux_record_tdep.size_gid_t = 2;
- arm_linux_record_tdep.size_uid_t = 2;
+ arm_linux_record_tdep.size_gid_t = 4;
+ arm_linux_record_tdep.size_uid_t = 4;
arm_linux_record_tdep.size_PAGE_SIZE = 4096;
arm_linux_record_tdep.size_flock64 = 24;
arm_linux_record_tdep.size_user_desc = 16;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 8dce146..af9c28a 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -850,8 +850,8 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_stack_t = 12;
i386_linux_record_tdep.size_off_t = i386_linux_record_tdep.size_long;
i386_linux_record_tdep.size_stat64 = 96;
- i386_linux_record_tdep.size_gid_t = 2;
- i386_linux_record_tdep.size_uid_t = 2;
+ i386_linux_record_tdep.size_gid_t = 4;
+ i386_linux_record_tdep.size_uid_t = 4;
i386_linux_record_tdep.size_PAGE_SIZE = 4096;
i386_linux_record_tdep.size_flock64 = 24;
i386_linux_record_tdep.size_user_desc = 16;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 12/13] gdb/linux-record: Fix size_termios for x32, amd64, aarch64
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (2 preceding siblings ...)
2015-10-22 13:45 ` [PATCH v2 03/13] gdb/linux-record: Fix size_[ug]id values Marcin Kościelnicki
@ 2015-10-22 13:45 ` Marcin Kościelnicki
2015-10-22 13:49 ` [PATCH v2 10/13] gdb/linux-record: Fix old_select syscall handling Marcin Kościelnicki
` (8 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:45 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
60 bytes is the size of glibc's struct termios, the one used by kernel is
36 bytes long.
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Fix size_termios.
* amd64-linux-tdep.c (amd64_linux_init_abi): Fix size_termios.
(amd64_x32_linux_init_abi): Fix size_termios.
---
gdb/ChangeLog | 6 ++++++
gdb/aarch64-linux-tdep.c | 2 +-
gdb/amd64-linux-tdep.c | 4 ++--
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 166f2e9..90364ce 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * aarch64-linux-tdep.c (aarch64_linux_init_abi): Fix size_termios.
+ * amd64-linux-tdep.c (amd64_linux_init_abi): Fix size_termios.
+ (amd64_x32_linux_init_abi): Fix size_termios.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Fix TASK_COMM_LEN.
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index a1dcd5b..aa35196 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1053,7 +1053,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_epoll_event = 12;
aarch64_linux_record_tdep.size_itimerspec = 32;
aarch64_linux_record_tdep.size_mq_attr = 64;
- aarch64_linux_record_tdep.size_termios = 60;
+ aarch64_linux_record_tdep.size_termios = 36;
aarch64_linux_record_tdep.size_termios2 = 44;
aarch64_linux_record_tdep.size_pid_t = 4;
aarch64_linux_record_tdep.size_winsize = 8;
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 829d9b7..b0950f2 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1950,7 +1950,7 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_linux_record_tdep.size_epoll_event = 12;
amd64_linux_record_tdep.size_itimerspec = 32;
amd64_linux_record_tdep.size_mq_attr = 64;
- amd64_linux_record_tdep.size_termios = 60;
+ amd64_linux_record_tdep.size_termios = 36;
amd64_linux_record_tdep.size_termios2 = 44;
amd64_linux_record_tdep.size_pid_t = 4;
amd64_linux_record_tdep.size_winsize = 8;
@@ -2167,7 +2167,7 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_epoll_event = 12;
amd64_x32_linux_record_tdep.size_itimerspec = 32;
amd64_x32_linux_record_tdep.size_mq_attr = 64;
- amd64_x32_linux_record_tdep.size_termios = 60;
+ amd64_x32_linux_record_tdep.size_termios = 36;
amd64_x32_linux_record_tdep.size_termios2 = 44;
amd64_x32_linux_record_tdep.size_pid_t = 4;
amd64_x32_linux_record_tdep.size_winsize = 8;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 10/13] gdb/linux-record: Fix old_select syscall handling
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (3 preceding siblings ...)
2015-10-22 13:45 ` [PATCH v2 12/13] gdb/linux-record: Fix size_termios for x32, amd64, aarch64 Marcin Kościelnicki
@ 2015-10-22 13:49 ` Marcin Kościelnicki
2015-10-22 13:51 ` [PATCH v2 04/13] gdb/linux-record: Fix sizes of sigaction and sigset_t Marcin Kościelnicki
` (7 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:49 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
We have to use extract_unsigned_integer to read paramaters structure - target
pointers can have different endianness and size.
gdb/ChangeLog:
* linux-record.c (record_linux_system_call): Fix old_select.
---
gdb/ChangeLog | 4 ++++
gdb/linux-record.c | 45 ++++++++++++++++++++++++++-------------------
2 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e3afacd..e48abcc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * linux-record.c (record_linux_system_call): Fix old_select.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* linux-record.c (record_linux_system_call): Fix newstatat.
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 9f38c0b..091ac8a 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -645,38 +645,45 @@ record_linux_system_call (enum gdb_syscall syscall,
case gdb_old_select:
{
- struct sel_arg_struct
- {
- CORE_ADDR n;
- CORE_ADDR inp;
- CORE_ADDR outp;
- CORE_ADDR exp;
- CORE_ADDR tvp;
- } sel;
+ unsigned long sz_sel_arg = tdep->size_long + tdep->size_pointer * 4;
+ gdb_byte *a = (gdb_byte *) alloca (sz_sel_arg);
+ CORE_ADDR inp, outp, exp, tvp;
regcache_raw_read_unsigned (regcache, tdep->arg1,
&tmpulongest);
if (tmpulongest)
{
- if (target_read_memory (tmpulongest, (gdb_byte *) &sel,
- sizeof(sel)))
+ if (target_read_memory (tmpulongest, a, sz_sel_arg))
{
if (record_debug)
fprintf_unfiltered (gdb_stdlog,
"Process record: error reading memory "
"at addr = 0x%s len = %lu.\n",
OUTPUT_REG (tmpulongest, tdep->arg1),
- (unsigned long) sizeof (sel));
+ sz_sel_arg);
return -1;
}
- if (record_full_arch_list_add_mem (sel.inp, tdep->size_fd_set))
- return -1;
- if (record_full_arch_list_add_mem (sel.outp, tdep->size_fd_set))
- return -1;
- if (record_full_arch_list_add_mem (sel.exp, tdep->size_fd_set))
- return -1;
- if (record_full_arch_list_add_mem (sel.tvp, tdep->size_timeval))
- return -1;
+ /* Skip n. */
+ a += tdep->size_long;
+ inp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
+ a += tdep->size_pointer;
+ outp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
+ a += tdep->size_pointer;
+ exp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
+ a += tdep->size_pointer;
+ tvp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
+ if (inp)
+ if (record_full_arch_list_add_mem (inp, tdep->size_fd_set))
+ return -1;
+ if (outp)
+ if (record_full_arch_list_add_mem (outp, tdep->size_fd_set))
+ return -1;
+ if (exp)
+ if (record_full_arch_list_add_mem (exp, tdep->size_fd_set))
+ return -1;
+ if (tvp)
+ if (record_full_arch_list_add_mem (tvp, tdep->size_timeval))
+ return -1;
}
}
break;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 04/13] gdb/linux-record: Fix sizes of sigaction and sigset_t
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (4 preceding siblings ...)
2015-10-22 13:49 ` [PATCH v2 10/13] gdb/linux-record: Fix old_select syscall handling Marcin Kościelnicki
@ 2015-10-22 13:51 ` Marcin Kościelnicki
2015-10-22 13:51 ` [PATCH v2 06/13] gdb/linux-record: Fix msghdr parsing on 64-bit targets Marcin Kościelnicki
` (6 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:51 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
The values were mistakenly set to size of glibc's sigset_t (128 bytes)
and sigaction (140 or 152 bytes) instead of the kernel ones. The kernel
has 4 or 8 byte old_sigset_t, 8 byte sigset_t, 16 or 32 byte old_sigaction,
20 or 32 byte sigaction.
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Fix size_sigaction,
size_sigset_t, size_old_sigaction, size_old_sigset_t.
* amd64-linux-tdep.c (amd64_linux_init_abi): Fix size_sigaction,
size_sigset_t, size_old_sigaction, size_old_sigset_t.
(amd64_x32_linux_init_abi): Fix size_sigaction, size_sigset_t,
size_old_sigaction, size_old_sigset_t.
* arm-linux-tdep.c (arm_linux_init_abi): Fix size_sigaction,
size_old_sigaction, size_old_sigset_t.
* i386-linux-tdep.c (i386_linux_init_abi): Fix size_sigaction,
size_old_sigaction, size_old_sigset_t.
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Fix size_sigaction,
size_sigset_t, size_old_sigaction, size_old_sigset_t.
---
gdb/ChangeLog | 15 +++++++++++++++
gdb/aarch64-linux-tdep.c | 8 ++++----
gdb/amd64-linux-tdep.c | 16 ++++++++--------
gdb/arm-linux-tdep.c | 6 +++---
gdb/i386-linux-tdep.c | 6 +++---
gdb/ppc-linux-tdep.c | 16 ++++++++--------
6 files changed, 41 insertions(+), 26 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c88a331..e3e446c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,20 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * aarch64-linux-tdep.c (aarch64_linux_init_abi): Fix size_sigaction,
+ size_sigset_t, size_old_sigaction, size_old_sigset_t.
+ * amd64-linux-tdep.c (amd64_linux_init_abi): Fix size_sigaction,
+ size_sigset_t, size_old_sigaction, size_old_sigset_t.
+ (amd64_x32_linux_init_abi): Fix size_sigaction, size_sigset_t,
+ size_old_sigaction, size_old_sigset_t.
+ * arm-linux-tdep.c (arm_linux_init_abi): Fix size_sigaction,
+ size_old_sigaction, size_old_sigset_t.
+ * i386-linux-tdep.c (i386_linux_init_abi): Fix size_sigaction,
+ size_old_sigaction, size_old_sigset_t.
+ * ppc-linux-tdep.c (ppc_init_linux_record_tdep): Fix size_sigaction,
+ size_sigset_t, size_old_sigaction, size_old_sigset_t.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* arm-linux-tdep.c (arm_linux_init_abi): Fix size_[ug]id.
* i386-linux-tdep.c (i386_linux_init_abi): Fix size_[ug]id.
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 4169200..57cb973 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1000,8 +1000,8 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_flock = 32;
aarch64_linux_record_tdep.size_oldold_utsname = 45;
aarch64_linux_record_tdep.size_ustat = 32;
- aarch64_linux_record_tdep.size_old_sigaction = 152;
- aarch64_linux_record_tdep.size_old_sigset_t = 128;
+ aarch64_linux_record_tdep.size_old_sigaction = 32;
+ aarch64_linux_record_tdep.size_old_sigset_t = 8;
aarch64_linux_record_tdep.size_rlimit = 16;
aarch64_linux_record_tdep.size_rusage = 144;
aarch64_linux_record_tdep.size_timeval = 16;
@@ -1037,8 +1037,8 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_NFS_FHSIZE = 32;
aarch64_linux_record_tdep.size_knfsd_fh = 132;
aarch64_linux_record_tdep.size_TASK_COMM_LEN = 16;
- aarch64_linux_record_tdep.size_sigaction = 152;
- aarch64_linux_record_tdep.size_sigset_t = 128;
+ aarch64_linux_record_tdep.size_sigaction = 32;
+ aarch64_linux_record_tdep.size_sigset_t = 8;
aarch64_linux_record_tdep.size_siginfo_t = 128;
aarch64_linux_record_tdep.size_cap_user_data_t = 8;
aarch64_linux_record_tdep.size_stack_t = 24;
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 59c318d..3bca3c8 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1890,10 +1890,10 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_linux_record_tdep.size_ustat = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigaction
but sys_rt_sigaction. */
- amd64_linux_record_tdep.size_old_sigaction = 152;
+ amd64_linux_record_tdep.size_old_sigaction = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigpending
but sys_rt_sigpending. */
- amd64_linux_record_tdep.size_old_sigset_t = 128;
+ amd64_linux_record_tdep.size_old_sigset_t = 8;
amd64_linux_record_tdep.size_rlimit = 16;
amd64_linux_record_tdep.size_rusage = 144;
amd64_linux_record_tdep.size_timeval = 16;
@@ -1933,8 +1933,8 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_linux_record_tdep.size_NFS_FHSIZE = 32;
amd64_linux_record_tdep.size_knfsd_fh = 132;
amd64_linux_record_tdep.size_TASK_COMM_LEN = 16;
- amd64_linux_record_tdep.size_sigaction = 152;
- amd64_linux_record_tdep.size_sigset_t = 128;
+ amd64_linux_record_tdep.size_sigaction = 32;
+ amd64_linux_record_tdep.size_sigset_t = 8;
amd64_linux_record_tdep.size_siginfo_t = 128;
amd64_linux_record_tdep.size_cap_user_data_t = 8;
amd64_linux_record_tdep.size_stack_t = 24;
@@ -2106,10 +2106,10 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_ustat = 32;
/* ADM64 doesn't need this size because it doesn't have sys_sigaction
but sys_rt_sigaction. */
- amd64_x32_linux_record_tdep.size_old_sigaction = 152;
+ amd64_x32_linux_record_tdep.size_old_sigaction = 16;
/* ADM64 doesn't need this size because it doesn't have sys_sigpending
but sys_rt_sigpending. */
- amd64_x32_linux_record_tdep.size_old_sigset_t = 128;
+ amd64_x32_linux_record_tdep.size_old_sigset_t = 4;
amd64_x32_linux_record_tdep.size_rlimit = 16;
amd64_x32_linux_record_tdep.size_rusage = 144;
amd64_x32_linux_record_tdep.size_timeval = 16;
@@ -2149,8 +2149,8 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_NFS_FHSIZE = 32;
amd64_x32_linux_record_tdep.size_knfsd_fh = 132;
amd64_x32_linux_record_tdep.size_TASK_COMM_LEN = 16;
- amd64_x32_linux_record_tdep.size_sigaction = 152;
- amd64_x32_linux_record_tdep.size_sigset_t = 128;
+ amd64_x32_linux_record_tdep.size_sigaction = 20;
+ amd64_x32_linux_record_tdep.size_sigset_t = 8;
amd64_x32_linux_record_tdep.size_siginfo_t = 128;
amd64_x32_linux_record_tdep.size_cap_user_data_t = 8;
amd64_x32_linux_record_tdep.size_stack_t = 24;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 940f01f..88d818d 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1487,8 +1487,8 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_flock = 16;
arm_linux_record_tdep.size_oldold_utsname = 45;
arm_linux_record_tdep.size_ustat = 20;
- arm_linux_record_tdep.size_old_sigaction = 140;
- arm_linux_record_tdep.size_old_sigset_t = 128;
+ arm_linux_record_tdep.size_old_sigaction = 16;
+ arm_linux_record_tdep.size_old_sigset_t = 4;
arm_linux_record_tdep.size_rlimit = 8;
arm_linux_record_tdep.size_rusage = 72;
arm_linux_record_tdep.size_timeval = 8;
@@ -1524,7 +1524,7 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_NFS_FHSIZE = 32;
arm_linux_record_tdep.size_knfsd_fh = 132;
arm_linux_record_tdep.size_TASK_COMM_LEN = 16;
- arm_linux_record_tdep.size_sigaction = 140;
+ arm_linux_record_tdep.size_sigaction = 20;
arm_linux_record_tdep.size_sigset_t = 8;
arm_linux_record_tdep.size_siginfo_t = 128;
arm_linux_record_tdep.size_cap_user_data_t = 12;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index af9c28a..0bf2cdc 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -806,8 +806,8 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_flock = 16;
i386_linux_record_tdep.size_oldold_utsname = 45;
i386_linux_record_tdep.size_ustat = 20;
- i386_linux_record_tdep.size_old_sigaction = 140;
- i386_linux_record_tdep.size_old_sigset_t = 128;
+ i386_linux_record_tdep.size_old_sigaction = 16;
+ i386_linux_record_tdep.size_old_sigset_t = 4;
i386_linux_record_tdep.size_rlimit = 8;
i386_linux_record_tdep.size_rusage = 72;
i386_linux_record_tdep.size_timeval = 8;
@@ -843,7 +843,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_NFS_FHSIZE = 32;
i386_linux_record_tdep.size_knfsd_fh = 132;
i386_linux_record_tdep.size_TASK_COMM_LEN = 16;
- i386_linux_record_tdep.size_sigaction = 140;
+ i386_linux_record_tdep.size_sigaction = 20;
i386_linux_record_tdep.size_sigset_t = 8;
i386_linux_record_tdep.size_siginfo_t = 128;
i386_linux_record_tdep.size_cap_user_data_t = 12;
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 79d115e..896f410 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1423,8 +1423,8 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_flock = 32;
record_tdep->size_oldold_utsname = 45;
record_tdep->size_ustat = 32;
- record_tdep->size_old_sigaction = 152;
- record_tdep->size_old_sigset_t = 128;
+ record_tdep->size_old_sigaction = 32;
+ record_tdep->size_old_sigset_t = 8;
record_tdep->size_rlimit = 16;
record_tdep->size_rusage = 144;
record_tdep->size_timeval = 16;
@@ -1457,8 +1457,8 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_NFS_FHSIZE = 32;
record_tdep->size_knfsd_fh = 132;
record_tdep->size_TASK_COMM_LEN = 32;
- record_tdep->size_sigaction = 152;
- record_tdep->size_sigset_t = 128;
+ record_tdep->size_sigaction = 32;
+ record_tdep->size_sigset_t = 8;
record_tdep->size_siginfo_t = 128;
record_tdep->size_cap_user_data_t = 8;
record_tdep->size_stack_t = 24;
@@ -1490,8 +1490,8 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_flock = 16;
record_tdep->size_oldold_utsname = 45;
record_tdep->size_ustat = 20;
- record_tdep->size_old_sigaction = 152;
- record_tdep->size_old_sigset_t = 128;
+ record_tdep->size_old_sigaction = 16;
+ record_tdep->size_old_sigset_t = 4;
record_tdep->size_rlimit = 8;
record_tdep->size_rusage = 72;
record_tdep->size_timeval = 8;
@@ -1524,8 +1524,8 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_NFS_FHSIZE = 32;
record_tdep->size_knfsd_fh = 132;
record_tdep->size_TASK_COMM_LEN = 32;
- record_tdep->size_sigaction = 140;
- record_tdep->size_sigset_t = 128;
+ record_tdep->size_sigaction = 20;
+ record_tdep->size_sigset_t = 8;
record_tdep->size_siginfo_t = 128;
record_tdep->size_cap_user_data_t = 4;
record_tdep->size_stack_t = 12;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 06/13] gdb/linux-record: Fix msghdr parsing on 64-bit targets
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (5 preceding siblings ...)
2015-10-22 13:51 ` [PATCH v2 04/13] gdb/linux-record: Fix sizes of sigaction and sigset_t Marcin Kościelnicki
@ 2015-10-22 13:51 ` Marcin Kościelnicki
2015-10-22 13:55 ` [PATCH v2 07/13] gdb/linux-record: Support time, waitpid, pipe syscalls Marcin Kościelnicki
` (5 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:51 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
The code failed to account for padding between the int and subsequent
pointer present on 64-bit architectures.
gdb/ChangeLog:
* linux-record.c (record_linux_msghdr): Fix msg_namelen handling.
---
gdb/ChangeLog | 4 ++++
gdb/linux-record.c | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9e128a5..c7796c9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * linux-record.c (record_linux_msghdr): Fix msg_namelen handling.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove
size_dirent{,64}, add size_old_dirent.
* amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_dirent{,64},
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index e950e8d..8832ef4 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -162,7 +162,9 @@ record_linux_msghdr (struct regcache *regcache,
tdep->size_int,
byte_order)))
return -1;
- a += tdep->size_int;
+ /* We have read an int, but skip size_pointer bytes to account for alignment
+ of the next field on 64-bit targets. */
+ a += tdep->size_pointer;
/* msg_iov msg_iovlen */
addr = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 07/13] gdb/linux-record: Support time, waitpid, pipe syscalls
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (6 preceding siblings ...)
2015-10-22 13:51 ` [PATCH v2 06/13] gdb/linux-record: Fix msghdr parsing on 64-bit targets Marcin Kościelnicki
@ 2015-10-22 13:55 ` Marcin Kościelnicki
2015-10-22 14:32 ` [PATCH v2 02/13] gdb/linux-record: Remove size_siginfo Marcin Kościelnicki
` (4 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 13:55 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
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.
---
gdb/ChangeLog | 12 ++++++++++++
gdb/aarch64-linux-tdep.c | 1 +
gdb/amd64-linux-tdep.c | 2 ++
gdb/arm-linux-tdep.c | 1 +
gdb/i386-linux-tdep.c | 1 +
gdb/linux-record.c | 23 +++++++++++++++++++++++
gdb/linux-record.h | 1 +
gdb/ppc-linux-tdep.c | 2 ++
8 files changed, 43 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c7796c9..ce717ae 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,17 @@
2015-10-22 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-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* linux-record.c (record_linux_msghdr): Fix msg_namelen handling.
2015-10-22 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"));
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 02/13] gdb/linux-record: Remove size_siginfo
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (7 preceding siblings ...)
2015-10-22 13:55 ` [PATCH v2 07/13] gdb/linux-record: Support time, waitpid, pipe syscalls Marcin Kościelnicki
@ 2015-10-22 14:32 ` Marcin Kościelnicki
2015-10-22 15:01 ` [PATCH v2 08/13] gdb/linux-record: Fix [gs]etgroups16 syscall Marcin Kościelnicki
` (3 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 14:32 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
It's a duplicate of size_siginfo_t.
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove size_siginfo.
* amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_siginfo.
(amd64_x32_linux_init_abi): Remove size_siginfo.
* arm-linux-tdep.c (arm_linux_init_abi): Remove size_siginfo.
* i386-linux-tdep.c (i386_linux_init_abi): Remove size_siginfo.
* linux-record.c (record_linux_system_call): Change size_siginfo
to size_siginfo_t.
* linux-record.h (struct linux_record_tdep): Remove size_siginfo.
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Remove size_siginfo.
---
gdb/ChangeLog | 12 ++++++++++++
gdb/aarch64-linux-tdep.c | 1 -
gdb/amd64-linux-tdep.c | 2 --
gdb/arm-linux-tdep.c | 1 -
gdb/i386-linux-tdep.c | 1 -
gdb/linux-record.c | 2 +-
gdb/linux-record.h | 1 -
gdb/ppc-linux-tdep.c | 2 --
8 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1d3f683..128ee16 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
+ * aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove size_siginfo.
+ * amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_siginfo.
+ (amd64_x32_linux_init_abi): Remove size_siginfo.
+ * arm-linux-tdep.c (arm_linux_init_abi): Remove size_siginfo.
+ * i386-linux-tdep.c (i386_linux_init_abi): Remove size_siginfo.
+ * linux-record.c (record_linux_system_call): Change size_siginfo
+ to size_siginfo_t.
+ * linux-record.h (struct linux_record_tdep): Remove size_siginfo.
+ * ppc-linux-tdep.c (ppc_init_linux_record_tdep): Remove size_siginfo.
+
2015-10-21 Simon Marchi <simon.marchi@polymtl.ca>
PR python/18073
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 2204c92..4169200 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1054,7 +1054,6 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_epoll_event = 12;
aarch64_linux_record_tdep.size_itimerspec = 32;
aarch64_linux_record_tdep.size_mq_attr = 64;
- aarch64_linux_record_tdep.size_siginfo = 128;
aarch64_linux_record_tdep.size_termios = 60;
aarch64_linux_record_tdep.size_termios2 = 44;
aarch64_linux_record_tdep.size_pid_t = 4;
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 021dca6..59c318d 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1950,7 +1950,6 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_linux_record_tdep.size_epoll_event = 12;
amd64_linux_record_tdep.size_itimerspec = 32;
amd64_linux_record_tdep.size_mq_attr = 64;
- amd64_linux_record_tdep.size_siginfo = 128;
amd64_linux_record_tdep.size_termios = 60;
amd64_linux_record_tdep.size_termios2 = 44;
amd64_linux_record_tdep.size_pid_t = 4;
@@ -2167,7 +2166,6 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_x32_linux_record_tdep.size_epoll_event = 12;
amd64_x32_linux_record_tdep.size_itimerspec = 32;
amd64_x32_linux_record_tdep.size_mq_attr = 64;
- amd64_x32_linux_record_tdep.size_siginfo = 128;
amd64_x32_linux_record_tdep.size_termios = 60;
amd64_x32_linux_record_tdep.size_termios2 = 44;
amd64_x32_linux_record_tdep.size_pid_t = 4;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index dc0a8a9..4a100c8 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1542,7 +1542,6 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_itimerspec
= arm_linux_record_tdep.size_timespec * 2;
arm_linux_record_tdep.size_mq_attr = 32;
- arm_linux_record_tdep.size_siginfo = 128;
arm_linux_record_tdep.size_termios = 36;
arm_linux_record_tdep.size_termios2 = 44;
arm_linux_record_tdep.size_pid_t = 4;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index d02c527..8dce146 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -861,7 +861,6 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_itimerspec
= i386_linux_record_tdep.size_timespec * 2;
i386_linux_record_tdep.size_mq_attr = 32;
- i386_linux_record_tdep.size_siginfo = 128;
i386_linux_record_tdep.size_termios = 36;
i386_linux_record_tdep.size_termios2 = 44;
i386_linux_record_tdep.size_pid_t = 4;
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 5873365..d1e02f4 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -2092,7 +2092,7 @@ Do you want to stop the program?"),
case gdb_sys_waitid:
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_siginfo))
+ tdep->size_siginfo_t))
return -1;
regcache_raw_read_unsigned (regcache, tdep->arg5, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
diff --git a/gdb/linux-record.h b/gdb/linux-record.h
index 6d29985..839bd31 100644
--- a/gdb/linux-record.h
+++ b/gdb/linux-record.h
@@ -81,7 +81,6 @@ struct linux_record_tdep
int size_epoll_event;
int size_itimerspec;
int size_mq_attr;
- int size_siginfo;
int size_termios;
int size_termios2;
int size_pid_t;
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 460c503..79d115e 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1473,7 +1473,6 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_epoll_event = 16;
record_tdep->size_itimerspec = 32;
record_tdep->size_mq_attr = 64;
- record_tdep->size_siginfo = 128;
record_tdep->size_termios = 44;
record_tdep->size_pid_t = 4;
record_tdep->size_winsize = 8;
@@ -1541,7 +1540,6 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_epoll_event = 16;
record_tdep->size_itimerspec = 16;
record_tdep->size_mq_attr = 32;
- record_tdep->size_siginfo = 128;
record_tdep->size_termios = 44;
record_tdep->size_pid_t = 4;
record_tdep->size_winsize = 8;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 08/13] gdb/linux-record: Fix [gs]etgroups16 syscall
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (8 preceding siblings ...)
2015-10-22 14:32 ` [PATCH v2 02/13] gdb/linux-record: Remove size_siginfo Marcin Kościelnicki
@ 2015-10-22 15:01 ` Marcin Kościelnicki
2015-10-22 15:06 ` [PATCH v2 05/13] gdb/linux-record: Fix readdir and getdents handling Marcin Kościelnicki
` (2 subsequent siblings)
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 15:01 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
Memory size for getgroups16 needs to be multiplied by entry count, and only
needs recording if the pointer is non-NULL. setgroups16, on the other hand,
doesn't write to user memory and doesn't need special handling at all.
gdb/ChangeLog:
* linux-record.c (record_linux_system_call): Fix [gs]etgroups16.
---
gdb/ChangeLog | 4 ++++
gdb/linux-record.c | 17 ++++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ce717ae..1c3cc04 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * linux-record.c (record_linux_system_call): Fix [gs]etgroups16.
+
+2015-10-22 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.
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index dbd8f14..25cbda1 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -628,16 +628,19 @@ record_linux_system_call (enum gdb_syscall syscall,
case gdb_sys_getgroups16:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
- if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_old_gid_t))
- return -1;
+ if (tmpulongest)
+ {
+ ULONGEST gidsetsize;
+
+ regcache_raw_read_unsigned (regcache, tdep->arg1,
+ &gidsetsize);
+ tmpint = tdep->size_old_gid_t * (int) gidsetsize;
+ if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, tmpint))
+ return -1;
+ }
break;
case gdb_sys_setgroups16:
- regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
- if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_old_gid_t))
- return -1;
break;
case gdb_old_select:
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 05/13] gdb/linux-record: Fix readdir and getdents handling
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (9 preceding siblings ...)
2015-10-22 15:01 ` [PATCH v2 08/13] gdb/linux-record: Fix [gs]etgroups16 syscall Marcin Kościelnicki
@ 2015-10-22 15:06 ` Marcin Kościelnicki
2015-10-22 15:07 ` [PATCH v2 09/13] gdb/linux-record: Fix newfstatat handling Marcin Kościelnicki
2015-10-29 13:03 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Pedro Alves
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 15:06 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
getdents buffer size is given in bytes, not dirent entries (which have
variable size anyway). We don't need size_dirent and size_dirent64 for
this reason.
readdir, on the other hand, needs size of old_linux_dirent, which is
a somewhat different structure. Accordingly, rename size_dirent
to size_old_dirent.
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove
size_dirent{,64}, add size_old_dirent.
* amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
(amd64_x32_linux_init_abi): Remove size_dirent{,64}, add
size_old_dirent.
* arm-linux-tdep.c (arm_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
* i386-linux-tdep.c (i386_linux_init_abi): Remove size_dirent{,64},
add size_old_dirent.
* linux-record.c (record_linux_system_call): Fix handling of readdir
and getdents{,64}.
* linux-record.h (struct linux_record_tdep): Remove size_dirent{,64},
add size_old_dirent.
* ppc-linux-tdep.c (ppc_init_linux_record_tdep): Remove
size_dirent{,64}, add size_old_dirent.
---
gdb/ChangeLog | 19 +++++++++++++++++++
gdb/aarch64-linux-tdep.c | 3 +--
gdb/amd64-linux-tdep.c | 8 ++++----
gdb/arm-linux-tdep.c | 3 +--
gdb/i386-linux-tdep.c | 3 +--
gdb/linux-record.c | 19 +++----------------
gdb/linux-record.h | 3 +--
gdb/ppc-linux-tdep.c | 6 ++----
8 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e3e446c..9e128a5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,24 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove
+ size_dirent{,64}, add size_old_dirent.
+ * amd64-linux-tdep.c (amd64_linux_init_abi): Remove size_dirent{,64},
+ add size_old_dirent.
+ (amd64_x32_linux_init_abi): Remove size_dirent{,64}, add
+ size_old_dirent.
+ * arm-linux-tdep.c (arm_linux_init_abi): Remove size_dirent{,64},
+ add size_old_dirent.
+ * i386-linux-tdep.c (i386_linux_init_abi): Remove size_dirent{,64},
+ add size_old_dirent.
+ * linux-record.c (record_linux_system_call): Fix handling of readdir
+ and getdents{,64}.
+ * linux-record.h (struct linux_record_tdep): Remove size_dirent{,64},
+ add size_old_dirent.
+ * ppc-linux-tdep.c (ppc_init_linux_record_tdep): Remove
+ size_dirent{,64}, add size_old_dirent.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Fix size_sigaction,
size_sigset_t, size_old_sigaction, size_old_sigset_t.
* amd64-linux-tdep.c (amd64_linux_init_abi): Fix size_sigaction,
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 57cb973..0a3fbb3 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -1009,8 +1009,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
aarch64_linux_record_tdep.size_old_gid_t = 2;
aarch64_linux_record_tdep.size_old_uid_t = 2;
aarch64_linux_record_tdep.size_fd_set = 128;
- aarch64_linux_record_tdep.size_dirent = 280;
- aarch64_linux_record_tdep.size_dirent64 = 280;
+ aarch64_linux_record_tdep.size_old_dirent = 280;
aarch64_linux_record_tdep.size_statfs = 120;
aarch64_linux_record_tdep.size_statfs64 = 120;
aarch64_linux_record_tdep.size_sockaddr = 16;
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 3bca3c8..0b068c3 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1905,8 +1905,8 @@ amd64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
but sys_getresuid. */
amd64_linux_record_tdep.size_old_uid_t = 2;
amd64_linux_record_tdep.size_fd_set = 128;
- amd64_linux_record_tdep.size_dirent = 280;
- amd64_linux_record_tdep.size_dirent64 = 280;
+ /* ADM64 doesn't need this size because it doesn't have sys_readdir. */
+ amd64_linux_record_tdep.size_old_dirent = 280;
amd64_linux_record_tdep.size_statfs = 120;
amd64_linux_record_tdep.size_statfs64 = 120;
amd64_linux_record_tdep.size_sockaddr = 16;
@@ -2121,8 +2121,8 @@ amd64_x32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
but sys_getresuid. */
amd64_x32_linux_record_tdep.size_old_uid_t = 2;
amd64_x32_linux_record_tdep.size_fd_set = 128;
- amd64_x32_linux_record_tdep.size_dirent = 280;
- amd64_x32_linux_record_tdep.size_dirent64 = 280;
+ /* ADM64 doesn't need this size because it doesn't have sys_readdir. */
+ amd64_x32_linux_record_tdep.size_old_dirent = 268;
amd64_x32_linux_record_tdep.size_statfs = 120;
amd64_x32_linux_record_tdep.size_statfs64 = 120;
amd64_x32_linux_record_tdep.size_sockaddr = 16;
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 88d818d..a820e74 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1496,8 +1496,7 @@ arm_linux_init_abi (struct gdbarch_info info,
arm_linux_record_tdep.size_old_gid_t = 2;
arm_linux_record_tdep.size_old_uid_t = 2;
arm_linux_record_tdep.size_fd_set = 128;
- arm_linux_record_tdep.size_dirent = 268;
- arm_linux_record_tdep.size_dirent64 = 276;
+ arm_linux_record_tdep.size_old_dirent = 268;
arm_linux_record_tdep.size_statfs = 64;
arm_linux_record_tdep.size_statfs64 = 84;
arm_linux_record_tdep.size_sockaddr = 16;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 0bf2cdc..8847ad3 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -815,8 +815,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
i386_linux_record_tdep.size_old_gid_t = 2;
i386_linux_record_tdep.size_old_uid_t = 2;
i386_linux_record_tdep.size_fd_set = 128;
- i386_linux_record_tdep.size_dirent = 268;
- i386_linux_record_tdep.size_dirent64 = 276;
+ i386_linux_record_tdep.size_old_dirent = 268;
i386_linux_record_tdep.size_statfs = 64;
i386_linux_record_tdep.size_statfs64 = 84;
i386_linux_record_tdep.size_sockaddr = 16;
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index d1e02f4..e950e8d 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -689,7 +689,7 @@ record_linux_system_call (enum gdb_syscall syscall,
case gdb_old_readdir:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_dirent))
+ tdep->size_old_dirent))
return -1;
break;
@@ -1344,14 +1344,14 @@ Do you want to stop the program?"),
break;
case gdb_sys_getdents:
+ case gdb_sys_getdents64:
{
ULONGEST count;
regcache_raw_read_unsigned (regcache, tdep->arg2,
&tmpulongest);
regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
- if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_dirent * count))
+ if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest, count))
return -1;
}
break;
@@ -1745,19 +1745,6 @@ Do you want to stop the program?"),
case gdb_sys_madvise:
break;
- case gdb_sys_getdents64:
- {
- ULONGEST count;
-
- regcache_raw_read_unsigned (regcache, tdep->arg2,
- &tmpulongest);
- regcache_raw_read_unsigned (regcache, tdep->arg3, &count);
- if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
- tdep->size_dirent64 * count))
- return -1;
- }
- break;
-
case gdb_sys_fcntl64:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
if (tmpulongest == tdep->fcntl_F_GETLK64)
diff --git a/gdb/linux-record.h b/gdb/linux-record.h
index 839bd31..9af0bdb 100644
--- a/gdb/linux-record.h
+++ b/gdb/linux-record.h
@@ -39,8 +39,7 @@ struct linux_record_tdep
int size_old_gid_t;
int size_old_uid_t;
int size_fd_set;
- int size_dirent;
- int size_dirent64;
+ int size_old_dirent;
int size_statfs;
int size_statfs64;
int size_sockaddr;
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 896f410..cf71cf3 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1432,8 +1432,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_old_gid_t = 4;
record_tdep->size_old_uid_t = 4;
record_tdep->size_fd_set = 128;
- record_tdep->size_dirent = 280;
- record_tdep->size_dirent64 = 280;
+ record_tdep->size_old_dirent = 280;
record_tdep->size_statfs = 120;
record_tdep->size_statfs64 = 120;
record_tdep->size_sockaddr = 16;
@@ -1499,8 +1498,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep,
record_tdep->size_old_gid_t = 4;
record_tdep->size_old_uid_t = 4;
record_tdep->size_fd_set = 128;
- record_tdep->size_dirent = 268;
- record_tdep->size_dirent64 = 280;
+ record_tdep->size_old_dirent = 268;
record_tdep->size_statfs = 64;
record_tdep->size_statfs64 = 88;
record_tdep->size_sockaddr = 16;
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 09/13] gdb/linux-record: Fix newfstatat handling
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (10 preceding siblings ...)
2015-10-22 15:06 ` [PATCH v2 05/13] gdb/linux-record: Fix readdir and getdents handling Marcin Kościelnicki
@ 2015-10-22 15:07 ` Marcin Kościelnicki
2015-10-29 13:03 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Pedro Alves
12 siblings, 0 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-22 15:07 UTC (permalink / raw)
To: palves, qiyaoltc; +Cc: gdb-patches, Marcin Kościelnicki
The struct stat pointer is in the third argument, not the second.
gdb/ChangeLog:
* linux-record.c (record_linux_system_call): Fix newstatat.
---
gdb/ChangeLog | 4 ++++
gdb/linux-record.c | 8 +++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1c3cc04..e3afacd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * linux-record.c (record_linux_system_call): Fix newstatat.
+
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* linux-record.c (record_linux_system_call): Fix [gs]etgroups16.
2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 25cbda1..9f38c0b 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -1112,13 +1112,19 @@ Do you want to stop the program?"),
case gdb_sys_newstat:
case gdb_sys_newlstat:
case gdb_sys_newfstat:
- case gdb_sys_newfstatat:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
tdep->size_stat))
return -1;
break;
+ case gdb_sys_newfstatat:
+ regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
+ if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
+ tdep->size_stat))
+ return -1;
+ break;
+
case gdb_sys_uname:
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
--
2.6.1
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls.
2015-10-29 13:03 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Pedro Alves
@ 2015-10-29 13:03 ` Marcin Kościelnicki
2015-10-30 14:52 ` Pedro Alves
2015-10-30 10:36 ` Marcin Kościelnicki
2015-10-30 10:37 ` [PATCH 01/13] gdb/record: Add testcases for a few syscalls Marcin Kościelnicki
2 siblings, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-29 13:03 UTC (permalink / raw)
To: Pedro Alves, qiyaoltc; +Cc: gdb-patches
On 29/10/15 12:30, Pedro Alves wrote:
> On 10/22/2015 02:39 PM, Marcin KoÅcielnicki wrote:
>> gdb/testsuite/ChangeLog:
>>
>> * gdb.reverse/linux-fstatat-reverse.c: New test.
>> * gdb.reverse/linux-fstatat-reverse.exp: New file.
>> * gdb.reverse/linux-getresuid-reverse.c: New test.
>> * gdb.reverse/linux-getresuid-reverse.exp: New file.
>> * gdb.reverse/linux-pipe-reverse.c: New test.
>> * gdb.reverse/linux-pipe-reverse.exp: New file.
>> * gdb.reverse/linux-readv-reverse.c: New test.
>> * gdb.reverse/linux-readv-reverse.exp: New file.
>> * gdb.reverse/linux-recvmsg-reverse.c: New test.
>> * gdb.reverse/linux-recvmsg-reverse.exp: New file.
>> * gdb.reverse/linux-time-reverse.c: New test.
>> * gdb.reverse/linux-time-reverse.exp: New file.
>> * gdb.reverse/linux-waitpid-reverse.c: New test.
>> * gdb.reverse/linux-waitpid-reverse.exp: New file.
>
> Excellent, thank you!
>
> I ran your tests against pristine/unfixed gdb, and linux-readv-reverse.exp
> passes cleanly. This is on x86_64. Is that expected? The comments in
> the test seem to suggest it would fail.
That's expected. The test would only fail for x32 ABI, since it had the
wrong size_iov, size_pointer, size_size_t.
>
>> +++ b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.c
>> @@ -0,0 +1,39 @@
>> +/* This testcase is part of GDB, the GNU debugger.
>> +
>> + Copyright 2008-2015 Free Software Foundation, Inc.
>> +
>> + This program is free software; you can redistribute it and/or modify
>> + it under the terms of the GNU General Public License as published by
>> + the Free Software Foundation; either version 3 of the License, or
>> + (at your option) any later version.
>> +
>> + This program is distributed in the hope that it will be useful,
>> + but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + GNU General Public License for more details.
>> +
>> + You should have received a copy of the GNU General Public License
>> + along with this program. If not, see <http://www.gnu.org/licenses/>. */
>> +
>> +#define _GNU_SOURCE
>> +#include <unistd.h>
>> +#include <fcntl.h>
>> +#include <sys/stat.h>
>> +
>> +void marker1 ()
>
> We follow GNU formatting in tests too, unless there's a good
> reason not to. So, line break after void. Also, this is C,
> so write "(void)" for parameters. Thus:
>
> void
> marker1 (void)
> {
OK.
>
>> +{
>> +}
>> +
>> +void marker2 ()
>
> Likewise.
>
>> +{
>> +}
>> +
>> +struct stat buf;
>> +
>> +int main() {
>
> int
> main ()
> {
>
Not int main(void)?
>
>> + marker1();
>> + int fd = open("/", O_PATH);
>> + fstatat(fd, ".", &buf, 0);
>> + marker2();
>
> Space before parens.
>
> Several of the test programs have non-conforming indentation too.
OK.
>
>> + return 0;
>> +}
>> diff --git a/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp
>> new file mode 100644
>> index 0000000..23652e4
>> --- /dev/null
>> +++ b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp
>> @@ -0,0 +1,63 @@
>> +# Copyright 2015 Free Software Foundation, Inc.
>> +
>> +# This program is free software; you can redistribute it and/or modify
>> +# it under the terms of the GNU General Public License as published by
>> +# the Free Software Foundation; either version 3 of the License, or
>> +# (at your option) any later version.
>> +#
>> +# This program is distributed in the hope that it will be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
>> +
>> +# This file is part of the gdb testsuite.
>> +
>> +#
>> +# This test tests linux fstatat syscall for reverse execution.
>
> Linux, uppercase. But,
>
>> +#
>> +
>> +if ![supports_reverse] {
>> + return
>> +}
>> +
>> +
>> +if ![istarget "*linux*"] then {
>> + verbose "Skipping linux syscall reverse tests."
>> + return
>> +}
>
> ... I think most of these tests could/should drop this target check,
> and drop the "linux-" in the filename as well. Any target/port
> that supports record/reverse execution should be able to run
> this, as long as it manages to compile the test program. And if the
> test program doesn't compile in such a port, it'll be automatically
> skipped.
OK. So a testcase that doesn't compile is not a problem? Because I
just noticed the time test doesn't compile on platforms that don't have
a time syscall, like s390x...
>
>> +
>> +gdb_test "break marker1" \
>> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
>> + "set breakpoint at marker1"
>> +
>> +gdb_test "break marker2" \
>> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
>> + "set breakpoint at marker2"
>> +
>> +gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
>> +
>> +gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
>
> Most (all?) these tests run to marker1 and then immediately to
> marker2. Can't they just continue to marker2 directly?
OK, I'll fix that.
>
>> +++ b/gdb/testsuite/gdb.reverse/linux-waitpid-reverse.exp
>
> ...
>
>> +# will be remembered. If not, new contents (status) will be # used, and
>
> Spurious # after "will be".
>
>> +# the test will fail.
>> +
>> +gdb_test "print status" ".* = -1" "check waitpid record"
>
> Thanks,
> Pedro Alves
>
Thanks for the review, I'll resend a fixed version.
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls.
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
` (11 preceding siblings ...)
2015-10-22 15:07 ` [PATCH v2 09/13] gdb/linux-record: Fix newfstatat handling Marcin Kościelnicki
@ 2015-10-29 13:03 ` Pedro Alves
2015-10-29 13:03 ` Marcin Kościelnicki
` (2 more replies)
12 siblings, 3 replies; 49+ messages in thread
From: Pedro Alves @ 2015-10-29 13:03 UTC (permalink / raw)
To: Marcin Kościelnicki, qiyaoltc; +Cc: gdb-patches
On 10/22/2015 02:39 PM, Marcin KoÅcielnicki wrote:
> gdb/testsuite/ChangeLog:
>
> * gdb.reverse/linux-fstatat-reverse.c: New test.
> * gdb.reverse/linux-fstatat-reverse.exp: New file.
> * gdb.reverse/linux-getresuid-reverse.c: New test.
> * gdb.reverse/linux-getresuid-reverse.exp: New file.
> * gdb.reverse/linux-pipe-reverse.c: New test.
> * gdb.reverse/linux-pipe-reverse.exp: New file.
> * gdb.reverse/linux-readv-reverse.c: New test.
> * gdb.reverse/linux-readv-reverse.exp: New file.
> * gdb.reverse/linux-recvmsg-reverse.c: New test.
> * gdb.reverse/linux-recvmsg-reverse.exp: New file.
> * gdb.reverse/linux-time-reverse.c: New test.
> * gdb.reverse/linux-time-reverse.exp: New file.
> * gdb.reverse/linux-waitpid-reverse.c: New test.
> * gdb.reverse/linux-waitpid-reverse.exp: New file.
Excellent, thank you!
I ran your tests against pristine/unfixed gdb, and linux-readv-reverse.exp
passes cleanly. This is on x86_64. Is that expected? The comments in
the test seem to suggest it would fail.
> +++ b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.c
> @@ -0,0 +1,39 @@
> +/* This testcase is part of GDB, the GNU debugger.
> +
> + Copyright 2008-2015 Free Software Foundation, Inc.
> +
> + This program is free software; you can redistribute it and/or modify
> + it under the terms of the GNU General Public License as published by
> + the Free Software Foundation; either version 3 of the License, or
> + (at your option) any later version.
> +
> + This program is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + GNU General Public License for more details.
> +
> + You should have received a copy of the GNU General Public License
> + along with this program. If not, see <http://www.gnu.org/licenses/>. */
> +
> +#define _GNU_SOURCE
> +#include <unistd.h>
> +#include <fcntl.h>
> +#include <sys/stat.h>
> +
> +void marker1 ()
We follow GNU formatting in tests too, unless there's a good
reason not to. So, line break after void. Also, this is C,
so write "(void)" for parameters. Thus:
void
marker1 (void)
{
> +{
> +}
> +
> +void marker2 ()
Likewise.
> +{
> +}
> +
> +struct stat buf;
> +
> +int main() {
int
main ()
{
> + marker1();
> + int fd = open("/", O_PATH);
> + fstatat(fd, ".", &buf, 0);
> + marker2();
Space before parens.
Several of the test programs have non-conforming indentation too.
> + return 0;
> +}
> diff --git a/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp
> new file mode 100644
> index 0000000..23652e4
> --- /dev/null
> +++ b/gdb/testsuite/gdb.reverse/linux-fstatat-reverse.exp
> @@ -0,0 +1,63 @@
> +# Copyright 2015 Free Software Foundation, Inc.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program. If not, see <http://www.gnu.org/licenses/>.
> +
> +# This file is part of the gdb testsuite.
> +
> +#
> +# This test tests linux fstatat syscall for reverse execution.
Linux, uppercase. But,
> +#
> +
> +if ![supports_reverse] {
> + return
> +}
> +
> +
> +if ![istarget "*linux*"] then {
> + verbose "Skipping linux syscall reverse tests."
> + return
> +}
... I think most of these tests could/should drop this target check,
and drop the "linux-" in the filename as well. Any target/port
that supports record/reverse execution should be able to run
this, as long as it manages to compile the test program. And if the
test program doesn't compile in such a port, it'll be automatically
skipped.
> +
> +gdb_test "break marker1" \
> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
> + "set breakpoint at marker1"
> +
> +gdb_test "break marker2" \
> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
> + "set breakpoint at marker2"
> +
> +gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
> +
> +gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
Most (all?) these tests run to marker1 and then immediately to
marker2. Can't they just continue to marker2 directly?
> +++ b/gdb/testsuite/gdb.reverse/linux-waitpid-reverse.exp
...
> +# will be remembered. If not, new contents (status) will be # used, and
Spurious # after "will be".
> +# the test will fail.
> +
> +gdb_test "print status" ".* = -1" "check waitpid record"
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: gdb/linux-record fixes
2015-10-29 13:03 ` gdb/linux-record fixes Pedro Alves
@ 2015-10-29 13:03 ` Pedro Alves
0 siblings, 0 replies; 49+ messages in thread
From: Pedro Alves @ 2015-10-29 13:03 UTC (permalink / raw)
To: Marcin Kościelnicki, Yao Qi; +Cc: gdb-patches
On 10/29/2015 11:30 AM, Pedro Alves wrote:
> On 10/22/2015 02:34 PM, Marcin KoÅcielnicki wrote:
>> On 20/10/15 13:15, Marcin KoÅcielnicki wrote:
>>> On 20/10/15 13:07, Pedro Alves wrote:
>>>> On 10/19/2015 06:17 PM, Marcin KoÅcielnicki wrote:
>>>>
>>>>> Yeah, they're not covered by the testsuite. Actually, there seem to be
>>>>> only two tests in gdb.reverse suite that even touch syscalls:
>>>>> sigall-reverse (signal, sigprocmask, exit_group) and watch-reverse
>>>>> (read, write). No wonder that syscall handling is buggy...
>>>>>
>>>>> Stepping forward and backward over pipe/time/waitpid would indeed do the
>>>>> trick for patch #6.
>>>>
>>>> Can I convince you to add that to the patch (and likewise to others that
>>>> might not be overly hard)?
>>>
>>> I'll do that, if I'm not overcome by dejaGNU... I have no idea how that
>>> stuff works at the moment.
>>>
>>>> BTW, you'll also need to include ChangeLog entries. Please check here:
>>>>
>>>> https://sourceware.org/gdb/wiki/ContributionChecklist
>>>
>>> OK, will do.
>>>
>>
>> Here comes v2:
>
> Many thanks for this.
I sent comments to the test patch. Nothing major, they're almost ready.
And then read patches 2-13, and they all look good to me.
Thanks again for working on this.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: gdb/linux-record fixes
2015-10-22 13:39 ` Marcin Kościelnicki
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
@ 2015-10-29 13:03 ` Pedro Alves
2015-10-29 13:03 ` Pedro Alves
1 sibling, 1 reply; 49+ messages in thread
From: Pedro Alves @ 2015-10-29 13:03 UTC (permalink / raw)
To: Marcin Kościelnicki, Yao Qi; +Cc: gdb-patches
On 10/22/2015 02:34 PM, Marcin KoÅcielnicki wrote:
> On 20/10/15 13:15, Marcin KoÅcielnicki wrote:
>> On 20/10/15 13:07, Pedro Alves wrote:
>>> On 10/19/2015 06:17 PM, Marcin KoÅcielnicki wrote:
>>>
>>>> Yeah, they're not covered by the testsuite. Actually, there seem to be
>>>> only two tests in gdb.reverse suite that even touch syscalls:
>>>> sigall-reverse (signal, sigprocmask, exit_group) and watch-reverse
>>>> (read, write). No wonder that syscall handling is buggy...
>>>>
>>>> Stepping forward and backward over pipe/time/waitpid would indeed do the
>>>> trick for patch #6.
>>>
>>> Can I convince you to add that to the patch (and likewise to others that
>>> might not be overly hard)?
>>
>> I'll do that, if I'm not overcome by dejaGNU... I have no idea how that
>> stuff works at the moment.
>>
>>> BTW, you'll also need to include ChangeLog entries. Please check here:
>>>
>>> https://sourceware.org/gdb/wiki/ContributionChecklist
>>
>> OK, will do.
>>
>
> Here comes v2:
Many thanks for this.
>
> - ChangeLog entries added
> - I've split the last patch in two (termios and x32)
> - test cases are included that exercise #2 (getresuid), #5 (readmsg), #6
> (time, waitpid, pipe), #8 (fstatat), #12 (readv); testing the rest would
> be rather contrived
>
> Unfortunately, my waitpid test appears to trigger another bug - going
> over a fork with a breakpoint active while recording causes an error:
>
> record-full.c:1716: internal-error: record_full_remove_breakpoint:
> removing unknown breakpoint
Indeed, I ran your tests and I see that too.
> I'll try to debug this problem this weekend. Should I remove the
> waitpid test from this patchset for now, or mark it as an expected-fail
> somehow?
You can mark it known failure with setup_kfail (kfail == known gdb failure).
You'll just need to file a bug in bugzilla in order to have a PR number to
attach to the kfail.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls.
2015-10-29 13:03 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Pedro Alves
2015-10-29 13:03 ` Marcin Kościelnicki
@ 2015-10-30 10:36 ` Marcin Kościelnicki
2015-10-30 15:05 ` Pedro Alves
2015-10-30 10:37 ` [PATCH 01/13] gdb/record: Add testcases for a few syscalls Marcin Kościelnicki
2 siblings, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-30 10:36 UTC (permalink / raw)
To: Pedro Alves, qiyaoltc; +Cc: gdb-patches
>> +
>> +gdb_test "break marker1" \
>> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
>> + "set breakpoint at marker1"
>> +
>> +gdb_test "break marker2" \
>> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
>> + "set breakpoint at marker2"
>> +
>> +gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
>> +
>> +gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
>
> Most (all?) these tests run to marker1 and then immediately to
> marker2. Can't they just continue to marker2 directly?
>
Huh. I've done that and, funnily enough, the waitpid testcase magically
started to pass. For the record, I've reported the bug here:
https://sourceware.org/bugzilla/show_bug.cgi?id=19187
I guess there won't be a KFAIL after all.
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 01/13] gdb/record: Add testcases for a few syscalls.
2015-10-29 13:03 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Pedro Alves
2015-10-29 13:03 ` Marcin Kościelnicki
2015-10-30 10:36 ` Marcin Kościelnicki
@ 2015-10-30 10:37 ` Marcin Kościelnicki
2015-10-30 15:41 ` Pedro Alves
2 siblings, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-30 10:37 UTC (permalink / raw)
To: gdb-patches; +Cc: Marcin Kościelnicki
gdb/testsuite/ChangeLog:
* gdb.reverse/fstatat-reverse.c: New test.
* gdb.reverse/fstatat-reverse.exp: New file.
* gdb.reverse/getresuid-reverse.c: New test.
* gdb.reverse/getresuid-reverse.exp: New file.
* gdb.reverse/pipe-reverse.c: New test.
* gdb.reverse/pipe-reverse.exp: New file.
* gdb.reverse/readv-reverse.c: New test.
* gdb.reverse/readv-reverse.exp: New file.
* gdb.reverse/recvmsg-reverse.c: New test.
* gdb.reverse/recvmsg-reverse.exp: New file.
* gdb.reverse/time-reverse.c: New test.
* gdb.reverse/time-reverse.exp: New file.
* gdb.reverse/waitpid-reverse.c: New test.
* gdb.reverse/waitpid-reverse.exp: New file.
---
Fixed per your comments.
gdb/testsuite/ChangeLog | 17 +++++
gdb/testsuite/gdb.reverse/fstatat-reverse.c | 43 +++++++++++
gdb/testsuite/gdb.reverse/fstatat-reverse.exp | 55 +++++++++++++++
gdb/testsuite/gdb.reverse/getresuid-reverse.c | 42 +++++++++++
gdb/testsuite/gdb.reverse/getresuid-reverse.exp | 62 ++++++++++++++++
gdb/testsuite/gdb.reverse/pipe-reverse.c | 39 ++++++++++
gdb/testsuite/gdb.reverse/pipe-reverse.exp | 55 +++++++++++++++
gdb/testsuite/gdb.reverse/readv-reverse.c | 50 +++++++++++++
gdb/testsuite/gdb.reverse/readv-reverse.exp | 58 +++++++++++++++
gdb/testsuite/gdb.reverse/recvmsg-reverse.c | 94 +++++++++++++++++++++++++
gdb/testsuite/gdb.reverse/recvmsg-reverse.exp | 65 +++++++++++++++++
gdb/testsuite/gdb.reverse/time-reverse.c | 42 +++++++++++
gdb/testsuite/gdb.reverse/time-reverse.exp | 55 +++++++++++++++
gdb/testsuite/gdb.reverse/waitpid-reverse.c | 45 ++++++++++++
gdb/testsuite/gdb.reverse/waitpid-reverse.exp | 55 +++++++++++++++
15 files changed, 777 insertions(+)
create mode 100644 gdb/testsuite/gdb.reverse/fstatat-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/fstatat-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/getresuid-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/getresuid-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/pipe-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/pipe-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/readv-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/readv-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/recvmsg-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/time-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/time-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/waitpid-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/waitpid-reverse.exp
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1313aa2..07ec548 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,20 @@
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
+ * gdb.reverse/fstatat-reverse.c: New test.
+ * gdb.reverse/fstatat-reverse.exp: New file.
+ * gdb.reverse/getresuid-reverse.c: New test.
+ * gdb.reverse/getresuid-reverse.exp: New file.
+ * gdb.reverse/pipe-reverse.c: New test.
+ * gdb.reverse/pipe-reverse.exp: New file.
+ * gdb.reverse/readv-reverse.c: New test.
+ * gdb.reverse/readv-reverse.exp: New file.
+ * gdb.reverse/recvmsg-reverse.c: New test.
+ * gdb.reverse/recvmsg-reverse.exp: New file.
+ * gdb.reverse/time-reverse.c: New test.
+ * gdb.reverse/time-reverse.exp: New file.
+ * gdb.reverse/waitpid-reverse.c: New test.
+ * gdb.reverse/waitpid-reverse.exp: New file.
+
2015-10-21 Simon Marchi <simon.marchi@polymtl.ca>
PR python/18073
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.c b/gdb/testsuite/gdb.reverse/fstatat-reverse.c
new file mode 100644
index 0000000..759d466
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.c
@@ -0,0 +1,43 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+struct stat buf;
+
+int
+main ()
+{
+ marker1 ();
+ int fd = open ("/", O_PATH);
+ fstatat( fd, ".", &buf, 0);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
new file mode 100644
index 0000000..09deb6c
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
@@ -0,0 +1,55 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests fstatat syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (0)
+# will be remembered. If not, new contents (mode of /) will be used,
+# and the test will fail.
+
+gdb_test "print buf.st_mode" ".* = 0" "check fstatat record"
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.c b/gdb/testsuite/gdb.reverse/getresuid-reverse.c
new file mode 100644
index 0000000..2c6a937
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.c
@@ -0,0 +1,42 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+uid_t ruid = -1, euid = -1, suid = -1;
+gid_t rgid = -1, egid = -1, sgid = -1;
+
+int
+main ()
+{
+ marker1 ();
+ getresuid (&ruid, &euid, &suid);
+ getresgid (&rgid, &egid, &sgid);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
new file mode 100644
index 0000000..b93fb91
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
@@ -0,0 +1,62 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests getresuid/getresgid syscalls for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (the actual uid/gid) will be used,
+# and the test will fail (we hope the test user doesn't actually have uid of
+# -1). Do it this way instead of printing uid/gid directly, since uid_t/gid_t
+# is likely to be unsigned.
+
+gdb_test "print ruid == (uid_t)-1" ".* = 1" "check ruid record"
+gdb_test "print euid == (uid_t)-1" ".* = 1" "check euid record"
+gdb_test "print suid == (uid_t)-1" ".* = 1" "check suid record"
+gdb_test "print rgid == (gid_t)-1" ".* = 1" "check rgid record"
+gdb_test "print egid == (gid_t)-1" ".* = 1" "check egid record"
+gdb_test "print sgid == (gid_t)-1" ".* = 1" "check sgid record"
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.c b/gdb/testsuite/gdb.reverse/pipe-reverse.c
new file mode 100644
index 0000000..ec8438c
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.c
@@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+int fds[2] = { -1, -1 };
+
+int
+main () {
+ marker1 ();
+ pipe (fds);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.exp b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
new file mode 100644
index 0000000..482893a
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
@@ -0,0 +1,55 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests pipe syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (the file fds from pipe) will be
+# used, and the test will fail.
+
+gdb_test "print fds" ".* = {-1, -1}" "check pipe record"
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.c b/gdb/testsuite/gdb.reverse/readv-reverse.c
new file mode 100644
index 0000000..46d4eef
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.c
@@ -0,0 +1,50 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/uio.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+int fds[2] = { -1, -1 };
+char buf[5];
+const struct iovec v[4] = {
+ { &buf[1], 1 },
+ { &buf[0], 1 },
+ { &buf[3], 1 },
+ { &buf[2], 1 },
+};
+
+int
+main ()
+{
+ marker1 ();
+ pipe (fds);
+ write (fds[1], "UNIX", 4);
+ readv (fds[0], v, 4);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
new file mode 100644
index 0000000..4158c10
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -0,0 +1,58 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests pipe syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents ("")
+# will be remembered. If not, new contents ("NUXI") will be
+# used, and the test will fail.
+
+gdb_test "print (int)buf\[0]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[1]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[2]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[3]" ".* = 0" "check readv record"
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.c b/gdb/testsuite/gdb.reverse/recvmsg-reverse.c
new file mode 100644
index 0000000..1fc09a3
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.c
@@ -0,0 +1,94 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <unistd.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+char wdata[] = "abcdef";
+
+struct iovec wv[1] = {
+ { wdata, 6 },
+};
+
+char wc[CMSG_SPACE(sizeof (struct ucred)) + CMSG_SPACE(sizeof (int))];
+
+struct msghdr wmsg = {
+ 0, 0,
+ wv, 1,
+ wc, sizeof wc,
+ 0,
+};
+
+char rdata[5] = "xxxx";
+
+struct iovec rv[2] = {
+ {&rdata[2], 2},
+ {&rdata[0], 2},
+};
+
+char rc[CMSG_SPACE(sizeof (struct ucred)) + 7];
+
+struct msghdr rmsg = {
+ 0, 0,
+ rv, 2,
+ rc, sizeof rc,
+ 0,
+};
+
+int fds[2];
+
+int
+main ()
+{
+ int itrue = 1;
+ /* prepare cmsg to send */
+ struct cmsghdr *cm1 = CMSG_FIRSTHDR(&wmsg);
+ cm1->cmsg_len = CMSG_LEN(sizeof (struct ucred));
+ cm1->cmsg_level = AF_UNIX;
+ cm1->cmsg_type = SCM_CREDENTIALS;
+ struct ucred *uc = (void *)CMSG_DATA(cm1);
+ uc->pid = getpid ();
+ uc->uid = getuid ();
+ uc->gid = getgid ();
+ struct cmsghdr *cm2 = CMSG_NXTHDR(&wmsg, cm1);
+ cm2->cmsg_len = CMSG_LEN(sizeof (int));
+ cm2->cmsg_level = AF_UNIX;
+ cm2->cmsg_type = SCM_RIGHTS;
+ int *pfd = (void *)CMSG_DATA(cm2);
+ *pfd = 2;
+ /* do the syscalls */
+ marker1();
+ socketpair (AF_UNIX, SOCK_DGRAM, 0, fds);
+ setsockopt (fds[0], SOL_SOCKET, SO_PASSCRED, &itrue, sizeof itrue);
+ sendmsg (fds[1], &wmsg, 0);
+ recvmsg (fds[0], &rmsg, 0);
+ marker2();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
new file mode 100644
index 0000000..7293a3d
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
@@ -0,0 +1,65 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests socketpair and recvmsg syscalls for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents will
+# be remembered. If not, new contents will be used, and the test will fail.
+
+# rdata should be "xxxx", not "cdab"
+gdb_test "print rdata" ".* = \"xxxx\"" "check recvmsg record - rdata"
+
+# rmsg.msg_flags should be zeros, not MSG_TRUNC | MSG_CTRUNC
+gdb_test "print rmsg.msg_flags" ".* = 0" "check recvmsg record - rmsg"
+
+# rmsg.msg_controllen should be sizeof rc, not actual size of control data
+# (7 bytes less)
+gdb_test "print rmsg.msg_controllen - sizeof rc" ".* = 0" "check recvmsg record - rmsg"
+
+# rc should be zeros, not received cmsg
+gdb_test "print ((struct cmsghdr *)rc)->cmsg_len" ".* = 0" "check recvmsg record - cmsg"
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.c b/gdb/testsuite/gdb.reverse/time-reverse.c
new file mode 100644
index 0000000..d8c07e1
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/time-reverse.c
@@ -0,0 +1,42 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <time.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+time_t time_global = -1;
+
+int
+main ()
+{
+ marker1 ();
+ syscall (SYS_time, &time_global);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp
new file mode 100644
index 0000000..9cec3c3
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/time-reverse.exp
@@ -0,0 +1,55 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests time syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (current time) will be used,
+# and the test will fail.
+
+gdb_test "print time_global" ".* = -1" "check time record"
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.c b/gdb/testsuite/gdb.reverse/waitpid-reverse.c
new file mode 100644
index 0000000..a681335
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.c
@@ -0,0 +1,45 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+int status = -1;
+
+int
+main ()
+{
+ marker1 ();
+ if (!fork ()) {
+ _exit (123);
+ } else {
+ waitpid (-1, &status, 0);
+ }
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
new file mode 100644
index 0000000..f4a4403
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
@@ -0,0 +1,55 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests waitpid syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (status) will be used, and
+# the test will fail.
+
+gdb_test "print status" ".* = -1" "check waitpid record"
--
2.6.2
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls.
2015-10-29 13:03 ` Marcin Kościelnicki
@ 2015-10-30 14:52 ` Pedro Alves
0 siblings, 0 replies; 49+ messages in thread
From: Pedro Alves @ 2015-10-30 14:52 UTC (permalink / raw)
To: Marcin Kościelnicki, qiyaoltc; +Cc: gdb-patches
On 10/29/2015 12:31 PM, Marcin KoÅcielnicki wrote:
> On 29/10/15 12:30, Pedro Alves wrote:
>> On 10/22/2015 02:39 PM, Marcin KoÅcielnicki wrote:
>> I ran your tests against pristine/unfixed gdb, and linux-readv-reverse.exp
>> passes cleanly. This is on x86_64. Is that expected? The comments in
>> the test seem to suggest it would fail.
>
> That's expected. The test would only fail for x32 ABI, since it had the
> wrong size_iov, size_pointer, size_size_t.
Ah.
>>> +#define _GNU_SOURCE
>>> +#include <unistd.h>
>>> +#include <fcntl.h>
>>> +#include <sys/stat.h>
>>> +
>>> +void marker1 ()
>>
>> We follow GNU formatting in tests too, unless there's a good
>> reason not to. So, line break after void. Also, this is C,
>> so write "(void)" for parameters. Thus:
>>
>> void
>> marker1 (void)
>> {
>
> OK.
>>
>>> +{
>>> +}
>>> +
>>> +void marker2 ()
>>
>> Likewise.
>>
>>> +{
>>> +}
>>> +
>>> +struct stat buf;
>>> +
>>> +int main() {
>>
>> int
>> main ()
>> {
>>
> Not int main(void)?
Oh, yes, (void). Sorry, I only payed attention to the
formatting and missed that.
>> ... I think most of these tests could/should drop this target check,
>> and drop the "linux-" in the filename as well. Any target/port
>> that supports record/reverse execution should be able to run
>> this, as long as it manages to compile the test program. And if the
>> test program doesn't compile in such a port, it'll be automatically
>> skipped.
>
> OK. So a testcase that doesn't compile is not a problem? Because I
> just noticed the time test doesn't compile on platforms that don't have
> a time syscall, like s390x...
It just results in the test being marked UNTESTED.
It's usually better to skip a test on targets that are known
not to support something than the other way around. Like:
if [istarget "*s390*"] then {
...
return
}
Because otherwise, new ports (or when features are added to
existing ports) end up not enabling the tests that might
run there.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls.
2015-10-30 10:36 ` Marcin Kościelnicki
@ 2015-10-30 15:05 ` Pedro Alves
2015-11-02 1:34 ` Marcin Kościelnicki
0 siblings, 1 reply; 49+ messages in thread
From: Pedro Alves @ 2015-10-30 15:05 UTC (permalink / raw)
To: Marcin Kościelnicki, qiyaoltc; +Cc: gdb-patches
On 10/29/2015 07:31 PM, Marcin KoÅcielnicki wrote:
>>> +
>>> +gdb_test "break marker1" \
>>> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
>>> + "set breakpoint at marker1"
>>> +
>>> +gdb_test "break marker2" \
>>> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
>>> + "set breakpoint at marker2"
>>> +
>>> +gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
>>> +
>>> +gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
>>
>> Most (all?) these tests run to marker1 and then immediately to
>> marker2. Can't they just continue to marker2 directly?
>>
>
> Huh. I've done that and, funnily enough, the waitpid testcase magically
> started to pass.
Eh.
> For the record, I've reported the bug here:
> https://sourceware.org/bugzilla/show_bug.cgi?id=19187
Thanks.
> I guess there won't be a KFAIL after all.
>
OK.
I'll take a look at the new version.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH 01/13] gdb/record: Add testcases for a few syscalls.
2015-10-30 10:37 ` [PATCH 01/13] gdb/record: Add testcases for a few syscalls Marcin Kościelnicki
@ 2015-10-30 15:41 ` Pedro Alves
2015-10-30 15:55 ` [PATCH v4 " Marcin Kościelnicki
0 siblings, 1 reply; 49+ messages in thread
From: Pedro Alves @ 2015-10-30 15:41 UTC (permalink / raw)
To: Marcin Kościelnicki, gdb-patches
Excellent.
Fix the nits below, and you're good to go. Please push
with these fixed.
On 10/29/2015 08:39 PM, Marcin KoÅcielnicki wrote:
> PR python/18073
> diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.c b/gdb/testsuite/gdb.reverse/fstatat-reverse.c
> new file mode 100644
> index 0000000..759d466
> --- /dev/null
> +++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.c
> @@ -0,0 +1,43 @@
> +/* This testcase is part of GDB, the GNU debugger.
> +
> + Copyright 2008-2015 Free Software Foundation, Inc.
> +
> + This program is free software; you can redistribute it and/or modify
> + it under the terms of the GNU General Public License as published by
> + the Free Software Foundation; either version 3 of the License, or
> + (at your option) any later version.
> +
> + This program is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + GNU General Public License for more details.
> +
> + You should have received a copy of the GNU General Public License
> + along with this program. If not, see <http://www.gnu.org/licenses/>. */
> +
> +#define _GNU_SOURCE
> +#include <unistd.h>
> +#include <fcntl.h>
> +#include <sys/stat.h>
> +
> +void
> +marker1 (void)
> +{
> +}
> +
> +void
> +marker2 (void)
> +{
> +}
> +
> +struct stat buf;
> +
> +int
> +main ()
(void) here (and elsewhere as needed), as discussed.
> diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.c b/gdb/testsuite/gdb.reverse/pipe-reverse.c
> new file mode 100644
> index 0000000..ec8438c
> --- /dev/null
> +++ b/gdb/testsuite/gdb.reverse/pipe-reverse.c
> @@ -0,0 +1,39 @@
> +#define _GNU_SOURCE
> +#include <unistd.h>
> +
> +void
> +marker1 (void)
> +{
> +}
> +
> +void
> +marker2 (void)
> +{
> +}
> +
> +int fds[2] = { -1, -1 };
> +
> +int
> +main () {
Like break before {.
> + marker1 ();
> + pipe (fds);
> + marker2 ();
> + return 0;
> +}
> --- /dev/null
> +++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.c
> @@ -0,0 +1,94 @@
> +#define _GNU_SOURCE
> +#include <sys/socket.h>
> +#include <sys/types.h>
> +#include <sys/un.h>
> +#include <unistd.h>
> +
> +void
> +marker1 (void)
> +{
> +}
> +
> +void
> +marker2 (void)
> +{
> +}
> +
> +char wdata[] = "abcdef";
> +
> +struct iovec wv[1] = {
> + { wdata, 6 },
> +};
> +
> +char wc[CMSG_SPACE(sizeof (struct ucred)) + CMSG_SPACE(sizeof (int))];
Space before parens.
> +
> +struct msghdr wmsg = {
> + 0, 0,
> + wv, 1,
> + wc, sizeof wc,
> + 0,
> +};
> +
> +char rdata[5] = "xxxx";
> +
> +struct iovec rv[2] = {
> + {&rdata[2], 2},
> + {&rdata[0], 2},
> +};
> +
> +char rc[CMSG_SPACE(sizeof (struct ucred)) + 7];
> +
> +struct msghdr rmsg = {
> + 0, 0,
> + rv, 2,
> + rc, sizeof rc,
> + 0,
> +};
> +
> +int fds[2];
> +
> +int
> +main ()
> +{
> + int itrue = 1;
> + /* prepare cmsg to send */
> + struct cmsghdr *cm1 = CMSG_FIRSTHDR(&wmsg);
> + cm1->cmsg_len = CMSG_LEN(sizeof (struct ucred));
Space before parens, twice.
> + cm1->cmsg_level = AF_UNIX;
> + cm1->cmsg_type = SCM_CREDENTIALS;
> + struct ucred *uc = (void *)CMSG_DATA(cm1);
Space after cast. Space before parens.
> + uc->pid = getpid ();
> + uc->uid = getuid ();
> + uc->gid = getgid ();
> + struct cmsghdr *cm2 = CMSG_NXTHDR(&wmsg, cm1);
> + cm2->cmsg_len = CMSG_LEN(sizeof (int));
Space before parens, twice.
> + cm2->cmsg_level = AF_UNIX;
> + cm2->cmsg_type = SCM_RIGHTS;
> + int *pfd = (void *)CMSG_DATA(cm2);
Space after cast. Space before parens.
> + *pfd = 2;
> + /* do the syscalls */
> + marker1();
Space before parens.
> + socketpair (AF_UNIX, SOCK_DGRAM, 0, fds);
> + setsockopt (fds[0], SOL_SOCKET, SO_PASSCRED, &itrue, sizeof itrue);
> + sendmsg (fds[1], &wmsg, 0);
> + recvmsg (fds[0], &rmsg, 0);
> + marker2();
Space before parens.
> new file mode 100644
> index 0000000..a681335
> --- /dev/null
> +++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.c
> @@ -0,0 +1,45 @@
> +#include <unistd.h>
> +#include <stdlib.h>
> +#include <sys/wait.h>
> +
> +void
> +marker1 (void)
> +{
> +}
> +
> +void
> +marker2 (void)
> +{
> +}
> +
> +int status = -1;
> +
> +int
> +main ()
> +{
> + marker1 ();
> + if (!fork ()) {
> + _exit (123);
> + } else {
> + waitpid (-1, &status, 0);
> + }
Formatting {} go on their own lines. But since this these single-line
statements, drop the unnecessary {}s:
if (!fork ())
_exit (123);
else
waitpid (-1, &status, 0);
> + marker2 ();
> + return 0;
> +}
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v4 01/13] gdb/record: Add testcases for a few syscalls.
2015-10-30 15:41 ` Pedro Alves
@ 2015-10-30 15:55 ` Marcin Kościelnicki
2015-10-31 18:59 ` Pedro Alves
0 siblings, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-10-30 15:55 UTC (permalink / raw)
To: gdb-patches, palves; +Cc: Marcin Kościelnicki
gdb/testsuite/ChangeLog:
* gdb.reverse/fstatat-reverse.c: New test.
* gdb.reverse/fstatat-reverse.exp: New file.
* gdb.reverse/getresuid-reverse.c: New test.
* gdb.reverse/getresuid-reverse.exp: New file.
* gdb.reverse/pipe-reverse.c: New test.
* gdb.reverse/pipe-reverse.exp: New file.
* gdb.reverse/readv-reverse.c: New test.
* gdb.reverse/readv-reverse.exp: New file.
* gdb.reverse/recvmsg-reverse.c: New test.
* gdb.reverse/recvmsg-reverse.exp: New file.
* gdb.reverse/time-reverse.c: New test.
* gdb.reverse/time-reverse.exp: New file.
* gdb.reverse/waitpid-reverse.c: New test.
* gdb.reverse/waitpid-reverse.exp: New file.
---
Nits fixed. I do not have push rights (this is, in fact, my first gdb patch).
gdb/testsuite/ChangeLog | 17 +++++
gdb/testsuite/gdb.reverse/fstatat-reverse.c | 43 +++++++++++
gdb/testsuite/gdb.reverse/fstatat-reverse.exp | 55 +++++++++++++++
gdb/testsuite/gdb.reverse/getresuid-reverse.c | 42 +++++++++++
gdb/testsuite/gdb.reverse/getresuid-reverse.exp | 62 ++++++++++++++++
gdb/testsuite/gdb.reverse/pipe-reverse.c | 40 +++++++++++
gdb/testsuite/gdb.reverse/pipe-reverse.exp | 55 +++++++++++++++
gdb/testsuite/gdb.reverse/readv-reverse.c | 50 +++++++++++++
gdb/testsuite/gdb.reverse/readv-reverse.exp | 58 +++++++++++++++
gdb/testsuite/gdb.reverse/recvmsg-reverse.c | 94 +++++++++++++++++++++++++
gdb/testsuite/gdb.reverse/recvmsg-reverse.exp | 65 +++++++++++++++++
gdb/testsuite/gdb.reverse/time-reverse.c | 42 +++++++++++
gdb/testsuite/gdb.reverse/time-reverse.exp | 55 +++++++++++++++
gdb/testsuite/gdb.reverse/waitpid-reverse.c | 44 ++++++++++++
gdb/testsuite/gdb.reverse/waitpid-reverse.exp | 55 +++++++++++++++
15 files changed, 777 insertions(+)
create mode 100644 gdb/testsuite/gdb.reverse/fstatat-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/fstatat-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/getresuid-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/getresuid-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/pipe-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/pipe-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/readv-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/readv-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/recvmsg-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/time-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/time-reverse.exp
create mode 100644 gdb/testsuite/gdb.reverse/waitpid-reverse.c
create mode 100644 gdb/testsuite/gdb.reverse/waitpid-reverse.exp
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1313aa2..07ec548 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,20 @@
+2015-10-22 Marcin KoÅcielnicki <koriakin@0x04.net>
+
+ * gdb.reverse/fstatat-reverse.c: New test.
+ * gdb.reverse/fstatat-reverse.exp: New file.
+ * gdb.reverse/getresuid-reverse.c: New test.
+ * gdb.reverse/getresuid-reverse.exp: New file.
+ * gdb.reverse/pipe-reverse.c: New test.
+ * gdb.reverse/pipe-reverse.exp: New file.
+ * gdb.reverse/readv-reverse.c: New test.
+ * gdb.reverse/readv-reverse.exp: New file.
+ * gdb.reverse/recvmsg-reverse.c: New test.
+ * gdb.reverse/recvmsg-reverse.exp: New file.
+ * gdb.reverse/time-reverse.c: New test.
+ * gdb.reverse/time-reverse.exp: New file.
+ * gdb.reverse/waitpid-reverse.c: New test.
+ * gdb.reverse/waitpid-reverse.exp: New file.
+
2015-10-21 Simon Marchi <simon.marchi@polymtl.ca>
PR python/18073
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.c b/gdb/testsuite/gdb.reverse/fstatat-reverse.c
new file mode 100644
index 0000000..109f8ae
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.c
@@ -0,0 +1,43 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+struct stat buf;
+
+int
+main (void)
+{
+ marker1 ();
+ int fd = open ("/", O_PATH);
+ fstatat( fd, ".", &buf, 0);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
new file mode 100644
index 0000000..09deb6c
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
@@ -0,0 +1,55 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests fstatat syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (0)
+# will be remembered. If not, new contents (mode of /) will be used,
+# and the test will fail.
+
+gdb_test "print buf.st_mode" ".* = 0" "check fstatat record"
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.c b/gdb/testsuite/gdb.reverse/getresuid-reverse.c
new file mode 100644
index 0000000..f44692a
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.c
@@ -0,0 +1,42 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+uid_t ruid = -1, euid = -1, suid = -1;
+gid_t rgid = -1, egid = -1, sgid = -1;
+
+int
+main (void)
+{
+ marker1 ();
+ getresuid (&ruid, &euid, &suid);
+ getresgid (&rgid, &egid, &sgid);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
new file mode 100644
index 0000000..b93fb91
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
@@ -0,0 +1,62 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests getresuid/getresgid syscalls for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (the actual uid/gid) will be used,
+# and the test will fail (we hope the test user doesn't actually have uid of
+# -1). Do it this way instead of printing uid/gid directly, since uid_t/gid_t
+# is likely to be unsigned.
+
+gdb_test "print ruid == (uid_t)-1" ".* = 1" "check ruid record"
+gdb_test "print euid == (uid_t)-1" ".* = 1" "check euid record"
+gdb_test "print suid == (uid_t)-1" ".* = 1" "check suid record"
+gdb_test "print rgid == (gid_t)-1" ".* = 1" "check rgid record"
+gdb_test "print egid == (gid_t)-1" ".* = 1" "check egid record"
+gdb_test "print sgid == (gid_t)-1" ".* = 1" "check sgid record"
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.c b/gdb/testsuite/gdb.reverse/pipe-reverse.c
new file mode 100644
index 0000000..cb8e1c3
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.c
@@ -0,0 +1,40 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+int fds[2] = { -1, -1 };
+
+int
+main (void)
+{
+ marker1 ();
+ pipe (fds);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.exp b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
new file mode 100644
index 0000000..482893a
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
@@ -0,0 +1,55 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests pipe syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (the file fds from pipe) will be
+# used, and the test will fail.
+
+gdb_test "print fds" ".* = {-1, -1}" "check pipe record"
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.c b/gdb/testsuite/gdb.reverse/readv-reverse.c
new file mode 100644
index 0000000..71f2843
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.c
@@ -0,0 +1,50 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/uio.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+int fds[2] = { -1, -1 };
+char buf[5];
+const struct iovec v[4] = {
+ { &buf[1], 1 },
+ { &buf[0], 1 },
+ { &buf[3], 1 },
+ { &buf[2], 1 },
+};
+
+int
+main (void)
+{
+ marker1 ();
+ pipe (fds);
+ write (fds[1], "UNIX", 4);
+ readv (fds[0], v, 4);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
new file mode 100644
index 0000000..4158c10
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -0,0 +1,58 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests pipe syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents ("")
+# will be remembered. If not, new contents ("NUXI") will be
+# used, and the test will fail.
+
+gdb_test "print (int)buf\[0]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[1]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[2]" ".* = 0" "check readv record"
+gdb_test "print (int)buf\[3]" ".* = 0" "check readv record"
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.c b/gdb/testsuite/gdb.reverse/recvmsg-reverse.c
new file mode 100644
index 0000000..4dd9cfd
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.c
@@ -0,0 +1,94 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <unistd.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+char wdata[] = "abcdef";
+
+struct iovec wv[1] = {
+ { wdata, 6 },
+};
+
+char wc[CMSG_SPACE (sizeof (struct ucred)) + CMSG_SPACE (sizeof (int))];
+
+struct msghdr wmsg = {
+ 0, 0,
+ wv, 1,
+ wc, sizeof wc,
+ 0,
+};
+
+char rdata[5] = "xxxx";
+
+struct iovec rv[2] = {
+ {&rdata[2], 2},
+ {&rdata[0], 2},
+};
+
+char rc[CMSG_SPACE (sizeof (struct ucred)) + 7];
+
+struct msghdr rmsg = {
+ 0, 0,
+ rv, 2,
+ rc, sizeof rc,
+ 0,
+};
+
+int fds[2];
+
+int
+main (void)
+{
+ int itrue = 1;
+ /* prepare cmsg to send */
+ struct cmsghdr *cm1 = CMSG_FIRSTHDR (&wmsg);
+ cm1->cmsg_len = CMSG_LEN (sizeof (struct ucred));
+ cm1->cmsg_level = AF_UNIX;
+ cm1->cmsg_type = SCM_CREDENTIALS;
+ struct ucred *uc = (void *) CMSG_DATA (cm1);
+ uc->pid = getpid ();
+ uc->uid = getuid ();
+ uc->gid = getgid ();
+ struct cmsghdr *cm2 = CMSG_NXTHDR (&wmsg, cm1);
+ cm2->cmsg_len = CMSG_LEN (sizeof (int));
+ cm2->cmsg_level = AF_UNIX;
+ cm2->cmsg_type = SCM_RIGHTS;
+ int *pfd = (void *) CMSG_DATA (cm2);
+ *pfd = 2;
+ /* do the syscalls */
+ marker1 ();
+ socketpair (AF_UNIX, SOCK_DGRAM, 0, fds);
+ setsockopt (fds[0], SOL_SOCKET, SO_PASSCRED, &itrue, sizeof itrue);
+ sendmsg (fds[1], &wmsg, 0);
+ recvmsg (fds[0], &rmsg, 0);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
new file mode 100644
index 0000000..7293a3d
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
@@ -0,0 +1,65 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests socketpair and recvmsg syscalls for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variables were recorded properly on syscall, the old contents will
+# be remembered. If not, new contents will be used, and the test will fail.
+
+# rdata should be "xxxx", not "cdab"
+gdb_test "print rdata" ".* = \"xxxx\"" "check recvmsg record - rdata"
+
+# rmsg.msg_flags should be zeros, not MSG_TRUNC | MSG_CTRUNC
+gdb_test "print rmsg.msg_flags" ".* = 0" "check recvmsg record - rmsg"
+
+# rmsg.msg_controllen should be sizeof rc, not actual size of control data
+# (7 bytes less)
+gdb_test "print rmsg.msg_controllen - sizeof rc" ".* = 0" "check recvmsg record - rmsg"
+
+# rc should be zeros, not received cmsg
+gdb_test "print ((struct cmsghdr *)rc)->cmsg_len" ".* = 0" "check recvmsg record - cmsg"
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.c b/gdb/testsuite/gdb.reverse/time-reverse.c
new file mode 100644
index 0000000..1c457c4
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/time-reverse.c
@@ -0,0 +1,42 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <time.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+time_t time_global = -1;
+
+int
+main (void)
+{
+ marker1 ();
+ syscall (SYS_time, &time_global);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp
new file mode 100644
index 0000000..9cec3c3
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/time-reverse.exp
@@ -0,0 +1,55 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests time syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (current time) will be used,
+# and the test will fail.
+
+gdb_test "print time_global" ".* = -1" "check time record"
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.c b/gdb/testsuite/gdb.reverse/waitpid-reverse.c
new file mode 100644
index 0000000..5b3b8c3
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.c
@@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008-2015 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+
+void
+marker1 (void)
+{
+}
+
+void
+marker2 (void)
+{
+}
+
+int status = -1;
+
+int
+main (void)
+{
+ marker1 ();
+ if (!fork ())
+ _exit (123);
+ else
+ waitpid (-1, &status, 0);
+ marker2 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
new file mode 100644
index 0000000..f4a4403
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
@@ -0,0 +1,55 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the gdb testsuite.
+
+#
+# This test tests waitpid syscall for reverse execution.
+#
+
+if ![supports_reverse] {
+ return
+}
+
+standard_testfile
+
+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
+ return -1
+}
+
+runto main
+
+if [supports_process_record] {
+ # Activate process record/replay
+ gdb_test_no_output "record" "Turn on process record"
+}
+
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+gdb_test "break marker2" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker2"
+
+gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+
+gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
+
+# If the variable was recorded properly on syscall, the old contents (-1)
+# will be remembered. If not, new contents (status) will be used, and
+# the test will fail.
+
+gdb_test "print status" ".* = -1" "check waitpid record"
--
2.6.2
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v4 01/13] gdb/record: Add testcases for a few syscalls.
2015-10-30 15:55 ` [PATCH v4 " Marcin Kościelnicki
@ 2015-10-31 18:59 ` Pedro Alves
0 siblings, 0 replies; 49+ messages in thread
From: Pedro Alves @ 2015-10-31 18:59 UTC (permalink / raw)
To: Marcin Kościelnicki; +Cc: GDB Patches
On 10/30/2015 11:13 AM, Marcin KoÅcielnicki wrote:
> gdb/testsuite/ChangeLog:
>
> * gdb.reverse/fstatat-reverse.c: New test.
> * gdb.reverse/fstatat-reverse.exp: New file.
> * gdb.reverse/getresuid-reverse.c: New test.
> * gdb.reverse/getresuid-reverse.exp: New file.
> * gdb.reverse/pipe-reverse.c: New test.
> * gdb.reverse/pipe-reverse.exp: New file.
> * gdb.reverse/readv-reverse.c: New test.
> * gdb.reverse/readv-reverse.exp: New file.
> * gdb.reverse/recvmsg-reverse.c: New test.
> * gdb.reverse/recvmsg-reverse.exp: New file.
> * gdb.reverse/time-reverse.c: New test.
> * gdb.reverse/time-reverse.exp: New file.
> * gdb.reverse/waitpid-reverse.c: New test.
> * gdb.reverse/waitpid-reverse.exp: New file.
> ---
> Nits fixed. I do not have push rights (this is, in fact, my first gdb patch).
Looks perfect now.
The rule for write access is just to have copyright in order, and
send at least one good patch. So you now qualify for write access.
If you intend to keep working on gdb, it'd be good to have you
push your own patches. Let me know if you'd like that.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls.
2015-10-30 15:05 ` Pedro Alves
@ 2015-11-02 1:34 ` Marcin Kościelnicki
2015-11-02 16:40 ` Pedro Alves
0 siblings, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-11-02 1:34 UTC (permalink / raw)
To: Pedro Alves, qiyaoltc; +Cc: gdb-patches
On 30/10/15 11:37, Pedro Alves wrote:
> On 10/29/2015 07:31 PM, Marcin KoÅcielnicki wrote:
>>>> +
>>>> +gdb_test "break marker1" \
>>>> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
>>>> + "set breakpoint at marker1"
>>>> +
>>>> +gdb_test "break marker2" \
>>>> + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
>>>> + "set breakpoint at marker2"
>>>> +
>>>> +gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
>>>> +
>>>> +gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
>>>
>>> Most (all?) these tests run to marker1 and then immediately to
>>> marker2. Can't they just continue to marker2 directly?
>>>
>>
>> Huh. I've done that and, funnily enough, the waitpid testcase magically
>> started to pass.
>
> Eh.
>
>> For the record, I've reported the bug here:
>> https://sourceware.org/bugzilla/show_bug.cgi?id=19187
>
> Thanks.
>
>> I guess there won't be a KFAIL after all.
>>
>
> OK.
>
> I'll take a look at the new version.
>
> Thanks,
> Pedro Alves
>
Well, this is embarassing...
Turns out gdb_continue_to_breakpoint doesn't care all that much about
the name of the breakpoint passed in as the first parameter, it just
happily continues to the next breakpoint, whatever it happens to be.
So the testcases as commited never actually make it to marker2, and they
all trivially pass (state when reaching marker1 is, after all, exactly
identical to reaching marker2 and then correctly reversing to marker1).
I should've known that stepping over fork suddenly starting to work was
too good to be true.
So... can I get that push access now and fix my mess, or do I no longer
qualify as having submitted a good patch due to the above? :)
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls.
2015-11-02 1:34 ` Marcin Kościelnicki
@ 2015-11-02 16:40 ` Pedro Alves
2015-11-02 18:53 ` [PATCH] gdb/reverse: Fix continue_to_breakpoint in syscall testcases Marcin Kościelnicki
0 siblings, 1 reply; 49+ messages in thread
From: Pedro Alves @ 2015-11-02 16:40 UTC (permalink / raw)
To: Marcin Kościelnicki, qiyaoltc; +Cc: gdb-patches
On 11/02/2015 01:34 AM, Marcin KoÅcielnicki wrote:
> Well, this is embarassing...
>
> Turns out gdb_continue_to_breakpoint doesn't care all that much about
> the name of the breakpoint passed in as the first parameter, it just
> happily continues to the next breakpoint, whatever it happens to be.
>
> So the testcases as commited never actually make it to marker2, and they
> all trivially pass (state when reaching marker1 is, after all, exactly
> identical to reaching marker2 and then correctly reversing to marker1).
>
> I should've known that stepping over fork suddenly starting to work was
> too good to be true.
Whoops, sorry for missing that too.
>
> So... can I get that push access now and fix my mess, or do I no longer
> qualify as having submitted a good patch due to the above? :)
:-)
See "I need an account" at https://sourceware.org/. Say I approved it.
Once you have that sorted, add yourself to the "Write After Approval"
section in gdb/MAINTAINERS, push that change to the repo (no need
for approval on that one), and post that commit on the list.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH] gdb/reverse: Fix continue_to_breakpoint in syscall testcases.
2015-11-02 16:40 ` Pedro Alves
@ 2015-11-02 18:53 ` Marcin Kościelnicki
2015-11-02 19:17 ` Pedro Alves
0 siblings, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-11-02 18:53 UTC (permalink / raw)
To: gdb-patches, palves; +Cc: Marcin Kościelnicki
continue_to_breakpoint always continues to the next breakpoint, not to the
one named in parameter. This rendered the tests effectively useless, since
marker2 was never reached.
gdb/testsuite/ChangeLog:
* gdb.reverse/fstatat-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/getresuid-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/pipe-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/readv-reverse.exp: Fix continue_to_breakpoint and comment.
* gdb.reverse/recvmsg-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/time-reverse.exp: Fix continue_to_breakpoint.
* gdb.reverse/waitpid-reverse.exp: Fix continue_to_breakpoint, add KFAILs.
---
Here comes the fix.
gdb/testsuite/ChangeLog | 10 ++++++++++
gdb/testsuite/gdb.reverse/fstatat-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/getresuid-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/pipe-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/readv-reverse.exp | 4 +++-
gdb/testsuite/gdb.reverse/recvmsg-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/time-reverse.exp | 2 ++
gdb/testsuite/gdb.reverse/waitpid-reverse.exp | 4 ++++
8 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e01ee86..4ba75dc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2015-11-02 Marcin KoÅcielnicki <koriakin@0x04.net>
+
+ * gdb.reverse/fstatat-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/getresuid-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/pipe-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/readv-reverse.exp: Fix continue_to_breakpoint and comment.
+ * gdb.reverse/recvmsg-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/time-reverse.exp: Fix continue_to_breakpoint.
+ * gdb.reverse/waitpid-reverse.exp: Fix continue_to_breakpoint, add KFAILs.
+
2015-10-30 Yao Qi <yao.qi@linaro.org>
* gdb.threads/wp-replication.c (watch_count_done): Remove.
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
index 09deb6c..39401dc 100644
--- a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
index b93fb91..787457c 100644
--- a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.exp b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
index 482893a..d298a35 100644
--- a/gdb/testsuite/gdb.reverse/pipe-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
index 4158c10..a98ded5 100644
--- a/gdb/testsuite/gdb.reverse/readv-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -16,7 +16,7 @@
# This file is part of the gdb testsuite.
#
-# This test tests pipe syscall for reverse execution.
+# This test tests readv syscall for reverse execution.
#
if ![supports_reverse] {
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
index 7293a3d..1cb44d3 100644
--- a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp
index 9cec3c3..5b3d9a3 100644
--- a/gdb/testsuite/gdb.reverse/time-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/time-reverse.exp
@@ -44,6 +44,8 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
index f4a4403..27d84a1 100644
--- a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
@@ -44,8 +44,12 @@ gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
+gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
+
+setup_kfail "gdb/19187" *-*-*
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+setup_kfail "gdb/19187" *-*-*
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
# If the variable was recorded properly on syscall, the old contents (-1)
--
2.6.2
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH] gdb/reverse: Fix continue_to_breakpoint in syscall testcases.
2015-11-02 18:53 ` [PATCH] gdb/reverse: Fix continue_to_breakpoint in syscall testcases Marcin Kościelnicki
@ 2015-11-02 19:17 ` Pedro Alves
2015-11-02 19:58 ` [PATCH 1/2] " Marcin Kościelnicki
0 siblings, 1 reply; 49+ messages in thread
From: Pedro Alves @ 2015-11-02 19:17 UTC (permalink / raw)
To: Marcin Kościelnicki, gdb-patches
On 11/02/2015 06:47 PM, Marcin KoÅcielnicki wrote:
> --- a/gdb/testsuite/ChangeLog
> +++ b/gdb/testsuite/ChangeLog
> @@ -1,3 +1,13 @@
> +2015-11-02 Marcin KoÅcielnicki <koriakin@0x04.net>
> +
> + * gdb.reverse/fstatat-reverse.exp: Fix continue_to_breakpoint.
> + * gdb.reverse/getresuid-reverse.exp: Fix continue_to_breakpoint.
> + * gdb.reverse/pipe-reverse.exp: Fix continue_to_breakpoint.
> + * gdb.reverse/readv-reverse.exp: Fix continue_to_breakpoint and comment.
> + * gdb.reverse/recvmsg-reverse.exp: Fix continue_to_breakpoint.
> + * gdb.reverse/time-reverse.exp: Fix continue_to_breakpoint.
> + * gdb.reverse/waitpid-reverse.exp: Fix continue_to_breakpoint, add KFAILs.
Boring nit: In ChangeLog files, it's preferred to say "what" changed.
E.g., "Continue to marker1 before continuing to marker2".
> diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
> index 09deb6c..39401dc 100644
> --- a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
> +++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
> @@ -44,6 +44,8 @@ gdb_test "break marker2" \
> "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
> "set breakpoint at marker2"
>
> +gdb_continue_to_breakpoint "marker1" ".*$srcfile:.*"
> +
> gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
Did you try running to marker2 first, and _then_ create the marker1 breakpoint?
gdb_test "break marker1" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker1"
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
That is, just move the gdb_continue_to_breakpoint earlier. That would
avoid the double continue, which was what I pointed out
originally.
> diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
> index 4158c10..a98ded5 100644
> --- a/gdb/testsuite/gdb.reverse/readv-reverse.exp
> +++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
> @@ -16,7 +16,7 @@
> # This file is part of the gdb testsuite.
>
> #
> -# This test tests pipe syscall for reverse execution.
> +# This test tests readv syscall for reverse execution.
> #
>
Please split this hunk to a separate patch and push it in as a typo fix.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 1/2] gdb/reverse: Fix continue_to_breakpoint in syscall testcases.
2015-11-02 19:17 ` Pedro Alves
@ 2015-11-02 19:58 ` Marcin Kościelnicki
2015-11-02 19:58 ` [PATCH 1/2] Obvious typo fix in gdb.reverse/readv-reverse.exp Marcin Kościelnicki
2015-11-02 19:59 ` [PATCH 1/2] gdb/reverse: Fix continue_to_breakpoint in syscall testcases Pedro Alves
0 siblings, 2 replies; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-11-02 19:58 UTC (permalink / raw)
To: palves; +Cc: gdb-patches, Marcin Kościelnicki
continue_to_breakpoint always continues to the next breakpoint, not to the
one named in parameter. This rendered the tests effectively useless, since
marker2 was never reached.
gdb/testsuite/ChangeLog:
* gdb.reverse/fstatat-reverse.exp: Set breakpoint on marker1 after
reaching marker2.
* gdb.reverse/getresuid-reverse.exp: Likewise.
* gdb.reverse/pipe-reverse.exp: Likewise.
* gdb.reverse/readv-reverse.exp: Likewise.
* gdb.reverse/recvmsg-reverse.exp: Likewise.
* gdb.reverse/time-reverse.exp: Likewise.
* gdb.reverse/waitpid-reverse.exp: Likewise and add KFAILs.
---
Fixed and split as requested.
gdb/testsuite/ChangeLog | 11 +++++++++++
gdb/testsuite/gdb.reverse/fstatat-reverse.exp | 8 ++++----
gdb/testsuite/gdb.reverse/getresuid-reverse.exp | 8 ++++----
gdb/testsuite/gdb.reverse/pipe-reverse.exp | 8 ++++----
gdb/testsuite/gdb.reverse/readv-reverse.exp | 8 ++++----
gdb/testsuite/gdb.reverse/recvmsg-reverse.exp | 8 ++++----
gdb/testsuite/gdb.reverse/time-reverse.exp | 8 ++++----
gdb/testsuite/gdb.reverse/waitpid-reverse.exp | 10 ++++++----
8 files changed, 41 insertions(+), 28 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e01ee86..ced4a87 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2015-11-02 Marcin KoÅcielnicki <koriakin@0x04.net>
+
+ * gdb.reverse/fstatat-reverse.exp: Set breakpoint on marker1 after
+ reaching marker2.
+ * gdb.reverse/getresuid-reverse.exp: Likewise.
+ * gdb.reverse/pipe-reverse.exp: Likewise.
+ * gdb.reverse/readv-reverse.exp: Likewise.
+ * gdb.reverse/recvmsg-reverse.exp: Likewise.
+ * gdb.reverse/time-reverse.exp: Likewise.
+ * gdb.reverse/waitpid-reverse.exp: Likewise and add KFAILs.
+
2015-10-30 Yao Qi <yao.qi@linaro.org>
* gdb.threads/wp-replication.c (watch_count_done): Remove.
diff --git a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
index 09deb6c..e9b2ca8 100644
--- a/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/fstatat-reverse.exp
@@ -36,16 +36,16 @@ if [supports_process_record] {
gdb_test_no_output "record" "Turn on process record"
}
-gdb_test "break marker1" \
- "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
- "set breakpoint at marker1"
-
gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
# If the variable was recorded properly on syscall, the old contents (0)
diff --git a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
index b93fb91..a625113 100644
--- a/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/getresuid-reverse.exp
@@ -36,16 +36,16 @@ if [supports_process_record] {
gdb_test_no_output "record" "Turn on process record"
}
-gdb_test "break marker1" \
- "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
- "set breakpoint at marker1"
-
gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
# If the variables were recorded properly on syscall, the old contents (-1)
diff --git a/gdb/testsuite/gdb.reverse/pipe-reverse.exp b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
index 482893a..5d50488 100644
--- a/gdb/testsuite/gdb.reverse/pipe-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/pipe-reverse.exp
@@ -36,16 +36,16 @@ if [supports_process_record] {
gdb_test_no_output "record" "Turn on process record"
}
-gdb_test "break marker1" \
- "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
- "set breakpoint at marker1"
-
gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
# If the variables were recorded properly on syscall, the old contents (-1)
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
index 4158c10..c9178d9 100644
--- a/gdb/testsuite/gdb.reverse/readv-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -36,16 +36,16 @@ if [supports_process_record] {
gdb_test_no_output "record" "Turn on process record"
}
-gdb_test "break marker1" \
- "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
- "set breakpoint at marker1"
-
gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
# If the variables were recorded properly on syscall, the old contents ("")
diff --git a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
index 7293a3d..2540b91 100644
--- a/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/recvmsg-reverse.exp
@@ -36,16 +36,16 @@ if [supports_process_record] {
gdb_test_no_output "record" "Turn on process record"
}
-gdb_test "break marker1" \
- "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
- "set breakpoint at marker1"
-
gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
# If the variables were recorded properly on syscall, the old contents will
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp
index 9cec3c3..1cc111b 100644
--- a/gdb/testsuite/gdb.reverse/time-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/time-reverse.exp
@@ -36,16 +36,16 @@ if [supports_process_record] {
gdb_test_no_output "record" "Turn on process record"
}
-gdb_test "break marker1" \
- "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
- "set breakpoint at marker1"
-
gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
# If the variable was recorded properly on syscall, the old contents (-1)
diff --git a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
index f4a4403..ddd8d7b 100644
--- a/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/waitpid-reverse.exp
@@ -36,16 +36,18 @@ if [supports_process_record] {
gdb_test_no_output "record" "Turn on process record"
}
-gdb_test "break marker1" \
- "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
- "set breakpoint at marker1"
-
gdb_test "break marker2" \
"Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
"set breakpoint at marker2"
+setup_kfail "gdb/19187" *-*-*
gdb_continue_to_breakpoint "marker2" ".*$srcfile:.*"
+gdb_test "break marker1" \
+ "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
+ "set breakpoint at marker1"
+
+setup_kfail "gdb/19187" *-*-*
gdb_test "reverse-continue" ".*$srcfile:$decimal.*" "reverse to marker1"
# If the variable was recorded properly on syscall, the old contents (-1)
--
2.6.2
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH 1/2] Obvious typo fix in gdb.reverse/readv-reverse.exp
2015-11-02 19:58 ` [PATCH 1/2] " Marcin Kościelnicki
@ 2015-11-02 19:58 ` Marcin Kościelnicki
2015-11-02 20:00 ` Pedro Alves
2015-11-02 19:59 ` [PATCH 1/2] gdb/reverse: Fix continue_to_breakpoint in syscall testcases Pedro Alves
1 sibling, 1 reply; 49+ messages in thread
From: Marcin Kościelnicki @ 2015-11-02 19:58 UTC (permalink / raw)
To: palves; +Cc: gdb-patches, Marcin Kościelnicki
gdb/testsuite/ChangeLog:
* gdb.reverse/readv-reverse.exp: Obvious typo fixed.
---
gdb/testsuite/ChangeLog | 4 ++++
gdb/testsuite/gdb.reverse/readv-reverse.exp | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ced4a87..2aa84bf 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2015-11-02 Marcin KoÅcielnicki <koriakin@0x04.net>
+ * gdb.reverse/readv-reverse.exp: Obvious typo fixed.
+
+2015-11-02 Marcin KoÅcielnicki <koriakin@0x04.net>
+
* gdb.reverse/fstatat-reverse.exp: Set breakpoint on marker1 after
reaching marker2.
* gdb.reverse/getresuid-reverse.exp: Likewise.
diff --git a/gdb/testsuite/gdb.reverse/readv-reverse.exp b/gdb/testsuite/gdb.reverse/readv-reverse.exp
index c9178d9..d2a15eb 100644
--- a/gdb/testsuite/gdb.reverse/readv-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/readv-reverse.exp
@@ -16,7 +16,7 @@
# This file is part of the gdb testsuite.
#
-# This test tests pipe syscall for reverse execution.
+# This test tests readv syscall for reverse execution.
#
if ![supports_reverse] {
--
2.6.2
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH 1/2] gdb/reverse: Fix continue_to_breakpoint in syscall testcases.
2015-11-02 19:58 ` [PATCH 1/2] " Marcin Kościelnicki
2015-11-02 19:58 ` [PATCH 1/2] Obvious typo fix in gdb.reverse/readv-reverse.exp Marcin Kościelnicki
@ 2015-11-02 19:59 ` Pedro Alves
1 sibling, 0 replies; 49+ messages in thread
From: Pedro Alves @ 2015-11-02 19:59 UTC (permalink / raw)
To: Marcin Kościelnicki; +Cc: gdb-patches
On 11/02/2015 07:58 PM, Marcin KoÅcielnicki wrote:
> continue_to_breakpoint always continues to the next breakpoint, not to the
> one named in parameter. This rendered the tests effectively useless, since
> marker2 was never reached.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.reverse/fstatat-reverse.exp: Set breakpoint on marker1 after
> reaching marker2.
> * gdb.reverse/getresuid-reverse.exp: Likewise.
> * gdb.reverse/pipe-reverse.exp: Likewise.
> * gdb.reverse/readv-reverse.exp: Likewise.
> * gdb.reverse/recvmsg-reverse.exp: Likewise.
> * gdb.reverse/time-reverse.exp: Likewise.
> * gdb.reverse/waitpid-reverse.exp: Likewise and add KFAILs.
OK.
Thanks!
--
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH 1/2] Obvious typo fix in gdb.reverse/readv-reverse.exp
2015-11-02 19:58 ` [PATCH 1/2] Obvious typo fix in gdb.reverse/readv-reverse.exp Marcin Kościelnicki
@ 2015-11-02 20:00 ` Pedro Alves
0 siblings, 0 replies; 49+ messages in thread
From: Pedro Alves @ 2015-11-02 20:00 UTC (permalink / raw)
To: Marcin Kościelnicki; +Cc: gdb-patches
On 11/02/2015 07:58 PM, Marcin KoÅcielnicki wrote:
> gdb/testsuite/ChangeLog:
>
> * gdb.reverse/readv-reverse.exp: Obvious typo fixed.
FAOD, OK.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 49+ messages in thread
end of thread, other threads:[~2015-11-02 20:00 UTC | newest]
Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-17 21:41 gdb/linux-record fixes Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 08/11] gdb/linux-record: Fix newfstatat handling Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 06/11] gdb/linux-record: Support time, waitpid, pipe syscalls Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 03/11] gdb/linux-record: Fix sizes of sigaction and sigset_t Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 09/11] gdb/linux-record: Fix old_select syscall handling Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 04/11] gdb/linux-record: Fix readdir and getdents handling Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 01/11] gdb/linux-record: Remove size_siginfo Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 07/11] gdb/linux-record: Fix [sg]etgroups16 syscall Marcin Kościelnicki
2015-10-17 21:41 ` [PATCH 11/11] gdb/linux-record: Fix struct sizes for x32 + aarch64 Marcin Kościelnicki
2015-10-17 21:49 ` [PATCH 02/11] gdb/linux-record: Fix size_[ug]id values Marcin Kościelnicki
2015-10-17 21:49 ` [PATCH 10/11] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too Marcin Kościelnicki
2015-10-17 21:49 ` [PATCH 05/11] gdb/linux-record: Fix msghdr parsing on 64-bit targets Marcin Kościelnicki
2015-10-19 15:37 ` gdb/linux-record fixes Pedro Alves
2015-10-19 17:18 ` Marcin Kościelnicki
2015-10-20 11:07 ` Pedro Alves
2015-10-20 11:16 ` Marcin Kościelnicki
2015-10-22 13:39 ` Marcin Kościelnicki
2015-10-22 13:39 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Marcin Kościelnicki
2015-10-22 13:43 ` [PATCH v2 11/13] gdb/linux-record: TASK_COMM_LEN is 16 on ppc too Marcin Kościelnicki
2015-10-22 13:45 ` [PATCH v2 13/13] gdb/linux-record: Fix struct sizes for x32 Marcin Kościelnicki
2015-10-22 13:45 ` [PATCH v2 03/13] gdb/linux-record: Fix size_[ug]id values Marcin Kościelnicki
2015-10-22 13:45 ` [PATCH v2 12/13] gdb/linux-record: Fix size_termios for x32, amd64, aarch64 Marcin Kościelnicki
2015-10-22 13:49 ` [PATCH v2 10/13] gdb/linux-record: Fix old_select syscall handling Marcin Kościelnicki
2015-10-22 13:51 ` [PATCH v2 04/13] gdb/linux-record: Fix sizes of sigaction and sigset_t Marcin Kościelnicki
2015-10-22 13:51 ` [PATCH v2 06/13] gdb/linux-record: Fix msghdr parsing on 64-bit targets Marcin Kościelnicki
2015-10-22 13:55 ` [PATCH v2 07/13] gdb/linux-record: Support time, waitpid, pipe syscalls Marcin Kościelnicki
2015-10-22 14:32 ` [PATCH v2 02/13] gdb/linux-record: Remove size_siginfo Marcin Kościelnicki
2015-10-22 15:01 ` [PATCH v2 08/13] gdb/linux-record: Fix [gs]etgroups16 syscall Marcin Kościelnicki
2015-10-22 15:06 ` [PATCH v2 05/13] gdb/linux-record: Fix readdir and getdents handling Marcin Kościelnicki
2015-10-22 15:07 ` [PATCH v2 09/13] gdb/linux-record: Fix newfstatat handling Marcin Kościelnicki
2015-10-29 13:03 ` [PATCH v2 01/13] gdb/linux-record: Add testcases for a few syscalls Pedro Alves
2015-10-29 13:03 ` Marcin Kościelnicki
2015-10-30 14:52 ` Pedro Alves
2015-10-30 10:36 ` Marcin Kościelnicki
2015-10-30 15:05 ` Pedro Alves
2015-11-02 1:34 ` Marcin Kościelnicki
2015-11-02 16:40 ` Pedro Alves
2015-11-02 18:53 ` [PATCH] gdb/reverse: Fix continue_to_breakpoint in syscall testcases Marcin Kościelnicki
2015-11-02 19:17 ` Pedro Alves
2015-11-02 19:58 ` [PATCH 1/2] " Marcin Kościelnicki
2015-11-02 19:58 ` [PATCH 1/2] Obvious typo fix in gdb.reverse/readv-reverse.exp Marcin Kościelnicki
2015-11-02 20:00 ` Pedro Alves
2015-11-02 19:59 ` [PATCH 1/2] gdb/reverse: Fix continue_to_breakpoint in syscall testcases Pedro Alves
2015-10-30 10:37 ` [PATCH 01/13] gdb/record: Add testcases for a few syscalls Marcin Kościelnicki
2015-10-30 15:41 ` Pedro Alves
2015-10-30 15:55 ` [PATCH v4 " Marcin Kościelnicki
2015-10-31 18:59 ` Pedro Alves
2015-10-29 13:03 ` gdb/linux-record fixes Pedro Alves
2015-10-29 13:03 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox