diff options
author | Stan Shebs <shebs@codesourcery.com> | 2008-08-11 19:00:25 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 2008-08-11 19:00:25 +0000 |
commit | 9d4fde7506bd543f837946511c7adf055148ff23 (patch) | |
tree | aadbf5e5a3f675f7d25a6ff8ac9ce7e08c9deb13 /gdb/gdbarch.c | |
parent | 90aecf7a80c1cefeb45fc10a6cd02c8338e34b4c (diff) | |
download | gdb-9d4fde7506bd543f837946511c7adf055148ff23.zip gdb-9d4fde7506bd543f837946511c7adf055148ff23.tar.gz gdb-9d4fde7506bd543f837946511c7adf055148ff23.tar.bz2 |
ARM BE8 support.
* disasm.c (gdb_disassemble_info): Set endian_code.
* gdbarch.sh (gdbarch_info): New field byte_order_for_code.
* gdbarch.h, gdbarch.c: Regenerate.
* arch-utils.c (initialize_current_architecture): Set the
default byte_order_for_code.
(gdbarch_info_init): Ditto.
(gdbarch_info_fill): Ditto.
* arm-tdep.c (SWAP_INT, SWAP_SHORT): New macros.
(thumb_analyze_prologue): Swap halfword if code endianness is
different from general endianness.
(arm_skip_prologue): Similarly.
(arm_scan_prologue): Ditto.
(thumb_get_next_pc): Ditto.
(arm_get_next_pc): Ditto.
(arm_gdbarch_init): Set byte_order_for_code from BE8 flag,
choose correct endianness for breakpoints.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 6b173c2..504cb77 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -90,6 +90,7 @@ struct gdbarch /* basic architectural information */ const struct bfd_arch_info * bfd_arch_info; int byte_order; + int byte_order_for_code; enum gdb_osabi osabi; const struct target_desc * target_desc; @@ -254,6 +255,7 @@ struct gdbarch startup_gdbarch = /* basic architecture information */ &bfd_default_arch_struct, /* bfd_arch_info */ BFD_ENDIAN_BIG, /* byte_order */ + BFD_ENDIAN_BIG, /* byte_order_for_code */ GDB_OSABI_UNKNOWN, /* osabi */ 0, /* target_desc */ /* target specific vector and its dump routine */ @@ -398,6 +400,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->bfd_arch_info = info->bfd_arch_info; gdbarch->byte_order = info->byte_order; + gdbarch->byte_order_for_code = info->byte_order_for_code; gdbarch->osabi = info->osabi; gdbarch->target_desc = info->target_desc; @@ -693,6 +696,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: byte_order = %s\n", paddr_d (gdbarch->byte_order)); fprintf_unfiltered (file, + "gdbarch_dump: byte_order_for_code = %s\n", + paddr_d (gdbarch->byte_order_for_code)); + fprintf_unfiltered (file, "gdbarch_dump: call_dummy_location = %s\n", paddr_d (gdbarch->call_dummy_location)); fprintf_unfiltered (file, @@ -1122,6 +1128,15 @@ gdbarch_byte_order (struct gdbarch *gdbarch) return gdbarch->byte_order; } +int +gdbarch_byte_order_for_code (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n"); + return gdbarch->byte_order_for_code; +} + enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch) { |