From: Evan Hunter Date: Fri, 2 Nov 2012 06:59:03 +0000 (+1100) Subject: cortex_a: Fix target entry state route. X-Git-Tag: v0.7.0-rc1~143 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=539a9cf20831c96588c0db62b871f7438067b509;p=openocd cortex_a: Fix target entry state route. If target is disabled at init, then is examined using 'arp_examine', it can get to cortex_a8_poll with the target state being unknown. Change-Id: Ifffb345bf971d275d2eb1912648b29f0a75f6ccc Signed-off-by: Evan Hunter Reviewed-on: http://openocd.zylin.com/954 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index e1c4c9c3..ee1559dd 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -812,6 +812,7 @@ static int cortex_a8_poll(struct target *target) LOG_DEBUG("Target halted"); target->state = TARGET_HALTED; if ((prev_target_state == TARGET_RUNNING) + || (prev_target_state == TARGET_UNKNOWN) || (prev_target_state == TARGET_RESET)) { retval = cortex_a8_debug_entry(target); if (retval != ERROR_OK)