From: OpenOCD-Gerrit <ope...@us...> - 2020-03-26 19:31:46
|
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 5ceae0eef4c4cdcb1c54807a93144b2700593d44 (commit) via 9960e805b389b3ff46801b336772ab31d35a31a6 (commit) from d9ffe75e257aa4005dd34603860e45c57b1765b6 (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 5ceae0eef4c4cdcb1c54807a93144b2700593d44 Author: Marc Schink <ope...@ma...> Date: Thu Feb 14 16:12:22 2019 +0100 target: Add possibility to remove all breakpoints Change-Id: I46acd57956846d66bef974e0538452462b197cd0 Signed-off-by: Marc Schink <ope...@ma...> Reviewed-on: http://openocd.zylin.com/4916 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 4665092d1..e60d26939 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -8173,8 +8173,8 @@ in which case it will be a hardware breakpoint. for similar mechanisms that do not consume hardware breakpoints.) @end deffn -@deffn Command {rbp} address -Remove the breakpoint at @var{address}. +@deffn Command {rbp} @option{all} | address +Remove the breakpoint at @var{address} or all breakpoints. @end deffn @deffn Command {rwp} address diff --git a/src/target/target.c b/src/target/target.c index b77400c1f..50dd1488f 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3829,11 +3829,16 @@ COMMAND_HANDLER(handle_rbp_command) if (CMD_ARGC != 1) return ERROR_COMMAND_SYNTAX_ERROR; - target_addr_t addr; - COMMAND_PARSE_ADDRESS(CMD_ARGV[0], addr); - struct target *target = get_current_target(CMD_CTX); - breakpoint_remove(target, addr); + + if (!strcmp(CMD_ARGV[0], "all")) { + breakpoint_remove_all(target); + } else { + target_addr_t addr; + COMMAND_PARSE_ADDRESS(CMD_ARGV[0], addr); + + breakpoint_remove(target, addr); + } return ERROR_OK; } @@ -6318,7 +6323,7 @@ static const struct command_registration target_exec_command_handlers[] = { .handler = handle_rbp_command, .mode = COMMAND_EXEC, .help = "remove breakpoint", - .usage = "address", + .usage = "'all' | address", }, { .name = "wp", commit 9960e805b389b3ff46801b336772ab31d35a31a6 Author: Marc Schink <ope...@ma...> Date: Thu Feb 14 16:11:44 2019 +0100 target: Add function to remove all breakpoints Change-Id: I4718926844a2c8bcfd78d7a8792f6ded293548ef Signed-off-by: Marc Schink <ope...@ma...> Reviewed-on: http://openocd.zylin.com/4915 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index 7ad194256..c060c7cde 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -332,6 +332,18 @@ static int breakpoint_remove_internal(struct target *target, target_addr_t addre return 0; } } + +static void breakpoint_remove_all_internal(struct target *target) +{ + struct breakpoint *breakpoint = target->breakpoints; + + while (breakpoint) { + struct breakpoint *tmp = breakpoint; + breakpoint = breakpoint->next; + breakpoint_free(target, tmp); + } +} + void breakpoint_remove(struct target *target, target_addr_t address) { int found = 0; @@ -350,7 +362,23 @@ void breakpoint_remove(struct target *target, target_addr_t address) breakpoint_remove_internal(target, address); } -void breakpoint_clear_target_internal(struct target *target) +void breakpoint_remove_all(struct target *target) +{ + if (target->smp) { + struct target_list *head; + struct target *curr; + head = target->head; + while (head != (struct target_list *)NULL) { + curr = head->target; + breakpoint_remove_all_internal(curr); + head = head->next; + } + } else { + breakpoint_remove_all_internal(target); + } +} + +static void breakpoint_clear_target_internal(struct target *target) { LOG_DEBUG("Delete all breakpoints for target: %s", target_name(target)); diff --git a/src/target/breakpoints.h b/src/target/breakpoints.h index 51bd05abd..20faf4e6c 100644 --- a/src/target/breakpoints.h +++ b/src/target/breakpoints.h @@ -63,6 +63,7 @@ int context_breakpoint_add(struct target *target, int hybrid_breakpoint_add(struct target *target, target_addr_t address, uint32_t asid, uint32_t length, enum breakpoint_type type); void breakpoint_remove(struct target *target, target_addr_t address); +void breakpoint_remove_all(struct target *target); struct breakpoint *breakpoint_find(struct target *target, target_addr_t address); ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 4 ++-- src/target/breakpoints.c | 30 +++++++++++++++++++++++++++++- src/target/breakpoints.h | 1 + src/target/target.c | 15 ++++++++++----- 4 files changed, 42 insertions(+), 8 deletions(-) hooks/post-receive -- Main OpenOCD repository |