2016-11-22 Yao Qi <yao.qi@linaro.org>
+ * gdbarch.sh (software_single_step): Change parameter from frame_info
+ to regcache.
+ * gdbarch.c, gdbarch.h: Regenerated.
+ * aarch64-tdep.c (aarch64_software_single_step): Change parameter
+ from frame_info to regcache. Don't call get_current_regcache.
+ * alpha-tdep.c (alpha_deal_with_atomic_sequence): Likewise.
+ (alpha_software_single_step): Likewise.
+ * alpha-tdep.h (alpha_software_single_step): Update declaration.
+ * arm-linux-tdep.c (arm_linux_software_single_step): Likewise.
+ * arm-tdep.c (arm_software_single_step): Likewise.
+ * arm-tdep.h (arm_software_single_step): Likewise.
+ * breakpoint.c (insert_single_step_breakpoint): Pass regcache to
+ gdbarch_software_single_step.
+ * cris-tdep.c (cris_software_single_step): Change parameter from
+ frame_info to regcache. Don't call get_current_regcache.
+ * mips-tdep.c (mips_software_single_step): Likewise.
+ * mips-tdep.h (mips_software_single_step): Update declaration.
+ * moxie-tdep.c (moxie_software_single_step): Likewise.
+ * nios2-tdep.c (nios2_software_single_step): Likewise.
+ * ppc-tdep.h (ppc_deal_with_atomic_sequence): Update declaration.
+ * rs6000-aix-tdep.c (rs6000_software_single_step): Likewise.
+ * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Likewise.
+ * s390-linux-tdep.c (s390_software_single_step): Likewise.
+ * sparc-tdep.c (sparc_software_single_step): Likewise.
+ * spu-tdep.c (spu_software_single_step): Likewise.
+ * tic6x-tdep.c (tic6x_software_single_step): Likewise.
+
+2016-11-22 Yao Qi <yao.qi@linaro.org>
+
* spu-tdep.c (spu_software_single_step): Call get_regcache_arch
instead of get_frame_arch. Call regcache_read_pc instead of
get_frame_pc. Call regcache_raw_get_unsigned instead of
single step through atomic sequences on AArch64. */
static VEC (CORE_ADDR) *
-aarch64_software_single_step (struct frame_info *frame)
+aarch64_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch);
const int insn_size = 4;
the sequence. */
static VEC (CORE_ADDR) *
-alpha_deal_with_atomic_sequence (struct frame_info *frame)
+alpha_deal_with_atomic_sequence (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR pc = regcache_read_pc (regcache);
CORE_ADDR breaks[2] = {-1, -1};
}
VEC (CORE_ADDR) *
-alpha_software_single_step (struct frame_info *frame)
+alpha_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR pc;
VEC (CORE_ADDR) *next_pcs = NULL;
};
extern unsigned int alpha_read_insn (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern VEC (CORE_ADDR) *alpha_software_single_step (struct frame_info *frame);
+extern VEC (CORE_ADDR) *alpha_software_single_step (struct regcache *regcache);
extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc);
extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);
/* Insert a single step breakpoint at the next executed instruction. */
static VEC (CORE_ADDR) *
-arm_linux_software_single_step (struct frame_info *frame)
+arm_linux_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct arm_get_next_pcs next_pcs_ctx;
CORE_ADDR pc;
and breakpoint them. */
VEC (CORE_ADDR) *
-arm_software_single_step (struct frame_info *frame)
+arm_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct arm_get_next_pcs next_pcs_ctx;
CORE_ADDR pc;
int arm_get_next_pcs_is_thumb (struct arm_get_next_pcs *self);
-VEC (CORE_ADDR) *arm_software_single_step (struct frame_info *);
+VEC (CORE_ADDR) *arm_software_single_step (struct regcache *);
int arm_is_thumb (struct regcache *regcache);
int arm_frame_is_thumb (struct frame_info *frame);
int
insert_single_step_breakpoints (struct gdbarch *gdbarch)
{
- struct frame_info *frame = get_current_frame ();
+ struct regcache *regcache = get_current_regcache ();
VEC (CORE_ADDR) * next_pcs;
- next_pcs = gdbarch_software_single_step (gdbarch, frame);
+ next_pcs = gdbarch_software_single_step (gdbarch, regcache);
if (next_pcs != NULL)
{
int i;
CORE_ADDR pc;
+ struct frame_info *frame = get_current_frame ();
struct address_space *aspace = get_frame_address_space (frame);
for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++)
Either one ordinary target or two targets for branches may be found. */
static VEC (CORE_ADDR) *
-cris_software_single_step (struct frame_info *frame)
+cris_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
inst_env_type inst_env;
VEC (CORE_ADDR) *next_pcs = NULL;
}
VEC (CORE_ADDR) *
-gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
+gdbarch_software_single_step (struct gdbarch *gdbarch, struct regcache *regcache)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->software_single_step != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
- return gdbarch->software_single_step (frame);
+ return gdbarch->software_single_step (regcache);
}
void
extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
-typedef VEC (CORE_ADDR) * (gdbarch_software_single_step_ftype) (struct frame_info *frame);
-extern VEC (CORE_ADDR) * gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame);
+typedef VEC (CORE_ADDR) * (gdbarch_software_single_step_ftype) (struct regcache *regcache);
+extern VEC (CORE_ADDR) * gdbarch_software_single_step (struct gdbarch *gdbarch, struct regcache *regcache);
extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
/* Return non-zero if the processor is executing a delay slot and a
# the condition and only put the breakpoint at the branch destination if
# the condition is true, so that we ensure forward progress when stepping
# past a conditional branch to self.
-F:VEC (CORE_ADDR) *:software_single_step:struct frame_info *frame:frame
+F:VEC (CORE_ADDR) *:software_single_step:struct regcache *regcache:regcache
# Return non-zero if the processor is executing a delay slot and a
# further single-step is needed before the instruction finishes.
the target of the coming instruction and breakpoint it. */
VEC (CORE_ADDR) *
-mips_software_single_step (struct frame_info *frame)
+mips_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR pc, next_pc;
VEC (CORE_ADDR) *next_pcs;
};
/* Single step based on where the current instruction will take us. */
-extern VEC (CORE_ADDR) *mips_software_single_step (struct frame_info *frame);
+extern VEC (CORE_ADDR) *mips_software_single_step (struct regcache *regcache);
/* Strip the ISA (compression) bit off from ADDR. */
extern CORE_ADDR mips_unmake_compact_addr (CORE_ADDR addr);
/* Insert a single step breakpoint. */
static VEC (CORE_ADDR) *
-moxie_software_single_step (struct frame_info *frame)
+moxie_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR addr;
gdb_byte buf[4];
/* Implement the software_single_step gdbarch method. */
static VEC (CORE_ADDR) *
-nios2_software_single_step (struct frame_info *frame)
+nios2_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR next_pc = nios2_get_next_pc (regcache, regcache_read_pc (regcache));
VEC (CORE_ADDR) *next_pcs = NULL;
/* Return non-zero if the architecture described by GDBARCH has
VSX registers (vsr0 --- vsr63). */
int vsx_support_p (struct gdbarch *gdbarch);
-VEC (CORE_ADDR) *ppc_deal_with_atomic_sequence (struct frame_info *frame);
+VEC (CORE_ADDR) *ppc_deal_with_atomic_sequence (struct regcache *regcache);
/* Register set description. */
/* AIX does not support PT_STEP. Simulate it. */
static VEC (CORE_ADDR) *
-rs6000_software_single_step (struct frame_info *frame)
+rs6000_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int ii, insn;
insn = read_memory_integer (loc, 4, byte_order);
- next_pcs = ppc_deal_with_atomic_sequence (frame);
+ next_pcs = ppc_deal_with_atomic_sequence (regcache);
if (next_pcs != NULL)
return next_pcs;
the sequence. */
VEC (CORE_ADDR) *
-ppc_deal_with_atomic_sequence (struct frame_info *frame)
+ppc_deal_with_atomic_sequence (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR pc = regcache_read_pc (regcache);
complexity. */
static VEC (CORE_ADDR) *
-s390_software_single_step (struct frame_info *frame)
+s390_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR loc = regcache_read_pc (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
}
static VEC (CORE_ADDR) *
-sparc_software_single_step (struct frame_info *frame)
+sparc_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *arch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (arch);
CORE_ADDR npc, nnpc;
/* Software single-stepping support. */
static VEC (CORE_ADDR) *
-spu_software_single_step (struct frame_info *frame)
+spu_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR pc, next_pc;
/* This is the implementation of gdbarch method software_single_step. */
static VEC (CORE_ADDR) *
-tic6x_software_single_step (struct frame_info *frame)
+tic6x_software_single_step (struct regcache *regcache)
{
- struct regcache *regcache = get_current_regcache ();
CORE_ADDR next_pc = tic6x_get_next_pc (regcache, regcache_read_pc (regcache));
VEC (CORE_ADDR) *next_pcs = NULL;