2001-12-17 Fernando Nasser <fnasser@redhat.com>

From Richard Earnshaw <rearnsha@arm.com>:
	* arm-tdep.c (arm_software_single_step): New function. Implements
	software single-stepping for ARM targets.
	(arm_get_next_pc, thumb_get_next_pc, bitcount, shifted_reg_val): Only
	needed for software single-stepping.
	* config/arm/tm-arm.h: Activate SOFTWARE_SINGLE_STEP_P.
This commit is contained in:
Fernando Nasser
2001-12-17 17:03:58 +00:00
parent c5c586eddb
commit 9512d7fdf5
3 changed files with 55 additions and 8 deletions

View File

@ -1532,6 +1532,8 @@ condition_true (unsigned long cond, unsigned long status_reg)
return 1;
}
#if SOFTWARE_SINGLE_STEP_P
/* Support routines for single stepping. Calculate the next PC value. */
#define submask(x) ((1L << ((x) + 1)) - 1)
#define bit(obj,st) (((obj) >> (st)) & 1)
#define bits(obj,st,fn) (((obj) >> (st)) & submask ((fn) - (st)))
@ -1866,6 +1868,32 @@ arm_get_next_pc (CORE_ADDR pc)
return nextpc;
}
/* single_step() is called just before we want to resume the inferior,
if we want to single-step it but there is no hardware or kernel
single-step support. We find the target of the coming instruction
and breakpoint it.
single_step is also called just after the inferior stops. If we had
set up a simulated single-step, we undo our damage. */
void
arm_software_single_step (ignore, insert_bpt)
int ignore; /* Signal, not needed */
int insert_bpt;
{
static int next_pc; /* State between setting and unsetting. */
static char break_mem[BREAKPOINT_MAX]; /* Temporary storage for mem@bpt */
if (insert_bpt)
{
next_pc = arm_get_next_pc (read_register (PC_REGNUM));
target_insert_breakpoint (next_pc, &break_mem);
}
else
target_remove_breakpoint (next_pc, &break_mem);
}
#endif /* SOFTWARE_SINGLE_STEP_P */
#include "bfd-in2.h"
#include "libcoff.h"