From: Paul Fertser Date: Fri, 23 May 2014 11:17:31 +0000 (+0400) Subject: target: reexamine after polling succeeds again X-Git-Tag: v0.9.0-rc1~397 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd74dd28911353674e599744c1acce8bf3a6a7a7;p=openocd target: reexamine after polling succeeds again If polling was failing, it likely meant that either the target was disconnected or rebooted. In the latter case it needs to be reexamined to be properly configured for the debug session, so do it just in case. Reported-by: Tim Sander Tested-by: Tim Sander Change-Id: I5b067c18d9276d4e86cc59739f196ae7d0931622 Signed-off-by: Paul Fertser Reviewed-on: http://openocd.zylin.com/2151 Tested-by: jenkins Reviewed-by: Tim Sander Reviewed-by: Spencer Oliver --- diff --git a/src/target/target.c b/src/target/target.c index 9416b25b..4d277c69 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2418,8 +2418,12 @@ static int handle_target(void *priv) return retval; } /* Since we succeeded, we reset backoff count */ - if (target->backoff.times > 0) - LOG_USER("Polling target %s succeeded again", target_name(target)); + if (target->backoff.times > 0) { + LOG_USER("Polling target %s succeeded again, trying to reexamine", target_name(target)); + target_reset_examined(target); + target_examine_one(target); + } + target->backoff.times = 0; } }