summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-02-16 13:47:17 +0000
committerYao Qi <yao.qi@linaro.org>2016-02-16 13:47:17 +0000
commit553cb5270f28725de86636340574644e45318fe1 (patch)
treeb94ccd30b826b8a2d3aaf0d52fcc6862df2bd136
parent9406ee731d01bb34ee25280eec18167244ac6e2d (diff)
downloadbinutils-gdb-553cb5270f28725de86636340574644e45318fe1.tar.gz
Remove PC from syscall_next_pc
Method syscall_next_pc of struct arm_get_next_pcs_ops has an argument PC, which is not necessary, because PC can be got from regcache in 'struct arm_get_next_pcs'. This patch removes the PC argument of syscall_next_pc. gdb: 2016-02-16 Yao Qi <yao.qi@linaro.org> * arch/arm-get-next-pcs.h (struct arm_get_next_pcs_ops) <syscall_next_pc>: Remove argument PC. Callers updated. * arm-linux-tdep.c (arm_linux_get_next_pcs_syscall_next_pc): Remove argument PC. Get pc from regcache_read_pc. * arm-tdep.c (arm_get_next_pcs_syscall_next_pc): Remove argument PC. gdb/gdbserver: 2016-02-16 Yao Qi <yao.qi@linaro.org> * linux-arm-low.c (get_next_pcs_syscall_next_pc): Remove argument PC. Get pc from regcache_read_pc.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/arch/arm-get-next-pcs.c4
-rw-r--r--gdb/arch/arm-get-next-pcs.h2
-rw-r--r--gdb/arm-linux-tdep.c7
-rw-r--r--gdb/arm-tdep.c6
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/linux-arm-low.c6
7 files changed, 25 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7cb4b0a6314..c32722efd07 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2016-02-16 Yao Qi <yao.qi@linaro.org>
+
+ * arch/arm-get-next-pcs.h (struct arm_get_next_pcs_ops)
+ <syscall_next_pc>: Remove argument PC. Callers updated.
+ * arm-linux-tdep.c (arm_linux_get_next_pcs_syscall_next_pc):
+ Remove argument PC. Get pc from regcache_read_pc.
+ * arm-tdep.c (arm_get_next_pcs_syscall_next_pc): Remove
+ argument PC.
+
2016-02-15 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c (aarch64_analyze_prologue): Remove "0x".
diff --git a/gdb/arch/arm-get-next-pcs.c b/gdb/arch/arm-get-next-pcs.c
index 84048697987..f3e9fd97504 100644
--- a/gdb/arch/arm-get-next-pcs.c
+++ b/gdb/arch/arm-get-next-pcs.c
@@ -417,7 +417,7 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self)
unsigned long cond = bits (inst1, 8, 11);
if (cond == 0x0f) /* 0x0f = SWI */
{
- nextpc = self->ops->syscall_next_pc (self, pc);
+ nextpc = self->ops->syscall_next_pc (self);
}
else if (cond != 0x0f && condition_true (cond, status))
nextpc = pc_val + (sbits (inst1, 0, 7) << 1);
@@ -889,7 +889,7 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self)
break;
case 0xf: /* SWI */
{
- nextpc = self->ops->syscall_next_pc (self, pc);
+ nextpc = self->ops->syscall_next_pc (self);
}
break;
diff --git a/gdb/arch/arm-get-next-pcs.h b/gdb/arch/arm-get-next-pcs.h
index e038982c514..5525ee219fc 100644
--- a/gdb/arch/arm-get-next-pcs.h
+++ b/gdb/arch/arm-get-next-pcs.h
@@ -28,7 +28,7 @@ struct arm_get_next_pcs;
struct arm_get_next_pcs_ops
{
ULONGEST (*read_mem_uint) (CORE_ADDR memaddr, int len, int byte_order);
- CORE_ADDR (*syscall_next_pc) (struct arm_get_next_pcs *self, CORE_ADDR pc);
+ CORE_ADDR (*syscall_next_pc) (struct arm_get_next_pcs *self);
CORE_ADDR (*addr_bits_remove) (struct arm_get_next_pcs *self, CORE_ADDR val);
int (*is_thumb) (struct arm_get_next_pcs *self);
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index e416e28fefa..46d54bc4ee2 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -266,8 +266,7 @@ static const gdb_byte arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa
#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);
+ arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self);
/* Operation function pointers for get_next_pcs. */
static struct arm_get_next_pcs_ops arm_linux_get_next_pcs_ops = {
@@ -872,10 +871,10 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch,
}
static CORE_ADDR
-arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self,
- CORE_ADDR pc)
+arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self)
{
CORE_ADDR next_pc = 0;
+ CORE_ADDR pc = regcache_read_pc (self->regcache);
int is_thumb = arm_is_thumb (self->regcache);
ULONGEST svc_number = 0;
struct gdbarch *gdbarch = get_regcache_arch (self->regcache);
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 048406aca8d..9bd48a24832 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -238,8 +238,7 @@ static void arm_neon_quad_write (struct gdbarch *gdbarch,
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);
+ arm_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self);
/* get_next_pcs operations. */
@@ -6139,8 +6138,7 @@ arm_get_next_pcs_addr_bits_remove (struct arm_get_next_pcs *self,
/* Wrapper over syscall_next_pc for use in get_next_pcs. */
static CORE_ADDR
-arm_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self,
- CORE_ADDR pc)
+arm_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self)
{
return 0;
}
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 7676f7145c5..7bb2e18e42d 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-16 Yao Qi <yao.qi@linaro.org>
+
+ * linux-arm-low.c (get_next_pcs_syscall_next_pc): Remove argument
+ PC. Get pc from regcache_read_pc.
+
2016-02-12 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_get_pc): Call linux_get_pc_64bit
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 365f1c93222..57826f17d76 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -147,8 +147,7 @@ static ULONGEST get_next_pcs_read_memory_unsigned_integer (CORE_ADDR memaddr,
static CORE_ADDR get_next_pcs_addr_bits_remove (struct arm_get_next_pcs *self,
CORE_ADDR val);
-static CORE_ADDR get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self,
- CORE_ADDR pc);
+static CORE_ADDR get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self);
static int get_next_pcs_is_thumb (struct arm_get_next_pcs *self);
@@ -786,9 +785,10 @@ arm_sigreturn_next_pc (struct regcache *regcache, int svc_number,
/* When PC is at a syscall instruction, return the PC of the next
instruction to be executed. */
static CORE_ADDR
-get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self, CORE_ADDR pc)
+get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self)
{
CORE_ADDR next_pc = 0;
+ CORE_ADDR pc = regcache_read_pc (self->regcache);
int is_thumb = arm_is_thumb_mode ();
ULONGEST svc_number = 0;
struct regcache *regcache = self->regcache;