Clear addr bit in next_pcs vector
authorYao Qi <yao.qi@linaro.org>
Tue, 8 Nov 2016 12:58:33 +0000 (12:58 +0000)
committerYao Qi <yao.qi@linaro.org>
Tue, 8 Nov 2016 12:58:33 +0000 (12:58 +0000)
This patch is to split the loop of calling gdbarch_addr_bits_remove
and insert_single_step_breakpoint into two loops.

gdb:

2016-11-08  Yao Qi  <yao.qi@linaro.org>

* arm-linux-tdep.c (arm_linux_software_single_step): Write
adjusted address back to vector.  Call insert_single_step_breakpoint
in a new loop.
* arm-tdep.c (arm_software_single_step): Likewise.

gdb/ChangeLog
gdb/arm-linux-tdep.c
gdb/arm-tdep.c

index 163e1a9301960edcc4b1be6d3b6723f65b076272..3e6bd4c615f3bb14ba1e2222ad94b1d72473cdaa 100644 (file)
@@ -1,3 +1,10 @@
+2016-11-08  Yao Qi  <yao.qi@linaro.org>
+
+       * arm-linux-tdep.c (arm_linux_software_single_step): Write
+       adjusted address back to vector.  Call insert_single_step_breakpoint
+       in a new loop.
+       * arm-tdep.c (arm_software_single_step): Likewise.
+
 2016-11-08  Yao Qi  <yao.qi@linaro.org>
 
        * arm-linux-tdep.c (arm_linux_software_single_step): Don't
index bc921771ac67fc211f75cbae952e2229c5e2f221..4a734b0be091de0dc8e9abb8a69999313b06277c 100644 (file)
@@ -952,9 +952,12 @@ arm_linux_software_single_step (struct frame_info *frame)
   for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++)
     {
       pc = gdbarch_addr_bits_remove (gdbarch, pc);
-      insert_single_step_breakpoint (gdbarch, aspace, pc);
+      VEC_replace (CORE_ADDR, next_pcs, i, pc);
     }
 
+  for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++)
+    insert_single_step_breakpoint (gdbarch, aspace, pc);
+
   do_cleanups (old_chain);
 
   return 1;
index a3bea97b34e98c2d13fdbf556875a0a0afc7f73c..9340b3b9ed9df33bf1f84831c57cdcc5b3c7767f 100644 (file)
@@ -6310,9 +6310,12 @@ arm_software_single_step (struct frame_info *frame)
   for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++)
     {
       pc = gdbarch_addr_bits_remove (gdbarch, pc);
-      insert_single_step_breakpoint (gdbarch, aspace, pc);
+      VEC_replace (CORE_ADDR, next_pcs, i, pc);
     }
 
+  for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); i++)
+    insert_single_step_breakpoint (gdbarch, aspace, pc);
+
   do_cleanups (old_chain);
 
   return 1;
This page took 0.034089 seconds and 4 git commands to generate.