* armnbsd-tdep.c (arm_nbsd_arm_be_breakpoint): Define.
authorRichard Earnshaw <richard.earnshaw@arm.com>
Mon, 23 Aug 2004 10:28:58 +0000 (10:28 +0000)
committerRichard Earnshaw <richard.earnshaw@arm.com>
Mon, 23 Aug 2004 10:28:58 +0000 (10:28 +0000)
(arm_nbsd_thumb_[lb]e_breakpoint): Define.
(arm_netbsd_init_abi_common): Register them.

gdb/ChangeLog
gdb/armnbsd-tdep.c

index 2b30f27..25cac87 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-23  Richard Earnshaw  <rearnsha@arm.com>
+
+       * 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  <kettenis@gnu.org>
 
        * config/vax/vax.mh (NATDEPFILES): Add vax-nat.c.
index 38edf9f..0d7c0b5 100644 (file)
@@ -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;