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.
This commit is contained in:
Stan Shebs
2008-08-11 19:00:25 +00:00
parent 90aecf7a80
commit 9d4fde7506
7 changed files with 83 additions and 1 deletions

View File

@@ -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;
@@ -692,6 +695,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
fprintf_unfiltered (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));
@@ -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)
{