diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 296e8612468..dacfcca16a0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2015-10-30 Marcin Koƛcielnicki + + * linux-record.c (record_linux_msghdr): Fix msg_namelen handling. + 2015-10-30 Marcin Koƛcielnicki * aarch64-linux-tdep.c (aarch64_linux_init_abi): Remove diff --git a/gdb/linux-record.c b/gdb/linux-record.c index e950e8d17e8..8832ef4ee51 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);