mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-17 21:03:55 +08:00
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.
This commit is contained in:

committed by
Pedro Alves

parent
b80d067ff0
commit
cb658d218b
@ -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:
|
||||
|
Reference in New Issue
Block a user