From: Yao Qi Date: Tue, 8 Nov 2016 12:58:33 +0000 (+0000) Subject: Clear addr bit in next_pcs vector X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0bc5d801ec836cd4b7d1ab7d05658e7a1d05df22;p=binutils-gdb.git Clear addr bit in next_pcs vector 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 * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 163e1a93019..3e6bd4c615f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2016-11-08 Yao Qi + + * 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 * arm-linux-tdep.c (arm_linux_software_single_step): Don't diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index bc921771ac6..4a734b0be09 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -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; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index a3bea97b34e..9340b3b9ed9 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -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;