[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openocd-development
Subject:    [OpenOCD-devel] [PATCH]: 97219f1 target: fix display halt message logic
From:       gerrit () openocd ! org (gerrit)
Date:       2018-03-22 10:59:57
Message-ID: 20180322105957.11DFF2522922 () mail ! openocd ! org
[Download RAW message or body]

This is an automated email from Gerrit.

Tomas Vanek (vanekt@fbl.cz) just uploaded a new patch set to Gerrit, which you can \
find at http://openocd.zylin.com/4475

-- gerrit

commit 97219f1db23be96bb68818e599e7f2c68320c27a
Author: Tomas Vanek <vanekt@fbl.cz>
Date:   Thu Mar 22 11:53:40 2018 +0100

    target: fix display halt message logic
    
    If a target is run from gdb and then stopped from OpenOCD telnet interface,
    halt does not show message with status and PC registers.
    
    While on it rename 'display' to 'verbose_halt_msg' and use bool type
    instead of int.
    
    Change-Id: Ibe6589015b302e0be97258b06938c297745436a5
    Signed-off-by: Tomas Vanek <vanekt@fbl.cz>

diff --git a/src/openocd.c b/src/openocd.c
index 98dd9da..3ed101f 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -85,13 +85,13 @@ static int log_target_callback_event_handler(struct target \
*target,  {
 	switch (event) {
 		case TARGET_EVENT_GDB_START:
-			target->display = 0;
+			target->verbose_halt_msg = false;
 			break;
 		case TARGET_EVENT_GDB_END:
-			target->display = 1;
+			target->verbose_halt_msg = true;
 			break;
 		case TARGET_EVENT_HALTED:
-			if (target->display) {
+			if (target->verbose_halt_msg) {
 				/* do not display information when debugger caused the halt */
 				target_arch_state(target);
 			}
diff --git a/src/target/target.c b/src/target/target.c
index debd183..f67e354 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -2960,6 +2960,9 @@ COMMAND_HANDLER(handle_halt_command)
 	LOG_DEBUG("-");
 
 	struct target *target = get_current_target(CMD_CTX);
+
+	target->verbose_halt_msg = true;
+
 	int retval = target_halt(target);
 	if (ERROR_OK != retval)
 		return retval;
@@ -5589,7 +5592,7 @@ static int target_create(Jim_GetOptInfo *goi)
 	target->next                = NULL;
 	target->arch_info           = NULL;
 
-	target->display             = 1;
+	target->verbose_halt_msg	= true;
 
 	target->halt_issued			= false;
 
diff --git a/src/target/target.h b/src/target/target.h
index 6020400..284de14 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -176,7 +176,7 @@ struct target {
 	void *private_config;				/* pointer to target specific config data (for \
jim_configure hook) */  struct target *next;				/* next target in list */
 
-	int display;						/* display async info in telnet session. Do not display
+	bool verbose_halt_msg;				/* display async info in telnet session. Do not display
 										 * lots of halted/resumed info when stepping in debugger. */
 	bool halt_issued;					/* did we transition to halted state? */
 	int64_t halt_issued_time;			/* Note time when halt was issued */

-- 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic