aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-record.c
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2015-10-30 15:51:58 +0000
committerPedro Alves <palves@redhat.com>2015-10-30 15:51:58 +0000
commit933c5a623f247c63b642988a2984f5ce9b558d27 (patch)
tree90e158524331d5c933d8e1574bbfa730adfd798c /gdb/linux-record.c
parent72aded8673d6cb2d0e33696e010a778e9bbfa817 (diff)
downloadgdb-933c5a623f247c63b642988a2984f5ce9b558d27.zip
gdb-933c5a623f247c63b642988a2984f5ce9b558d27.tar.gz
gdb-933c5a623f247c63b642988a2984f5ce9b558d27.tar.bz2
gdb/linux-record: Fix msghdr parsing on 64-bit targets
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.
Diffstat (limited to 'gdb/linux-record.c')
-rw-r--r--gdb/linux-record.c4
1 files changed, 3 insertions, 1 deletions
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);