gdb/linux-record: Fix old_select syscall handling
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.
This commit is contained in:
parent
d2de23ad39
commit
ff83a547fe
2 changed files with 30 additions and 19 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2015-10-30 Marcin Kościelnicki <koriakin@0x04.net>
|
||||||
|
|
||||||
|
* linux-record.c (record_linux_system_call): Fix old_select.
|
||||||
|
|
||||||
2015-10-30 Marcin Kościelnicki <koriakin@0x04.net>
|
2015-10-30 Marcin Kościelnicki <koriakin@0x04.net>
|
||||||
|
|
||||||
* linux-record.c (record_linux_system_call): Fix newstatat.
|
* linux-record.c (record_linux_system_call): Fix newstatat.
|
||||||
|
|
|
@ -645,38 +645,45 @@ record_linux_system_call (enum gdb_syscall syscall,
|
||||||
|
|
||||||
case gdb_old_select:
|
case gdb_old_select:
|
||||||
{
|
{
|
||||||
struct sel_arg_struct
|
unsigned long sz_sel_arg = tdep->size_long + tdep->size_pointer * 4;
|
||||||
{
|
gdb_byte *a = (gdb_byte *) alloca (sz_sel_arg);
|
||||||
CORE_ADDR n;
|
CORE_ADDR inp, outp, exp, tvp;
|
||||||
CORE_ADDR inp;
|
|
||||||
CORE_ADDR outp;
|
|
||||||
CORE_ADDR exp;
|
|
||||||
CORE_ADDR tvp;
|
|
||||||
} sel;
|
|
||||||
|
|
||||||
regcache_raw_read_unsigned (regcache, tdep->arg1,
|
regcache_raw_read_unsigned (regcache, tdep->arg1,
|
||||||
&tmpulongest);
|
&tmpulongest);
|
||||||
if (tmpulongest)
|
if (tmpulongest)
|
||||||
{
|
{
|
||||||
if (target_read_memory (tmpulongest, (gdb_byte *) &sel,
|
if (target_read_memory (tmpulongest, a, sz_sel_arg))
|
||||||
sizeof(sel)))
|
|
||||||
{
|
{
|
||||||
if (record_debug)
|
if (record_debug)
|
||||||
fprintf_unfiltered (gdb_stdlog,
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
"Process record: error reading memory "
|
"Process record: error reading memory "
|
||||||
"at addr = 0x%s len = %lu.\n",
|
"at addr = 0x%s len = %lu.\n",
|
||||||
OUTPUT_REG (tmpulongest, tdep->arg1),
|
OUTPUT_REG (tmpulongest, tdep->arg1),
|
||||||
(unsigned long) sizeof (sel));
|
sz_sel_arg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (record_full_arch_list_add_mem (sel.inp, tdep->size_fd_set))
|
/* Skip n. */
|
||||||
return -1;
|
a += tdep->size_long;
|
||||||
if (record_full_arch_list_add_mem (sel.outp, tdep->size_fd_set))
|
inp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
||||||
return -1;
|
a += tdep->size_pointer;
|
||||||
if (record_full_arch_list_add_mem (sel.exp, tdep->size_fd_set))
|
outp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
||||||
return -1;
|
a += tdep->size_pointer;
|
||||||
if (record_full_arch_list_add_mem (sel.tvp, tdep->size_timeval))
|
exp = extract_unsigned_integer (a, tdep->size_pointer, byte_order);
|
||||||
return -1;
|
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;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue