target: print reason why GDB halts
authorØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 21 Jan 2010 09:16:42 +0000 (10:16 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 21 Jan 2010 15:20:58 +0000 (16:20 +0100)
If GDB halts unexpectedly, print reason: srst assert or power
out detected.

If polling fails, then things are a bit trickier. We do not
want to spam telnet or the log with polling failed messages.
Leave that case be w/a comment in a code for now.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/target/target.c

index ff5aef34c9bd0dd6fd31427284eb5abdb4a9161c..1eb65a62e0f40f3938062a03b2957e0be955f4da 100644 (file)
@@ -1767,6 +1767,7 @@ static int handle_target(void *priv)
                int did_something = 0;
                if (runSrstAsserted)
                {
+                       LOG_INFO("Waking up GDB, srst asserted detected.");
                        target_call_event_callbacks_all(TARGET_EVENT_GDB_HALT);
                        Jim_Eval(interp, "srst_asserted");
                        did_something = 1;
@@ -1778,6 +1779,7 @@ static int handle_target(void *priv)
                }
                if (runPowerDropout)
                {
+                       LOG_INFO("Waking up GDB, power dropout detected.");
                        target_call_event_callbacks_all(TARGET_EVENT_GDB_HALT);
                        Jim_Eval(interp, "power_dropout");
                        did_something = 1;
@@ -1820,6 +1822,14 @@ static int handle_target(void *priv)
                        /* polling may fail silently until the target has been examined */
                        if ((retval = target_poll(target)) != ERROR_OK)
                        {
+                               /* FIX!!!!! If we add a LOG_INFO() here to output a line in GDB
+                                * *why* we are aborting GDB, then we'll spam telnet when the
+                                * poll is failing persistently.
+                                *
+                                * If we could implement an event that detected the
+                                * target going from non-pollable to pollable, we could issue
+                                * an error only upon the transition.
+                                */
                                target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);
                                return retval;
                        }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)