aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1997-06-28 06:03:43 +0000
committerFred Fish <fnf@specifix.com>1997-06-28 06:03:43 +0000
commit70742cd83193a0f11047a5158a60217cfe99dadd (patch)
tree21d8e141042693bfc07af285c50c38a7eac2ba0d /gdb/testsuite/lib
parent08d8f99560920cb059d1d670649b93d9ab384f0d (diff)
downloadgdb-70742cd83193a0f11047a5158a60217cfe99dadd.zip
gdb-70742cd83193a0f11047a5158a60217cfe99dadd.tar.gz
gdb-70742cd83193a0f11047a5158a60217cfe99dadd.tar.bz2
* lib/gdb.exp (setup_xfail_format): New function.
(get_debug_format): New function to get debug format. (debug_format): New global variable to hold last value set by get_debug_format. * gdb.base/list.exp: Call get_debug_format and expect some tests to fail for DWARF 1 and COFF formats. * gdb.c++/ptype.exp: Ditto. * gdb.c++/classes.exp: Ditto. * gdb.c++/cplusfuncs.exp: Ditto. * gdb.c++/inherit.exp: Ditto. * gdb.c++/templates.exp: Ditto. * gdb.c++/virtfunc.exp: Ditto.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp47
1 files changed, 47 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 0065332..e217d38 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -964,3 +964,50 @@ proc gdb_init { args } {
proc gdb_finish { } {
gdb_exit;
}
+
+global debug_format
+
+# Run the gdb command "info source" and extract the debugging format information
+# from the output and save it in debug_format.
+
+proc get_debug_format { } {
+ global gdb_prompt
+ global verbose
+ global expect_out
+ global debug_format
+
+ set debug_format "unknown"
+ send_gdb "info source\n"
+ gdb_expect {
+ -re ".*Compiled with (.*) debugging format.\r\n$gdb_prompt $" {
+ set debug_format $expect_out(1,string)
+ verbose "debug format is $debug_format"
+ return 1;
+ }
+ -re ".*No current source file.\r\n$gdb_prompt $" {
+ perror "get_debug_format used when no current source file"
+ return 0;
+ }
+ timeout {
+ perror "couldn't check debug format (timed out)."
+ return 0;
+ }
+ }
+}
+
+# Like setup_xfail, but takes the name of a debug format (DWARF 1, COFF, stabs, etc).
+# If that format matches the format that the current test was compiled with, then
+# the next test is expected to fail for any target. Returns 1 if the next test or
+# set of tests is expected to fail, 0 otherwise (or if it is unknown). Must
+# have previously called get_debug_format.
+
+proc setup_xfail_format { format } {
+ global debug_format
+
+ if [string match $debug_format $format] then {
+ setup_xfail "*-*-*"
+ return 1;
+ }
+ return 0
+}
+