From 81e0d4438ec4b4112e28a9e90ba2fc1fb548310b Mon Sep 17 00:00:00 2001 From: Mike Dunn Date: Sun, 12 Sep 2010 12:05:07 -0700 Subject: propagate return status of set_breakpoint() up call chain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi everyone, I figured since I was poking around in the breakpoint code on other arches, I'd add this change to those arches that don't do it already. This patch propagates the return code of _set_breakpoint() up the call stack. This ensures that the higher layer breakpoint infrastructure is aware that an error ocurred, in which case the breakpoint is not recorded. Normally I wouldn't touch code that I can't test, but the code is very uniform across architectures, and the change is rather benign, so I figured after careful inspection that it is safe. If the maintainers or others think this is imprudent, the patch can be dropped. Also changed the error code to something more appropriate in two cases where hardware resources are unavailable. Comments and criticisms of course gratefully received. Mike Signed-off-by: Mike Dunn Signed-off-by: Øyvind Harboe --- src/target/cortex_m3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/target/cortex_m3.c') diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index f87c3e0b..3011b597 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -1221,9 +1221,8 @@ cortex_m3_add_breakpoint(struct target *target, struct breakpoint *breakpoint) if (breakpoint->type == BKPT_HARD) cortex_m3->fp_code_available--; - cortex_m3_set_breakpoint(target, breakpoint); - return ERROR_OK; + return cortex_m3_set_breakpoint(target, breakpoint); } static int -- cgit v1.2.3