|
From: openocd-gerrit <ope...@us...> - 2024-01-13 14:40:34
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 2c10e3e2577604f5ec75b7f688f53fa2b3cbb0e7 (commit)
from 04eda372634f995c732bed4f67855be258ab0e41 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2c10e3e2577604f5ec75b7f688f53fa2b3cbb0e7
Author: Evgeniy Didin <di...@sy...>
Date: Fri Jul 31 00:13:12 2020 +0300
target/arc: restore breakpoints in arc_resume()
Presently, we rely on gdb to restore break/watchpoints upon resuming
execution in arc_resume(). To match this behavior in absence of gdb
(more specifically, when handle_breakpoints is true), this patch
explicitly re-enables all breakpoints and watchpoints in arc_resume().
This has previously been committed to the Zephyr project's openocd repo
(see https://github.com/zephyrproject-rtos/openocd/pull/31).
Change-Id: I59e9c91270ef0b5fd19cfc570663dc67a6022dbd
Signed-off-by: Evgeniy Didin <di...@sy...>
Signed-off-by: Stephanos Ioannidis <ro...@st...>
Signed-off-by: Artemiy Volkov <ar...@sy...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7816
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
Reviewed-by: Oleksij Rempel <li...@re...>
diff --git a/src/target/arc.c b/src/target/arc.c
index 0f7b11025..f3449aada 100644
--- a/src/target/arc.c
+++ b/src/target/arc.c
@@ -50,6 +50,8 @@
static int arc_remove_watchpoint(struct target *target,
struct watchpoint *watchpoint);
+static int arc_enable_watchpoints(struct target *target);
+static int arc_enable_breakpoints(struct target *target);
void arc_reg_data_type_add(struct target *target,
struct arc_reg_data_type *data_type)
@@ -1262,6 +1264,13 @@ static int arc_resume(struct target *target, int current, target_addr_t address,
return ERROR_TARGET_NOT_HALTED;
}
+ if (!debug_execution) {
+ /* (gdb) continue = execute until we hit break/watch-point */
+ target_free_all_working_areas(target);
+ CHECK_RETVAL(arc_enable_breakpoints(target));
+ CHECK_RETVAL(arc_enable_watchpoints(target));
+ }
+
/* current = 1: continue on current PC, otherwise continue at <address> */
if (!current) {
target_buffer_set_u32(target, pc->value, address);
@@ -1658,6 +1667,19 @@ static int arc_unset_breakpoint(struct target *target,
return retval;
}
+static int arc_enable_breakpoints(struct target *target)
+{
+ struct breakpoint *breakpoint = target->breakpoints;
+
+ /* set any pending breakpoints */
+ while (breakpoint) {
+ if (!breakpoint->is_set)
+ CHECK_RETVAL(arc_set_breakpoint(target, breakpoint));
+ breakpoint = breakpoint->next;
+ }
+
+ return ERROR_OK;
+}
static int arc_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
{
@@ -1895,6 +1917,20 @@ static int arc_unset_watchpoint(struct target *target,
return retval;
}
+static int arc_enable_watchpoints(struct target *target)
+{
+ struct watchpoint *watchpoint = target->watchpoints;
+
+ /* set any pending watchpoints */
+ while (watchpoint) {
+ if (!watchpoint->is_set)
+ CHECK_RETVAL(arc_set_watchpoint(target, watchpoint));
+ watchpoint = watchpoint->next;
+ }
+
+ return ERROR_OK;
+}
+
static int arc_add_watchpoint(struct target *target,
struct watchpoint *watchpoint)
{
-----------------------------------------------------------------------
Summary of changes:
src/target/arc.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|