From a6d380b99705431024c351af39704ac50aea4f3e Mon Sep 17 00:00:00 2001 From: Bob Manson Date: Mon, 30 Jun 1997 04:24:17 +0000 Subject: [PATCH] * gdb.base/overlays.exp: Preliminary fixes; temporarily disabled until it has been modified to work with the new testsuite. * gdb.*/*.exp: Instead of causing 1 unresolved test when the testcase won't compile, cause all of the testcases in the file to fail instead. * lib/gdb.exp(gdb_suppress_entire_file): New procedure. (gdb_clear_suppressed): New procedure. (gdb_stop_suppressing_tests): Only clear suppress_flag if it contains a positive value. --- gdb/testsuite/ChangeLog | 14 ++++++++++++++ gdb/testsuite/gdb.disasm/mn10200.exp | 3 +-- gdb/testsuite/gdb.stabs/weird.exp | 32 +++++++++++++++++++++++--------- gdb/testsuite/lib/gdb.exp | 17 +++++++++++++++-- 4 files changed, 53 insertions(+), 13 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 91439be..56cd30b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,17 @@ +Sun Jun 29 16:43:30 1997 Bob Manson + + * gdb.base/overlays.exp: Preliminary fixes; temporarily disabled + until it has been modified to work with the new testsuite. + + * gdb.*/*.exp: Instead of causing 1 unresolved test when the + testcase won't compile, cause all of the testcases in the file to + fail instead. + + * lib/gdb.exp(gdb_suppress_entire_file): New procedure. + (gdb_clear_suppressed): New procedure. + (gdb_stop_suppressing_tests): Only clear suppress_flag if + it contains a positive value. + Sat Jun 28 13:31:11 1997 Bob Manson * lib/gdb.exp(default_gdb_start): Use gdb_opts host feature. diff --git a/gdb/testsuite/gdb.disasm/mn10200.exp b/gdb/testsuite/gdb.disasm/mn10200.exp index 7bc52d5..f9e71df 100644 --- a/gdb/testsuite/gdb.disasm/mn10200.exp +++ b/gdb/testsuite/gdb.disasm/mn10200.exp @@ -37,8 +37,7 @@ set testfile "mn10200" set srcfile ${srcdir}/${subdir}/${testfile}.s set binfile ${objdir}/${subdir}/${testfile} if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } { - perror "Couldn't compile ${srcfile}" - return -1 + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } proc add_tests { } { diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/weird.exp index 047bae8..aa0bcbc 100644 --- a/gdb/testsuite/gdb.stabs/weird.exp +++ b/gdb/testsuite/gdb.stabs/weird.exp @@ -1,3 +1,22 @@ +# Copyright (C) 1997 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + # Test that GDB properly ignores invalid stabs. # Also test that GDB can debug a .o file, and that it doesn't mind # a file that's more minimal than what a compiler normally puts out. @@ -11,10 +30,6 @@ if ![file isdirectory ${objdir}/${subdir}] then { return 0 } -if ![file exists ${objdir}/${subdir}/weird.s] { - return 0 -} - set prms_id 0 set bug_id 0 @@ -28,7 +43,7 @@ proc do_tests {} { # will be lost. # Skip the rest of the stabs tests for this case. send_gdb "ptype inttype\n" - expect { + gdb_expect { -re "^ptype inttype\r*\ntype = inttype.*$gdb_prompt $" { pass "stabs found" } @@ -198,7 +213,7 @@ proc print_weird_var { var } { # Make sure that the variable gets printed out correctly, without # any sort of warning message. send_gdb "print $var\n" - expect { + gdb_expect { -re "^print $var\r*\n.\[0-9\]* = 42.*$gdb_prompt $" { pass "variable $var printed properly" } @@ -268,8 +283,7 @@ if { [lindex $exec_output 0] != 0 } { } if { [gdb_compile "${srcfile}" "${binfile}" object ""] != "" } { - perror "Couldn't compile ${srcfile}" - return -1 + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } remote_file build delete ${srcfile} @@ -282,7 +296,7 @@ send_gdb "file $binfile\n" # But \[^\n\]* doesn't seem to work, so instead use the heuristic # that a filename won't contain a space and a warning message will. # But spaces following by backspaces aren't really spaces. -expect { +gdb_expect { -re "^file (\[^ \]| +\008)*\r*\nReading symbols from $binfile\.\.\.done\.\r*\n$gdb_prompt $" { pass "weirdx.o read without error" } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 6994c6d..250f952 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -874,6 +874,13 @@ proc gdb_expect { args } { } } +proc gdb_suppress_entire_file { reason } { + global suppress_flag; + + warning "$reason\n"; + set suppress_flag -1; +} + # # Set suppress_flag, which will cause all subsequent calls to send_gdb and # gdb_expect to fail immediately (until the next call to @@ -900,7 +907,7 @@ proc gdb_stop_suppressing_tests { } { global suppress_flag; if [info exists suppress_flag] { - if { $suppress_flag != 0 } { + if { $suppress_flag > 0 } { set suppress_flag 0; clone_output "Tests restarted.\n"; } @@ -909,6 +916,12 @@ proc gdb_stop_suppressing_tests { } { } } +proc gdb_clear_suppressed { } { + global suppress_flag; + + set suppress_flag 0; +} + proc gdb_start { } { default_gdb_start } @@ -932,7 +945,7 @@ proc gdb_continue { function } { } proc default_gdb_init { args } { - gdb_stop_suppressing_tests; + gdb_clear_suppressed; # Uh, this is lame. Really, really, really lame. But there's this *one* # testcase that will fail in random places if we don't increase this. -- 2.7.4