From f941192723f7d71ae4a9a8f011dad5909f156da3 Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Wed, 11 Aug 2010 10:58:49 +0200 Subject: arm: add missing error reporting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when an unknown core mode is read from the target, report error. Can be communication failure. Signed-off-by: Øyvind Harboe --- src/target/armv4_5.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/target/armv4_5.c') 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) -- cgit v1.2.3