target: Change policy of removing watchpoints/breakpoints.
Now internal watch/breakpoint will not be removed in case of error during removing triggers from hardware. Also change signature of some functions (for deletion bp/wp) to print message in case of some error. Change-Id: I71cd1f556a33975005d0ee372fc384fddfddc3bf Signed-off-by: Kirill Radkin <kirill.radkin@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7738 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
This commit is contained in:
committed by
Antonio Borneo
parent
18281b0c49
commit
022e438292
@@ -4034,21 +4034,31 @@ COMMAND_HANDLER(handle_bp_command)
|
||||
|
||||
COMMAND_HANDLER(handle_rbp_command)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (CMD_ARGC != 1)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
struct target *target = get_current_target(CMD_CTX);
|
||||
|
||||
if (!strcmp(CMD_ARGV[0], "all")) {
|
||||
breakpoint_remove_all(target);
|
||||
retval = breakpoint_remove_all(target);
|
||||
|
||||
if (retval != ERROR_OK) {
|
||||
command_print(CMD, "Error encountered during removal of all breakpoints.");
|
||||
command_print(CMD, "Some breakpoints may have remained set.");
|
||||
}
|
||||
} else {
|
||||
target_addr_t addr;
|
||||
COMMAND_PARSE_ADDRESS(CMD_ARGV[0], addr);
|
||||
|
||||
breakpoint_remove(target, addr);
|
||||
retval = breakpoint_remove(target, addr);
|
||||
|
||||
if (retval != ERROR_OK)
|
||||
command_print(CMD, "Error during removal of breakpoint at address " TARGET_ADDR_FMT, addr);
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
return retval;
|
||||
}
|
||||
|
||||
COMMAND_HANDLER(handle_wp_command)
|
||||
@@ -4133,9 +4143,12 @@ COMMAND_HANDLER(handle_rwp_command)
|
||||
COMMAND_PARSE_ADDRESS(CMD_ARGV[0], addr);
|
||||
|
||||
struct target *target = get_current_target(CMD_CTX);
|
||||
watchpoint_remove(target, addr);
|
||||
int retval = watchpoint_remove(target, addr);
|
||||
|
||||
return ERROR_OK;
|
||||
if (retval != ERROR_OK)
|
||||
command_print(CMD, "Error during removal of watchpoint at address " TARGET_ADDR_FMT, addr);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user