* objdump.c (SFILE): Add size field.
[deliverable/binutils-gdb.git] / gdb / rs6000-tdep.c
index e6939569e2ea2542e1b366da52452f3ccef2fe15..47fd886dc2e497ebf4953f5d09ffb2b1a049db63 100644 (file)
@@ -19,7 +19,6 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
-#include "tm.h"
 #include "frame.h"
 #include "inferior.h"
 #include "symtab.h"
@@ -33,9 +32,6 @@ extern struct obstack frame_cache_obstack;
 
 extern int errno;
 
-/* Nonzero if we just simulated a single step break. */
-int one_stepped;
-
 /* Breakpoint shadows for the single step instructions will be kept here. */
 
 static struct sstep_breaks {
@@ -135,12 +131,32 @@ branch_dest (opcode, instr, pc, safety)
 }
 
 
+/* Sequence of bytes for breakpoint instruction.  */
+
+#define BIG_BREAKPOINT { 0x7d, 0x82, 0x10, 0x08 }
+#define LITTLE_BREAKPOINT { 0x08, 0x10, 0x82, 0x7d }
+
+unsigned char *
+rs6000_breakpoint_from_pc (bp_addr, bp_size)
+     CORE_ADDR *bp_addr;
+     int *bp_size;
+{
+  static unsigned char big_breakpoint[] = BIG_BREAKPOINT;
+  static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT;
+  *bp_size = 4;
+  if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+    return big_breakpoint;
+  else
+    return little_breakpoint;
+}
+
 
 /* AIX does not support PT_STEP. Simulate it. */
 
 void
-single_step (signal)
+rs6000_software_single_step (signal, insert_breakpoints_p)
      enum target_signal signal;
+     int insert_breakpoints_p;
 {
 #define        INSNLEN(OPCODE)  4
 
@@ -152,7 +168,8 @@ single_step (signal)
   CORE_ADDR breaks[2];
   int opcode;
 
-  if (!one_stepped) {
+  if (insert_breakpoints_p) {
+
     loc = read_pc ();
 
     insn = read_memory_integer (loc, 4);
@@ -179,7 +196,6 @@ single_step (signal)
       stepBreaks[ii].address = breaks[ii];
     }  
 
-    one_stepped = 1;
   } else {
 
     /* remove step breakpoints. */
@@ -188,7 +204,6 @@ single_step (signal)
         write_memory 
            (stepBreaks[ii].address, stepBreaks[ii].data, 4);
 
-    one_stepped = 0;
   }
   errno = 0;                   /* FIXME, don't ignore errors! */
                        /* What errors?  {read,write}_memory call error().  */
This page took 0.024659 seconds and 4 git commands to generate.