summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kościelnicki <koriakin@0x04.net>2015-10-30 15:51:59 +0000
committerPedro Alves <palves@redhat.com>2015-10-30 15:51:59 +0000
commitcb658d218b873a69b1f19971695f92d5db17a388 (patch)
tree256df464db050b7c93de5da57aed8d32016082e8
parentb80d067ff0a7d2fcca3f8c01abf4b7201e71b8f0 (diff)
downloadbinutils-gdb-cb658d218b873a69b1f19971695f92d5db17a388.tar.gz
gdb/linux-record: Fix [gs]etgroups16 syscall
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.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/linux-record.c17
2 files changed, 14 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 413e12c6c4a..a6d007191a6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2015-10-30 Marcin Kościelnicki <koriakin@0x04.net>
+ * linux-record.c (record_linux_system_call): Fix [gs]etgroups16.
+
+2015-10-30 Marcin Kościelnicki <koriakin@0x04.net>
+
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Add size_time_t.
* amd64-linux-tdep.c (amd64_linux_init_abi): Add size_time_t.
(amd64_x32_linux_init_abi): Add size_time_t.
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index dbd8f14a79a..25cbda1afcf 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: