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 v2] testsuite: Treat an empty string in needs_status_wrapper as false


GDB test suite considers [target_info needs_status_wrapper] to be false if
it unset or have a zero value. The former is achieved by using [target_info
exists needs_status_wrapper]. GCC test suite on the other hand do not use
"exists" but compares to an empty string. This doesn't make difference if
value is unset, as unset value is treated as an empty string, but makes a
difference if value was set to and empty string. In that case if
needs_status_wrapper was set to an empty string, then GCC test suite will
not use status wrapper, but GDB test suite will use it. Dejagnu's own
remote.exp uses a comparison with an empty string. Though for some reason
Dejagnu unlike GCC and GDB test suite doesn't treat a zero as a false.

This patch makes GDB test suite treat an empty string in
needs_status_wrapper the same way as it is done by GCC test suite and
Dejagnu.

gdb/testsuite/ChangeLog:

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

    * lib/gdb.exp (gdb_compile, gdb_wrapper_init): Treat empty string in
    target_info needs_status_wrapper the same way as zero - as a false value.
---
 gdb/testsuite/lib/gdb.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3efd539..1e5c34a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2510,7 +2510,7 @@ proc gdb_wrapper_init { args } {
 
     if { $gdb_wrapper_initialized == 1 } { return; }
 
-    if {[target_info exists needs_status_wrapper] && \
+    if {[target_info needs_status_wrapper] != "" && \
 	    [target_info needs_status_wrapper] != "0"} {
 	set result [build_wrapper "testglue.o"]
 	if { $result != "" } {
@@ -2609,7 +2609,7 @@ proc gdb_compile {source dest type options} {
 
     if { $gdb_wrapper_initialized == 0 } { gdb_wrapper_init }
 
-    if {[target_info exists needs_status_wrapper] && \
+    if {[target_info needs_status_wrapper] != "" && \
 	    [target_info needs_status_wrapper] != "0" && \
 	    [info exists gdb_wrapper_file]} {
 	lappend options "libs=${gdb_wrapper_file}"
-- 
1.8.4.1


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