This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] [gdb/15992] testsuite: Fix check for reboot_target return value


In config/monitor.exp there are conditions like this:

if { ![reboot_target] }

However reboot_target returns an empty string on success and operation ! is not
allowed an empty string, TCL doesn't treat it implicitly as a "false". So
![reboot_target] should be replaced with [reboot_target] == "".

gdb/testsuite/Changelog:

2013-10-21  Anton Kolesov <Anton.Kolesov@synopsys.com>

	PR gdb/15992
	* config/monitor.gdb (gdb_target_monitor, gdb_load): Correct checks for
	return value of reboot_target: it is an empty string on success, otherwise
	it is fail.
---
 gdb/testsuite/config/monitor.exp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp
index c8b1676..6b0a153 100644
--- a/gdb/testsuite/config/monitor.exp
+++ b/gdb/testsuite/config/monitor.exp
@@ -112,7 +112,7 @@ proc gdb_target_monitor { exec_file } {
 
 	gdb_target_exec
 
-	if { $j == 1 && ![reboot_target] } {
+	if { $j == 1 && [reboot_target] == "" } {
 	    break
 	}
     }
@@ -261,10 +261,8 @@ proc gdb_load { arg } {
 	# Make sure we don't have an open connection to the target.
 	gdb_target_exec
 
-	if { $j == 1 } {
-	    if { ![reboot_target] } {
-		break
-	    }
+	if { $j == 1 && [reboot_target] == "" } {
+	    break
 	}
     }
     perror "Couldn't load file into GDB."
-- 
1.8.4.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]