aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2012-03-22 20:33:42 +0000
committerRichard Henderson <rth@redhat.com>2012-03-22 20:33:42 +0000
commit227ee7fc71e305c761d26f0dfbc93c617bdc5556 (patch)
tree9bfc25ec63f447464bcdb7ff6f71153287ab88f5
parent7b282c5acc13f099b11a670de50fd52a0d81ea40 (diff)
downloadgdb-227ee7fc71e305c761d26f0dfbc93c617bdc5556.zip
gdb-227ee7fc71e305c761d26f0dfbc93c617bdc5556.tar.gz
gdb-227ee7fc71e305c761d26f0dfbc93c617bdc5556.tar.bz2
* jit.c (jit_read_code_entry): Compute alignment and offset of
int64_t member before computing entry_size.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/jit.c13
2 files changed, 12 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7c653be..fce6934 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-22 Richard Henderson <rth@redhat.com>
+
+ * jit.c (jit_read_code_entry): Compute alignment and offset of
+ int64_t member before computing entry_size.
+
2012-03-22 Siva Chandra Reddy <sivachandra@google.com>
Python scripting: Add new method Value.referenced_value to
diff --git a/gdb/jit.c b/gdb/jit.c
index 6920a82..24ab016 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -384,7 +384,13 @@ jit_read_code_entry (struct gdbarch *gdbarch,
/* Figure out how big the entry is on the remote and how to read it. */
ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
ptr_size = TYPE_LENGTH (ptr_type);
- entry_size = 3 * ptr_size + 8; /* Three pointers and one 64-bit int. */
+
+ /* Figure out where the longlong value will be. */
+ align_bytes = gdbarch_long_long_align_bit (gdbarch) / 8;
+ off = 3 * ptr_size;
+ off = (off + (align_bytes - 1)) & ~(align_bytes - 1);
+
+ entry_size = off + 8; /* Three pointers and one 64-bit int. */
entry_buf = alloca (entry_size);
/* Read the entry. */
@@ -399,11 +405,6 @@ jit_read_code_entry (struct gdbarch *gdbarch,
extract_typed_address (&entry_buf[ptr_size], ptr_type);
code_entry->symfile_addr =
extract_typed_address (&entry_buf[2 * ptr_size], ptr_type);
-
- align_bytes = gdbarch_long_long_align_bit (gdbarch) / 8;
- off = 3 * ptr_size;
- off = (off + (align_bytes - 1)) & ~(align_bytes - 1);
-
code_entry->symfile_size =
extract_unsigned_integer (&entry_buf[off], 8, byte_order);
}