summaryrefslogtreecommitdiff
path: root/src/target/armv4_5.c
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-08-11 10:58:49 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-08-11 10:58:49 +0200
commitf941192723f7d71ae4a9a8f011dad5909f156da3 (patch)
tree7e0b779613edac188d90b69ce5afc33053a5739b /src/target/armv4_5.c
parentba951aede3aa98591087428955dad51279e6a5ea (diff)
downloadopenocd+libswd-f941192723f7d71ae4a9a8f011dad5909f156da3.tar.gz
openocd+libswd-f941192723f7d71ae4a9a8f011dad5909f156da3.tar.bz2
openocd+libswd-f941192723f7d71ae4a9a8f011dad5909f156da3.tar.xz
openocd+libswd-f941192723f7d71ae4a9a8f011dad5909f156da3.zip
arm: add missing error reporting
when an unknown core mode is read from the target, report error. Can be communication failure. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target/armv4_5.c')
-rw-r--r--src/target/armv4_5.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c
index d950af36..07c8c6eb 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -634,7 +634,10 @@ COMMAND_HANDLER(handle_armv4_5_reg_command)
}
if (!is_arm_mode(armv4_5->core_mode))
+ {
+ LOG_ERROR("not a valid arm core mode - communication failure?");
return ERROR_FAIL;
+ }
if (!armv4_5->full_context) {
command_print(CMD_CTX, "error: target doesn't support %s",
@@ -1046,7 +1049,10 @@ int arm_get_gdb_reg_list(struct target *target,
int i;
if (!is_arm_mode(armv4_5->core_mode))
+ {
+ LOG_ERROR("not a valid arm core mode - communication failure?");
return ERROR_FAIL;
+ }
*reg_list_size = 26;
*reg_list = malloc(sizeof(struct reg*) * (*reg_list_size));
@@ -1127,7 +1133,10 @@ int armv4_5_run_algorithm_inner(struct target *target,
}
if (!is_arm_mode(armv4_5->core_mode))
+ {
+ LOG_ERROR("not a valid arm core mode - communication failure?");
return ERROR_FAIL;
+ }
/* armv5 and later can terminate with BKPT instruction; less overhead */
if (!exit_point && armv4_5->is_armv4)