summaryrefslogtreecommitdiff
path: root/src/target/mips_m4k.c
diff options
context:
space:
mode:
authorMike Dunn <mikedunn@newsguy.com>2010-09-12 12:05:07 -0700
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-09-13 19:45:42 +0200
commit81e0d4438ec4b4112e28a9e90ba2fc1fb548310b (patch)
treecc2493e7ee844649b7433cb384acec1cc13b8bcd /src/target/mips_m4k.c
parent8afd2309a4e18b222da189eb51f46339f17201d5 (diff)
downloadopenocd+libswd-81e0d4438ec4b4112e28a9e90ba2fc1fb548310b.tar.gz
openocd+libswd-81e0d4438ec4b4112e28a9e90ba2fc1fb548310b.tar.bz2
openocd+libswd-81e0d4438ec4b4112e28a9e90ba2fc1fb548310b.tar.xz
openocd+libswd-81e0d4438ec4b4112e28a9e90ba2fc1fb548310b.zip
propagate return status of set_breakpoint() up call chain
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 <arch>_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 <mikedunn@newsguy.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target/mips_m4k.c')
-rw-r--r--src/target/mips_m4k.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 21ff0ba9..62c484a9 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -497,7 +497,7 @@ static int mips_m4k_set_breakpoint(struct target *target,
{
LOG_ERROR("Can not find free FP Comparator(bpid: %d)",
breakpoint->unique_id );
- return ERROR_FAIL;
+ return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
}
breakpoint->set = bp_num + 1;
comparator_list[bp_num].used = 1;
@@ -662,9 +662,7 @@ static int mips_m4k_add_breakpoint(struct target *target, struct breakpoint *bre
mips32->num_inst_bpoints_avail--;
}
- mips_m4k_set_breakpoint(target, breakpoint);
-
- return ERROR_OK;
+ return mips_m4k_set_breakpoint(target, breakpoint);
}
static int mips_m4k_remove_breakpoint(struct target *target,