From 04f6ecf27956b4fbd0e660dbdd5b5dd9ccab03d9 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 9 Aug 2004 13:16:16 +0000 Subject: [PATCH] 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. --- gdb/testsuite/ChangeLog | 8 ++++++++ gdb/testsuite/gdb.base/sigaltstack.exp | 4 +++- gdb/testsuite/gdb.base/sigstep.exp | 8 ++++++++ gdb/testsuite/lib/gdb.exp | 12 +++++++++++- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 014ed6f76b4..ecb008e966f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2004-08-08 Daniel Jacobowitz + + 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. + 2004-08-08 Daniel Jacobowitz * gdb.cp/templates.exp: Handle (char)115 for template argument 's'. diff --git a/gdb/testsuite/gdb.base/sigaltstack.exp b/gdb/testsuite/gdb.base/sigaltstack.exp index 3b32d08d750..0e5eb090e1e 100644 --- a/gdb/testsuite/gdb.base/sigaltstack.exp +++ b/gdb/testsuite/gdb.base/sigaltstack.exp @@ -79,8 +79,10 @@ gdb_expect_list "backtrace" ".*$gdb_prompt $" { } 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. diff --git a/gdb/testsuite/gdb.base/sigstep.exp b/gdb/testsuite/gdb.base/sigstep.exp index ea16ec680cd..0e0c2d8fe28 100644 --- a/gdb/testsuite/gdb.base/sigstep.exp +++ b/gdb/testsuite/gdb.base/sigstep.exp @@ -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 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index b71af8d41a3..22893ddeec9 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -700,7 +700,17 @@ proc gdb_test_multiple { command message user_code } { } 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 } -- 2.30.2