Print reason why GDB halts.

1. srst detected:

(gdb) c
Continuing.
Waking up GDB, srst asserted detected.

[Thread <main>] #1 stopped.
0xda42bf3c in ?? ()


2. failed to poll:

(gdb) c
Continuing.
Failed to poll target, halting GDB.

[Thread <main>] #1 stopped.
0x00000004 in ?? ()


-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
From a94c83745559446eabdbb14cfe18fb23201b280f Mon Sep 17 00:00:00 2001
From: =?utf-8?q?=C3=98yvind=20Harboe?= <[email protected]>
Date: Thu, 21 Jan 2010 10:16:42 +0100
Subject: [PATCH] target: print reason why GDB halts
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

If GDB halts unexpectedly, print reason: failed to poll,
srst assert or power out detected.

Signed-off-by: Øyvind Harboe <[email protected]>
---
 src/target/target.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/target/target.c b/src/target/target.c
index c56265c..1d8fdcc 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -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,7 @@ static int handle_target(void *priv)
 			/* polling may fail silently until the target has been examined */
 			if ((retval = target_poll(target)) != ERROR_OK)
 			{
+				LOG_INFO("Failed to poll target, halting GDB.");
 				target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);
 				return retval;
 			}
-- 
1.6.3.3

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to