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"
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 {
}
+/* 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
CORE_ADDR breaks[2];
int opcode;
- if (!one_stepped) {
+ if (insert_breakpoints_p) {
+
loc = read_pc ();
insn = read_memory_integer (loc, 4);
stepBreaks[ii].address = breaks[ii];
}
- one_stepped = 1;
} else {
/* remove step breakpoints. */
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(). */