This is the mail archive of the gdb-patches@sources.redhat.com 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]

[testsuite] More gdb/1736 kfails


This patch corrects a serious boo-boo in my last patch for this PR - I
got the output out of sync.  It also adds a kfail covering the same
problem in another test, sigstep.exp.

To prevent cascading failures, I needed to return from inside a
gdb_test_multiple action, so I made that work.  The goop comes from
gdb_expect and passes return -code return up to the caller.

Tested (with the entire testsuite) on i686-pc-linux-gnu.  Two FAILs
turned into one KFAIL.  OK?

-- 
Daniel Jacobowitz

2004-08-08  Daniel Jacobowitz  <dan@debian.org>

	PR gdb/1736
	* lib/gdb.exp (gdb_test_multiple): Handle return -code return.
	* gdb.base/sigaltstack.exp (finish_test): Consume output until
	the prompt.
	* gdb.base/sigstep.exp: Add KFAIL for gdb/1736.

Index: testsuite/gdb.base/sigaltstack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/sigaltstack.exp,v
retrieving revision 1.2
diff -u -p -r1.2 sigaltstack.exp
--- testsuite/gdb.base/sigaltstack.exp	8 Aug 2004 23:14:33 -0000	1.2
+++ testsuite/gdb.base/sigaltstack.exp	8 Aug 2004 23:41:57 -0000
@@ -79,8 +79,10 @@ gdb_expect_list "backtrace" ".*$gdb_prom
 }
 
 proc finish_test { pattern msg } {
+    global gdb_prompt
+
     gdb_test_multiple "finish" $msg {
-	-re "Cannot insert breakpoint 0" {
+	-re "Cannot insert breakpoint 0.*${gdb_prompt} $" {
 	    # Some platforms use a special read-only page for signal
 	    # trampolines.  We can't set a breakpoint there, and we
 	    # don't gracefully fall back to single-stepping.
Index: testsuite/gdb.base/sigstep.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/sigstep.exp,v
retrieving revision 1.3
diff -u -p -r1.3 sigstep.exp
--- testsuite/gdb.base/sigstep.exp	11 May 2004 16:57:04 -0000	1.3
+++ testsuite/gdb.base/sigstep.exp	8 Aug 2004 23:41:58 -0000
@@ -112,6 +112,14 @@ proc advancei { i } {
 
     set test "$i into signal trampoline"
     gdb_test_multiple "$i" "${test}" {
+        -re "Cannot insert breakpoint 0.*${gdb_prompt} $" {
+            # Some platforms use a special read-only page for signal
+            # trampolines.  We can't set a breakpoint there, and we
+            # don't gracefully fall back to single-stepping.
+            setup_kfail "i?86-*-linux*" gdb/1736
+            fail "$test (could not set breakpoint)"
+	    return
+        }
 	-re "done = 1;.*${gdb_prompt} $" {
 	    send_gdb "$i\n"
 	    exp_continue
Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.53
diff -u -p -r1.53 gdb.exp
--- testsuite/lib/gdb.exp	8 Aug 2004 16:16:42 -0000	1.53
+++ testsuite/lib/gdb.exp	8 Aug 2004 23:41:58 -0000
@@ -700,7 +700,17 @@ proc gdb_test_multiple { command message
     }
 
     set result 0
-    gdb_expect $tmt $code
+    set code [catch {gdb_expect $tmt $code} string]
+    if {$code == 1} {
+	global errorInfo errorCode;
+	return -code error -errorinfo $errorInfo -errorcode $errorCode $string
+    } elseif {$code == 2} {
+	return -code return $string
+    } elseif {$code == 3} {
+	return
+    } elseif {$code > 4} {
+	return -code $code $string
+    }
     return $result
 }
 


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