From: mlu Date: Thu, 9 Aug 2007 09:35:10 +0000 (+0000) Subject: - trying to remove a breakpoint with target running should not exit(-1) from OpenOCD X-Git-Tag: v0.1.0~1090 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=835e6440b8d1d26b4e041be7edab200ab2c572ee;p=openocd - 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 --- diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index ac8d7dfd..cc38d029 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);