2016-01-14 Yao Qi <yao.qi@linaro.org>
+ * arm-linux-tdep.c (arm_linux_get_next_pcs_syscall_next_pc):
+ Declare.
+ (arm_linux_get_next_pcs_ops): Install
+ arm_linux_get_next_pcs_syscall_next_pc.
+ (arm_linux_syscall_next_pc): Change to ...
+ (arm_linux_get_next_pcs_syscall_next_pc): ... it.
+ (arm_linux_init_abi): Don't set tdep->syscall_next_pc.
+ * arm-tdep.c (arm_get_next_pcs_syscall_next_pc): Declare.
+ (arm_get_next_pcs_syscall_next_pc): Make it static. Don't
+ call tdep->syscall_next_pc.
+ * arm-tdep.h (struct gdbarch_tdep) <syscall_next_pc>: Remove.
+ (arm_get_next_pcs_syscall_next_pc): Remove.
+
+2016-01-14 Yao Qi <yao.qi@linaro.org>
+
* remote.c (remote_set_syscall_catchpoint): Cast to char *.
* thread.c (do_captured_thread_select): Cast to const char *.
/* Syscall number for rt_sigreturn. */
#define ARM_RT_SIGRETURN 173
+static CORE_ADDR
+ arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self,
+ CORE_ADDR pc);
+
/* Operation function pointers for get_next_pcs. */
static struct arm_get_next_pcs_ops arm_linux_get_next_pcs_ops = {
arm_get_next_pcs_read_memory_unsigned_integer,
- arm_get_next_pcs_syscall_next_pc,
+ arm_linux_get_next_pcs_syscall_next_pc,
arm_get_next_pcs_addr_bits_remove,
arm_get_next_pcs_is_thumb
};
return svc_number;
}
-/* When the processor is at a syscall instruction, return the PC of the
- next instruction to be executed. */
-
static CORE_ADDR
-arm_linux_syscall_next_pc (struct regcache *regcache)
+arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self,
+ CORE_ADDR pc)
{
- CORE_ADDR pc = regcache_read_pc (regcache);
CORE_ADDR next_pc = 0;
- int is_thumb = arm_is_thumb (regcache);
+ int is_thumb = arm_is_thumb (self->regcache);
ULONGEST svc_number = 0;
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = get_regcache_arch (self->regcache);
if (is_thumb)
{
- svc_number = regcache_raw_get_unsigned (regcache, 7);
+ svc_number = regcache_raw_get_unsigned (self->regcache, 7);
next_pc = pc + 2;
}
else
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = get_regcache_arch (self->regcache);
enum bfd_endian byte_order_for_code =
gdbarch_byte_order_for_code (gdbarch);
unsigned long this_instr =
}
else /* EABI. */
{
- svc_number = regcache_raw_get_unsigned (regcache, 7);
+ svc_number = regcache_raw_get_unsigned (self->regcache, 7);
}
next_pc = pc + 4;
}
if (svc_number == ARM_SIGRETURN || svc_number == ARM_RT_SIGRETURN)
- next_pc = arm_linux_sigreturn_next_pc (regcache, svc_number);
+ next_pc = arm_linux_sigreturn_next_pc (self->regcache, svc_number);
/* Addresses for calling Thumb functions have the bit 0 set. */
if (is_thumb)
set_gdbarch_stap_parse_special_token (gdbarch,
arm_stap_parse_special_token);
- tdep->syscall_next_pc = arm_linux_syscall_next_pc;
-
/* `catch syscall' */
set_xml_syscall_file_name (gdbarch, "syscalls/arm-linux.xml");
set_gdbarch_get_syscall_number (gdbarch, arm_linux_get_syscall_number);
struct regcache *regcache,
int regnum, const gdb_byte *buf);
+static CORE_ADDR
+ arm_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self,
+ CORE_ADDR pc);
+
+
/* get_next_pcs operations. */
static struct arm_get_next_pcs_ops arm_get_next_pcs_ops = {
arm_get_next_pcs_read_memory_unsigned_integer,
/* Wrapper over syscall_next_pc for use in get_next_pcs. */
-CORE_ADDR
-arm_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self, CORE_ADDR pc)
+static CORE_ADDR
+arm_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self,
+ CORE_ADDR pc)
{
- struct gdbarch_tdep *tdep;
-
- tdep = gdbarch_tdep (get_regcache_arch (self->regcache));
- if (tdep->syscall_next_pc != NULL)
- return tdep->syscall_next_pc (self->regcache);
-
return 0;
}
struct type *neon_double_type;
struct type *neon_quad_type;
- /* Return the expected next PC if the program is stopped at a syscall
- instruction. */
- CORE_ADDR (*syscall_next_pc) (struct regcache *regcache);
-
/* syscall record. */
int (*arm_syscall_record) (struct regcache *regcache, unsigned long svc_number);
};
CORE_ADDR arm_get_next_pcs_addr_bits_remove (struct arm_get_next_pcs *self,
CORE_ADDR val);
-CORE_ADDR arm_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self,
- CORE_ADDR pc);
-
int arm_get_next_pcs_is_thumb (struct arm_get_next_pcs *self);
void arm_insert_single_step_breakpoint (struct gdbarch *,