aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorMarkus Deuling <deuling@de.ibm.com>2008-01-18 17:07:40 +0000
committerMarkus Deuling <deuling@de.ibm.com>2008-01-18 17:07:40 +0000
commit32c9a7957208ebe4d7a833cecbf552f3f852e733 (patch)
treee9504294b71969645a7458f45621802f01b00d6d /gdb/gdbarch.c
parent1e5e79d0ce60af39979b37292669ec6dae3a9975 (diff)
downloadgdb-32c9a7957208ebe4d7a833cecbf552f3f852e733.zip
gdb-32c9a7957208ebe4d7a833cecbf552f3f852e733.tar.gz
gdb-32c9a7957208ebe4d7a833cecbf552f3f852e733.tar.bz2
* gdbarch.sh (function_list): Add new property bits_big_endian to
gdbarch structure. * gdbarch.{c,h}: Regenerate. * value.c (struct value): Replace BITS_BIG_ENDIAN by gdbarch_bits_big_endian (comment). (unpack_field_as_long, modify_field): Likewise. * value.h: Likewise (comment). * valops.c (value_slice): Likewise. * valarith.c (value_subscript, value_bit_index): Likewise. * gdbtypes.h (field): Likewise (comment). * eval.c (evaluate_subexp_standard): Likewise. * dwarf2read.c (dwarf2_add_field): Likewise. * ada-lang.c (decode_packed_array, ada_value_primitive_packed_val) (move_bits, ada_value_assign, value_assign_to_component): Likewise. * defs.h (BITS_BIG_ENDIAN): Remove. * gdbint.texinfo (Target Conditionals): Replace the description of BITS_BIG_ENDIAN with a description of gdbarch_bits_big_endian.
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 90e3f47..3c5a282 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -130,6 +130,7 @@ struct gdbarch
*/
+ int bits_big_endian;
int short_bit;
int int_bit;
int long_bit;
@@ -251,6 +252,7 @@ struct gdbarch startup_gdbarch =
/*per-architecture data-pointers and swap regions */
0, NULL, NULL,
/* Multi-arch values */
+ 1, /* bits_big_endian */
8 * sizeof (short), /* short_bit */
8 * sizeof (int), /* int_bit */
8 * sizeof (long), /* long_bit */
@@ -382,6 +384,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->target_desc = info->target_desc;
/* Force the explicit initialization of these. */
+ gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
gdbarch->short_bit = 2*TARGET_CHAR_BIT;
gdbarch->int_bit = 4*TARGET_CHAR_BIT;
gdbarch->long_bit = 4*TARGET_CHAR_BIT;
@@ -480,6 +483,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if (gdbarch->bfd_arch_info == NULL)
fprintf_unfiltered (log, "\n\tbfd_arch_info");
/* Check those that need to be defined for the given multi-arch level. */
+ /* Skip verify of bits_big_endian, invalid_p == 0 */
/* Skip verify of short_bit, invalid_p == 0 */
/* Skip verify of int_bit, invalid_p == 0 */
/* Skip verify of long_bit, invalid_p == 0 */
@@ -648,6 +652,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: bfd_arch_info = %s\n",
gdbarch_bfd_arch_info (gdbarch)->printable_name);
fprintf_unfiltered (file,
+ "gdbarch_dump: bits_big_endian = %s\n",
+ paddr_d (gdbarch->bits_big_endian));
+ fprintf_unfiltered (file,
"gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
(long) gdbarch->breakpoint_from_pc);
fprintf_unfiltered (file,
@@ -1060,6 +1067,23 @@ gdbarch_target_desc (struct gdbarch *gdbarch)
}
int
+gdbarch_bits_big_endian (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of bits_big_endian, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
+ return gdbarch->bits_big_endian;
+}
+
+void
+set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
+ int bits_big_endian)
+{
+ gdbarch->bits_big_endian = bits_big_endian;
+}
+
+int
gdbarch_short_bit (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);