diff options
author | Mike Dunn <mikedunn@newsguy.com> | 2010-09-19 14:35:46 -0700 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-09-20 09:21:12 +0200 |
commit | 7e888741d13e66b6b343b8f0839621107c5a2962 (patch) | |
tree | 55d5080c102cf9815f1c3610a1730340d41c8f83 /src | |
parent | 60501bb0fb0cb69f66ebb3ce3b64b69f3cadf4ff (diff) | |
download | openocd+libswd-7e888741d13e66b6b343b8f0839621107c5a2962.tar.gz openocd+libswd-7e888741d13e66b6b343b8f0839621107c5a2962.tar.bz2 openocd+libswd-7e888741d13e66b6b343b8f0839621107c5a2962.tar.xz openocd+libswd-7e888741d13e66b6b343b8f0839621107c5a2962.zip |
xscale: bp/wp: additional LOG_ERROR on failure
Hi everyone,
Added more LOG_ERROR messsages to watchpoint and breakpoint code, given that the
infrastructure no longer interprets returned error codes. Also changed
existing LOG_INFO and LOG_WARNING to LOG_ERROR for cases where an error is
returned.
Note that the check of the target state is superflous, since the infrastruture
code currently checks this before calling target code. Is this being
reconsidered as well? Also, should we stop returning anything other than
ERROR_OK and ERROR_FAIL?
Comments gratefully received.
Thanks,
Mike
Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/xscale.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/target/xscale.c b/src/target/xscale.c index 82b0f342..77f0f1b8 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -2193,13 +2193,13 @@ static int xscale_add_breakpoint(struct target *target, if ((breakpoint->type == BKPT_HARD) && (xscale->ibcr_available < 1)) { - LOG_INFO("no breakpoint unit available for hardware breakpoint"); + LOG_ERROR("no breakpoint unit available for hardware breakpoint"); return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; } if ((breakpoint->length != 2) && (breakpoint->length != 4)) { - LOG_INFO("only breakpoints of two (Thumb) or four (ARM) bytes length supported"); + LOG_ERROR("only breakpoints of two (Thumb) or four (ARM) bytes length supported"); return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; } @@ -2277,7 +2277,7 @@ static int xscale_remove_breakpoint(struct target *target, struct breakpoint *br if (target->state != TARGET_HALTED) { - LOG_WARNING("target not halted"); + LOG_ERROR("target not halted"); return ERROR_TARGET_NOT_HALTED; } @@ -2302,7 +2302,7 @@ static int xscale_set_watchpoint(struct target *target, if (target->state != TARGET_HALTED) { - LOG_WARNING("target not halted"); + LOG_ERROR("target not halted"); return ERROR_TARGET_NOT_HALTED; } @@ -2371,7 +2371,8 @@ static int xscale_add_watchpoint(struct target *target, if (xscale->dbr_available < 1) { - return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; + LOG_ERROR("no more watchpoint registers available"); + return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; } if (watchpoint->value) @@ -2395,7 +2396,10 @@ static int xscale_add_watchpoint(struct target *target, /* watchpoints across multiple words require both DBR registers */ if (xscale->dbr_available < 2) + { + LOG_ERROR("insufficient watchpoint registers available"); return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; + } xscale->dbr_available = 0; return ERROR_OK; @@ -2450,7 +2454,7 @@ static int xscale_remove_watchpoint(struct target *target, struct watchpoint *wa if (target->state != TARGET_HALTED) { - LOG_WARNING("target not halted"); + LOG_ERROR("target not halted"); return ERROR_TARGET_NOT_HALTED; } |