From: Richard Earnshaw Date: Mon, 23 Aug 2004 10:28:58 +0000 (+0000) Subject: * armnbsd-tdep.c (arm_nbsd_arm_be_breakpoint): Define. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2afeb6b8547ca12afa3fc084af1f2abb93bccd09;p=binutils-gdb.git * armnbsd-tdep.c (arm_nbsd_arm_be_breakpoint): Define. (arm_nbsd_thumb_[lb]e_breakpoint): Define. (arm_netbsd_init_abi_common): Register them. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2b30f27dac2..25cac87790f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-08-23 Richard Earnshaw + + * armnbsd-tdep.c (arm_nbsd_arm_be_breakpoint): Define. + (arm_nbsd_thumb_[lb]e_breakpoint): Define. + (arm_netbsd_init_abi_common): Register them. + 2004-08-22 Mark Kettenis * config/vax/vax.mh (NATDEPFILES): Add vax-nat.c. diff --git a/gdb/armnbsd-tdep.c b/gdb/armnbsd-tdep.c index 38edf9f1884..0d7c0b56dca 100644 --- a/gdb/armnbsd-tdep.c +++ b/gdb/armnbsd-tdep.c @@ -35,6 +35,9 @@ /* For compatibility with previous implemenations of GDB on arm/NetBSD, override the default little-endian breakpoint. */ static const char arm_nbsd_arm_le_breakpoint[] = {0x11, 0x00, 0x00, 0xe6}; +static const char arm_nbsd_arm_be_breakpoint[] = {0xe6, 0x00, 0x00, 0x11}; +static const char arm_nbsd_thumb_le_breakpoint[] = {0xfe, 0xde}; +static const char arm_nbsd_thumb_be_breakpoint[] = {0xde, 0xfe}; static int arm_netbsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name) @@ -52,8 +55,26 @@ arm_netbsd_init_abi_common (struct gdbarch_info info, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); tdep->lowest_pc = 0x8000; - tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint; - tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint); + switch (info.byte_order) + { + case BFD_ENDIAN_LITTLE: + tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint; + tdep->thumb_breakpoint = arm_nbsd_thumb_le_breakpoint; + tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint); + tdep->thumb_breakpoint_size = sizeof (arm_nbsd_thumb_le_breakpoint); + break; + + case BFD_ENDIAN_BIG: + tdep->arm_breakpoint = arm_nbsd_arm_be_breakpoint; + tdep->thumb_breakpoint = arm_nbsd_thumb_be_breakpoint; + tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_be_breakpoint); + tdep->thumb_breakpoint_size = sizeof (arm_nbsd_thumb_be_breakpoint); + break; + + default: + internal_error (__FILE__, __LINE__, + "arm_gdbarch_init: bad byte order for float format"); + } tdep->jb_pc = ARM_NBSD_JB_PC; tdep->jb_elt_size = ARM_NBSD_JB_ELEMENT_SIZE;