This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 05/11] gdb/linux-record: Fix msghdr parsing on 64-bit targets
- From: Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- To: gdb-patches at sourceware dot org
- Cc: Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- Date: Sat, 17 Oct 2015 23:41:15 +0200
- Subject: [PATCH 05/11] gdb/linux-record: Fix msghdr parsing on 64-bit targets
- Authentication-results: sourceware.org; auth=none
- References: <1445118081-10908-1-git-send-email-koriakin at 0x04 dot net>
The code failed to account for padding between the int and subsequent
pointer present on 64-bit architectures.
---
gdb/linux-record.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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);
--
2.6.1