aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authormlu <mlu@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-08-09 09:35:10 +0000
committermlu <mlu@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-08-09 09:35:10 +0000
commit835e6440b8d1d26b4e041be7edab200ab2c572ee (patch)
tree3c9f91d0a206f51c10811513ee36656071592003 /src/target
parent9061c08aa7c8a6fb26fb798ef8a7671d5bc1c36d (diff)
downloadriscv-openocd-835e6440b8d1d26b4e041be7edab200ab2c572ee.zip
riscv-openocd-835e6440b8d1d26b4e041be7edab200ab2c572ee.tar.gz
riscv-openocd-835e6440b8d1d26b4e041be7edab200ab2c572ee.tar.bz2
- trying to remove a breakpoint with target running should not exit(-1) from OpenOCD
git-svn-id: svn://svn.berlios.de/openocd/trunk@189 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target')
-rw-r--r--src/target/breakpoints.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c
index ac8d7df..cc38d02 100644
--- a/src/target/breakpoints.c
+++ b/src/target/breakpoints.c
@@ -224,8 +224,17 @@ int watchpoint_remove(target_t *target, u32 address)
{
if ((retval = target->type->remove_watchpoint(target, watchpoint)) != ERROR_OK)
{
- ERROR("BUG: can't remove watchpoint");
- exit(-1);
+ switch (retval)
+ {
+ case ERROR_TARGET_NOT_HALTED:
+ INFO("can't remove watchpoint while target is running");
+ return retval;
+ break;
+ default:
+ ERROR("unknown error");
+ exit(-1);
+ break;
+ }
}
(*watchpoint_p) = watchpoint->next;
free(watchpoint);