This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/4] Clear addr bit in next_pcs vector
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 12 May 2016 17:18:31 +0100
- Subject: [PATCH 3/4] Clear addr bit in next_pcs vector
- Authentication-results: sourceware.org; auth=none
- References: <1463069912-23472-1-git-send-email-yao dot qi at linaro dot org>
This patch is to split the loop of calling gdbarch_addr_bits_remove
and insert_single_step_breakpoint into two loops.
gdb:
2016-05-12 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/arm-linux-tdep.c | 5 ++++-
gdb/arm-tdep.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 0e7cad5..4820c7d 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -954,9 +954,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 c027ad5..fca9f52 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -6302,9 +6302,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;
--
1.9.1