diff options
author | Yao Qi <yao.qi@linaro.org> | 2016-01-26 14:08:26 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2016-01-26 14:08:26 +0000 |
commit | 4d18591be953e2faeaaa280484d375fe05857770 (patch) | |
tree | 4c5bbcc7514ab016e52fb52f655f940d05fb2b08 /gdb/arch | |
parent | d80209703ec2fc85e0a4b3d4d23e7ed448987aca (diff) | |
download | binutils-4d18591be953e2faeaaa280484d375fe05857770.zip binutils-4d18591be953e2faeaaa280484d375fe05857770.tar.gz binutils-4d18591be953e2faeaaa280484d375fe05857770.tar.bz2 |
Remove argument pc in get_next_pcs
Nowadays, get_next_pcs in linux_target_ops has two parameters PC
and REGCACHE. Parameter PC looks redundant because it can be go
from REGCACHE. The patch is to remove PC from the arguments for
various functions.
gdb:
2016-01-26 Yao Qi <yao.qi@linaro.org>
* arch/arm-get-next-pcs.c (thumb_deal_with_atomic_sequence_raw):
Remove argument pc. Get pc by regcache_read_pc. Callers updated.
(arm_deal_with_atomic_sequence_raw): Likewise.
(thumb_get_next_pcs_raw): Likewise.
(arm_get_next_pcs_raw): Likewise.
(arm_get_next_pcs): Remove argument pc. Callers updated.
* arch/arm-get-next-pcs.h (arm_get_next_pcs): Update declaration.
gdb/gdbserver:
2016-01-26 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (arm_gdbserver_get_next_pcs): Remove argument pc.
* linux-low.c (install_software_single_step_breakpoints): Don't
call regcache_read_pc.
* linux-low.h (struct linux_target_ops) <get_next_pcs>: Remove
argument pc.
Diffstat (limited to 'gdb/arch')
-rw-r--r-- | gdb/arch/arm-get-next-pcs.c | 24 | ||||
-rw-r--r-- | gdb/arch/arm-get-next-pcs.h | 3 |
2 files changed, 14 insertions, 13 deletions
diff --git a/gdb/arch/arm-get-next-pcs.c b/gdb/arch/arm-get-next-pcs.c index 6b8f38a..e840147 100644 --- a/gdb/arch/arm-get-next-pcs.c +++ b/gdb/arch/arm-get-next-pcs.c @@ -46,11 +46,11 @@ arm_get_next_pcs_ctor (struct arm_get_next_pcs *self, added to the next_pcs list. */ static VEC (CORE_ADDR) * -thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self, - CORE_ADDR pc) +thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self) { int byte_order_for_code = self->byte_order_for_code; CORE_ADDR breaks[2] = {-1, -1}; + CORE_ADDR pc = regcache_read_pc (self->regcache); CORE_ADDR loc = pc; unsigned short insn1, insn2; int insn_count; @@ -183,11 +183,11 @@ thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self, added to the next_pcs list. */ static VEC (CORE_ADDR) * -arm_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self, - CORE_ADDR pc) +arm_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self) { int byte_order_for_code = self->byte_order_for_code; CORE_ADDR breaks[2] = {-1, -1}; + CORE_ADDR pc = regcache_read_pc (self->regcache); CORE_ADDR loc = pc; unsigned int insn; int insn_count; @@ -261,10 +261,11 @@ arm_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self, /* Find the next possible PCs for thumb mode. */ static VEC (CORE_ADDR) * -thumb_get_next_pcs_raw (struct arm_get_next_pcs *self, CORE_ADDR pc) +thumb_get_next_pcs_raw (struct arm_get_next_pcs *self) { int byte_order = self->byte_order; int byte_order_for_code = self->byte_order_for_code; + CORE_ADDR pc = regcache_read_pc (self->regcache); unsigned long pc_val = ((unsigned long) pc) + 4; /* PC after prefetch */ unsigned short inst1; CORE_ADDR nextpc = pc + 2; /* Default is next instruction. */ @@ -641,7 +642,7 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self, CORE_ADDR pc) address in GDB and arm_addr_bits_remove in GDBServer. */ static VEC (CORE_ADDR) * -arm_get_next_pcs_raw (struct arm_get_next_pcs *self, CORE_ADDR pc) +arm_get_next_pcs_raw (struct arm_get_next_pcs *self) { int byte_order = self->byte_order; int byte_order_for_code = self->byte_order_for_code; @@ -650,6 +651,7 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self, CORE_ADDR pc) unsigned long status; CORE_ADDR nextpc; struct regcache *regcache = self->regcache; + CORE_ADDR pc = regcache_read_pc (self->regcache); VEC (CORE_ADDR) *next_pcs = NULL; pc_val = (unsigned long) pc; @@ -904,21 +906,21 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self, CORE_ADDR pc) /* See arm-get-next-pcs.h. */ VEC (CORE_ADDR) * -arm_get_next_pcs (struct arm_get_next_pcs *self, CORE_ADDR pc) +arm_get_next_pcs (struct arm_get_next_pcs *self) { VEC (CORE_ADDR) *next_pcs = NULL; if (self->ops->is_thumb (self)) { - next_pcs = thumb_deal_with_atomic_sequence_raw (self, pc); + next_pcs = thumb_deal_with_atomic_sequence_raw (self); if (next_pcs == NULL) - next_pcs = thumb_get_next_pcs_raw (self, pc); + next_pcs = thumb_get_next_pcs_raw (self); } else { - next_pcs = arm_deal_with_atomic_sequence_raw (self, pc); + next_pcs = arm_deal_with_atomic_sequence_raw (self); if (next_pcs == NULL) - next_pcs = arm_get_next_pcs_raw (self, pc); + next_pcs = arm_get_next_pcs_raw (self); } return next_pcs; diff --git a/gdb/arch/arm-get-next-pcs.h b/gdb/arch/arm-get-next-pcs.h index 4a0fc16..7cb0858 100644 --- a/gdb/arch/arm-get-next-pcs.h +++ b/gdb/arch/arm-get-next-pcs.h @@ -57,7 +57,6 @@ void arm_get_next_pcs_ctor (struct arm_get_next_pcs *self, struct regcache *regcache); /* Find the next possible PCs after the current instruction executes. */ -VEC (CORE_ADDR) *arm_get_next_pcs (struct arm_get_next_pcs *self, - CORE_ADDR pc); +VEC (CORE_ADDR) *arm_get_next_pcs (struct arm_get_next_pcs *self); #endif /* ARM_GET_NEXT_PCS_H */ |