diff options
author | Marc Schink <openocd-dev@marcschink.de> | 2019-02-14 16:12:22 +0100 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2020-03-26 19:30:45 +0000 |
commit | 5ceae0eef4c4cdcb1c54807a93144b2700593d44 (patch) | |
tree | 25939ee715b5795273d6a2be4922406f0e731731 | |
parent | 9960e805b389b3ff46801b336772ab31d35a31a6 (diff) | |
download | riscv-openocd-5ceae0eef4c4cdcb1c54807a93144b2700593d44.zip riscv-openocd-5ceae0eef4c4cdcb1c54807a93144b2700593d44.tar.gz riscv-openocd-5ceae0eef4c4cdcb1c54807a93144b2700593d44.tar.bz2 |
target: Add possibility to remove all breakpoints
Change-Id: I46acd57956846d66bef974e0538452462b197cd0
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4916
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
-rw-r--r-- | doc/openocd.texi | 4 | ||||
-rw-r--r-- | src/target/target.c | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi index 4665092..e60d269 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 b77400c..50dd148 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", |