This is the mail archive of the gdb-cvs@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]

[binutils-gdb] gdb_test_multiple: return -1 on internal error


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=28054d694f6794d2866d22073117897e372803f2

commit 28054d694f6794d2866d22073117897e372803f2
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Mar 2 20:05:25 2015 +0000

    gdb_test_multiple: return -1 on internal error
    
    gdb_test_multiple is supposed to return -1 on internal error:
    
      # Returns:
      #    1 if the test failed, according to a built-in failure pattern
      #    0 if only user-supplied patterns matched
      #   -1 if there was an internal error.
    
    But alas, that's broken, it returns success...  It looks like the code
    is assuming an earlier 'set result -1' is still in effect, but
    'result' is set to 0 at the end, just before we call gdb_expect:
    
        set result 0
        set code [catch {gdb_expect $code} string]
    
    gdb/testsuite/
    2015-03-02  Pedro Alves  <palves@redhat.com>
    
    	* lib/gdb.exp (gdb_test_multiple) <internal error>: Set result to
    	-1.

Diff:
---
 gdb/testsuite/ChangeLog   | 5 +++++
 gdb/testsuite/lib/gdb.exp | 1 +
 2 files changed, 6 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 880e674..76ed5e2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-02  Pedro Alves  <palves@redhat.com>
+
+	* lib/gdb.exp (gdb_test_multiple) <internal error>: Set result to
+	-1.
+
 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
 	* gdb.arch/s390-vregs.exp: New test.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 08db806..f274b64 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -808,6 +808,7 @@ proc gdb_test_multiple { command message user_code } {
 	-re ".*A problem internal to GDB has been detected" {
 	    fail "$message (GDB internal error)"
 	    gdb_internal_error_resync
+	    set result -1
 	}
 	-re "\\*\\*\\* DOSEXIT code.*" {
 	    if { $message != "" } {


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