* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / rs6000-tdep.c
index 1dfc20d2cecf6cd12ef648302bdfe6c1e589c78f..89c3ddd54d2b4a59f6312a10a7a2ff82c7980ec9 100644 (file)
@@ -126,7 +126,9 @@ single_step (signal)
 {
 #define        INSNLEN(OPCODE)  4
 
-  static char breakp[] = BREAKPOINT;
+  static char le_breakp[] = LITTLE_BREAKPOINT;
+  static char be_breakp[] = BIG_BREAKPOINT;
+  char *breakp = TARGET_BYTE_ORDER == BIG_ENDIAN ? be_breakp : le_breakp;
   int ii, insn;
   CORE_ADDR loc;
   CORE_ADDR breaks[2];
@@ -1172,7 +1174,8 @@ free_loadinfo ()
 /* this is called from xcoffread.c */
 
 void
-xcoff_add_toc_to_loadinfo (unsigned long tocoff)
+xcoff_add_toc_to_loadinfo (tocoff)
+     unsigned long tocoff;
 {
   while (loadinfotocindex >= loadinfolen) {
     loadinfolen += LOADINFOLEN;
@@ -1198,10 +1201,12 @@ add_text_to_loadinfo (textaddr, dataaddr)
 }
 
 
-/* FIXME:  This assumes that the "textorg" and "dataorg" elements
+/* Note that this assumes that the "textorg" and "dataorg" elements
    of a member of this array are correlated with the "toc_offset"
-   element of the same member.  But they are sequentially assigned in wildly
-   different places, and probably there is no correlation.  FIXME!  */
+   element of the same member.  This is taken care of because the loops
+   which assign the former (in xcoff_relocate_symtab or xcoff_relocate_core)
+   and the latter (in scan_xcoff_symtab, via vmap_symtab, in vmap_ldinfo
+   or xcoff_relocate_core) traverse the same objfiles in the same order.  */
 
 static CORE_ADDR
 find_toc_address (pc)
@@ -1218,12 +1223,25 @@ find_toc_address (pc)
   return loadinfo[toc_entry].dataorg + loadinfo[toc_entry].toc_offset;
 }
 
+#ifdef GDB_TARGET_POWERPC
+int
+gdb_print_insn_powerpc (memaddr, info)
+     bfd_vma memaddr;
+     disassemble_info *info;
+{
+  if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+    return print_insn_big_powerpc (memaddr, info);
+  else
+    return print_insn_little_powerpc (memaddr, info);
+}
+#endif
+
 void
 _initialize_rs6000_tdep ()
 {
   /* FIXME, this should not be decided via ifdef. */
 #ifdef GDB_TARGET_POWERPC
-  tm_print_insn = print_insn_big_powerpc;
+  tm_print_insn = gdb_print_insn_powerpc;
 #else
   tm_print_insn = print_insn_rs6000;
 #endif
This page took 0.024244 seconds and 4 git commands to generate.