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>
This commit is contained in:
Marc Schink 2019-02-14 16:12:22 +01:00 committed by Tomas Vanek
parent 9960e805b3
commit 5ceae0eef4
2 changed files with 12 additions and 7 deletions

View File

@ -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

View File

@ -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",