aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2011-10-11 19:08:59 +0000
committerDavid S. Miller <davem@redhat.com>2011-10-11 19:08:59 +0000
commit205c306f8020479681add9d274b2c261acc48318 (patch)
treec2115206a3c038bad74bc1f8a3ea8cb7a558e6f6 /gdb/gdbarch.c
parentfac7ceb31e1d0600828e3d1c5729871fe1f10600 (diff)
downloadgdb-205c306f8020479681add9d274b2c261acc48318.zip
gdb-205c306f8020479681add9d274b2c261acc48318.tar.gz
gdb-205c306f8020479681add9d274b2c261acc48318.tar.bz2
Fix jit.exp on most 32-bit targets.
* gdbarch.sh: New field 'long_long_align_bit'. * gdbarch.c, gdbarch.h: Regenerate. * i386-tdep.c (i386_gdbarch_init): Set long_long_align_bit to 32. * jit.c (jit_read_code_entry): Use it to determine correct size offset.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 2b892b6..ea48fa7 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -145,6 +145,7 @@ struct gdbarch
int int_bit;
int long_bit;
int long_long_bit;
+ int long_long_align_bit;
int half_bit;
const struct floatformat ** half_format;
int float_bit;
@@ -299,6 +300,7 @@ struct gdbarch startup_gdbarch =
8 * sizeof (int), /* int_bit */
8 * sizeof (long), /* long_bit */
8 * sizeof (LONGEST), /* long_long_bit */
+ 8 * sizeof (LONGEST), /* long_long_align_bit */
16, /* half_bit */
0, /* half_format */
8 * sizeof (float), /* float_bit */
@@ -463,6 +465,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->int_bit = 4*TARGET_CHAR_BIT;
gdbarch->long_bit = 4*TARGET_CHAR_BIT;
gdbarch->long_long_bit = 2*gdbarch->long_bit;
+ gdbarch->long_long_align_bit = 2*gdbarch->long_bit;
gdbarch->half_bit = 2*TARGET_CHAR_BIT;
gdbarch->float_bit = 4*TARGET_CHAR_BIT;
gdbarch->double_bit = 8*TARGET_CHAR_BIT;
@@ -576,6 +579,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of int_bit, invalid_p == 0 */
/* Skip verify of long_bit, invalid_p == 0 */
/* Skip verify of long_long_bit, invalid_p == 0 */
+ /* Skip verify of long_long_align_bit, invalid_p == 0 */
/* Skip verify of half_bit, invalid_p == 0 */
if (gdbarch->half_format == 0)
gdbarch->half_format = floatformats_ieee_half;
@@ -1020,6 +1024,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: long_double_format = %s\n",
pformat (gdbarch->long_double_format));
fprintf_unfiltered (file,
+ "gdbarch_dump: long_long_align_bit = %s\n",
+ plongest (gdbarch->long_long_align_bit));
+ fprintf_unfiltered (file,
"gdbarch_dump: long_long_bit = %s\n",
plongest (gdbarch->long_long_bit));
fprintf_unfiltered (file,
@@ -1424,6 +1431,23 @@ set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
}
int
+gdbarch_long_long_align_bit (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of long_long_align_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_align_bit called\n");
+ return gdbarch->long_long_align_bit;
+}
+
+void
+set_gdbarch_long_long_align_bit (struct gdbarch *gdbarch,
+ int long_long_align_bit)
+{
+ gdbarch->long_long_align_bit = long_long_align_bit;
+}
+
+int
gdbarch_half_bit (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);