]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change gdbarch software_single_step frame_info to regcache
authorYao Qi <yao.qi@linaro.org>
Tue, 22 Nov 2016 14:05:06 +0000 (14:05 +0000)
committerYao Qi <yao.qi@linaro.org>
Tue, 22 Nov 2016 14:30:50 +0000 (14:30 +0000)
This patch changes gdbarch method software_single_step's parameter from
"struct frame_info *" to "struct regcache *, IOW, software_single_step
starts to use current regcache rather than current frame for software
single.

gdb:

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.

23 files changed:
gdb/ChangeLog
gdb/aarch64-tdep.c
gdb/alpha-tdep.c
gdb/alpha-tdep.h
gdb/arm-linux-tdep.c
gdb/arm-tdep.c
gdb/arm-tdep.h
gdb/breakpoint.c
gdb/cris-tdep.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/mips-tdep.c
gdb/mips-tdep.h
gdb/moxie-tdep.c
gdb/nios2-tdep.c
gdb/ppc-tdep.h
gdb/rs6000-aix-tdep.c
gdb/rs6000-tdep.c
gdb/s390-linux-tdep.c
gdb/sparc-tdep.c
gdb/spu-tdep.c
gdb/tic6x-tdep.c

index d28552b16d5368a7830224e3e15c6598520c5a31..9749031c853bf0ec3bc2400f7b8b700624e640ae 100644 (file)
@@ -1,3 +1,32 @@
+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
index 62ee3c5979f8e48ac6ca3785e90a340b5c9f0bdb..6b95d7c8654521bb58d3af32d898b23380320915 100644 (file)
@@ -2225,9 +2225,8 @@ value_of_aarch64_user_reg (struct frame_info *frame, const void *baton)
    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;
index 9753c1b078c55c26330229ee80eea9adf5ba56d8..4442d22824ce26b41b5ef892c6f42f639824aea8 100644 (file)
@@ -766,9 +766,8 @@ static const int stq_c_opcode = 0x2f;
    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};
@@ -1719,9 +1718,8 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
 }
 
 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;
index 5b648611e25445331f407dee6b0292bed72fd706..c0f36b9c78ddb396711f2d565c1f706737323691 100644 (file)
@@ -103,7 +103,7 @@ struct gdbarch_tdep
 };
 
 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 *);
index c621cd624b30c85a335d4be8b5ab851f2e1acade..a30a235a4d7019f4431b94879dc1b49284fe128a 100644 (file)
@@ -922,9 +922,8 @@ arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self)
 /* 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;
index 78fc2643bd40037624116814dab4091e7cf3a804..0b93df7ec9bbb4c6d69b74947c7e9468885ba553 100644 (file)
@@ -6287,9 +6287,8 @@ arm_get_next_pcs_is_thumb (struct arm_get_next_pcs *self)
    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;
index 10ab742edeefcc493786b347e9fa0aca5db11066..6af44a9f9b66d7d2ee6e4783303792be49034feb 100644 (file)
@@ -259,7 +259,7 @@ CORE_ADDR arm_get_next_pcs_addr_bits_remove (struct arm_get_next_pcs *self,
 
 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);
 
index d139747200e5be858a1529dab9421a603815579b..67b610cb37475dacb43f37461cdc0c2d4e56952e 100644 (file)
@@ -15193,15 +15193,16 @@ insert_single_step_breakpoint (struct gdbarch *gdbarch,
 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++)
index 6b060ea3708b499674667ce473465f504ca0c101..084ff49b79928f85ef69c1194b27f8c2d1e8c132 100644 (file)
@@ -2061,9 +2061,8 @@ find_step_target (struct regcache *regcache, inst_env_type *inst_env)
    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;
index 07b3ce57920923781cf205d50c1f53cfb964a325..20bcfd794b2bbe59fddf0450e89f20b3770d1250 100644 (file)
@@ -3164,13 +3164,13 @@ gdbarch_software_single_step_p (struct gdbarch *gdbarch)
 }
 
 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
index cc959144986cddfa597b708c2f8ab00737d6388e..3f3c002a5a53f7c24109902a8b5b35e631bda741 100644 (file)
@@ -688,8 +688,8 @@ extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_
 
 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
index 28a34781daac37c14c78ecee1d5db99a01ef0b82..ba57008300d2e463f67bab6561f76908f0933dfb 100755 (executable)
@@ -634,7 +634,7 @@ m:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr::core_addr_identity::0
 # 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.
index ba0d71dfce9aa2b6777f456659fbbd130854bf9b..cb4465ba20ee37411589dc5760d50e76968b3a73 100644 (file)
@@ -4149,9 +4149,8 @@ deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc)
    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;
index 8a870aae01b78e2618bbfde1952a2e046f45cbcf..3b24394d14dcbf0e6ee0107c024fd26a8b6e28a1 100644 (file)
@@ -154,7 +154,7 @@ enum
 };
 
 /* 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);
index 90a6165ecc519fdebc3df6375df83251243b1ab8..abf286892e3131bb54191a05fd1c56c00f7b45dc 100644 (file)
@@ -300,9 +300,8 @@ moxie_process_readu (CORE_ADDR addr, gdb_byte *buf,
 /* 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];
index f03c2df2fb30a9423e634704e91b5bc5f09f6321..8b78968f1f3338a2b33e2e61f7fb8e2982704e39 100644 (file)
@@ -2220,9 +2220,8 @@ nios2_get_next_pc (struct regcache *regcache, CORE_ADDR pc)
 /* 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;
index 0249456a564a6b360f8555cd9f32d6072c789e21..6f1fe89599034b1552ba8735bdaaae7fb5815b54 100644 (file)
@@ -76,7 +76,7 @@ int ppc_altivec_support_p (struct gdbarch *gdbarch);
 /* 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.  */
index 80038a109520666e42f0ccd02dc2de3af8ebf78f..2b90cb138bf35fe2aa60f562a73515a53d14ec4a 100644 (file)
@@ -674,9 +674,8 @@ branch_dest (struct regcache *regcache, int opcode, int instr,
 /* 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;
@@ -689,7 +688,7 @@ rs6000_software_single_step (struct frame_info *frame)
 
   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;
   
index 629d4c24e454e2c02ee60b40d3bbc39f70c18f3c..1c26e1edaf8699ce1a8a786e77f5e0ced2d7bcb2 100644 (file)
@@ -1144,9 +1144,8 @@ ppc_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
    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);
index dc5c674bc2dab8abdfb22206711d8e19b842ba49..aabbbc249ceab917601db8d5a84abe23983bec54 100644 (file)
@@ -723,9 +723,8 @@ s390_is_partial_instruction (struct gdbarch *gdbarch, CORE_ADDR loc, int *len)
    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);
index 18b627d3af7e822fb827160c37a08ce84e77f2bf..7532bc2051c2a06d9ec8673f1de619427fe5ee05 100644 (file)
@@ -1603,9 +1603,8 @@ sparc_step_trap (struct frame_info *frame, unsigned long insn)
 }
 
 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;
index d16b68f6274ae8255e8cb6a516d282a813511859..a7c2bf02daa6760970ba52c3649946266b2e623f 100644 (file)
@@ -1611,9 +1611,8 @@ spu_memory_remove_breakpoint (struct gdbarch *gdbarch,
 /* 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;
index 145534a2671796e28bc0cd92ce912068aab738b5..de6bc6aa0a529b5704ddf2298e427cdc7d42e29f 100644 (file)
@@ -700,9 +700,8 @@ tic6x_get_next_pc (struct regcache *regcache, CORE_ADDR 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;