This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RFC: Gcore.exp for incapable targets
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 29 Sep 2003 11:22:07 -0400
- Subject: RFC: Gcore.exp for incapable targets
Right now, gcore.exp and gcore-thread.exp continue running even if creating
a core file fails. The cascade has lots of timeouts, and gcore doesn't work
(yet at least) over the remote protocol, so I tweaked the tests to return if
creating a core file fails.
The only problem I see with this patch is the unsupported; should it just be
a fail instead? If gcore fails natively this will cause a PASS->UNSUPPORTED
instead of the PASS->FAIL that I'd expect.
Preferences?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-09-29 Daniel Jacobowitz <drow@mvista.com>
* gdb.base/gcore.exp: Issue an UNSUPPORTED and exit if we can't
create a core file.
* gdb.threads/gcore-thread.exp: Likewise.
Index: gdb.base/gcore.exp
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.base/gcore.exp,v
retrieving revision 1.4
diff -u -p -r1.4 gcore.exp
--- gdb.base/gcore.exp 7 Aug 2003 17:55:41 -0000 1.4
+++ gdb.base/gcore.exp 29 Sep 2003 15:16:41 -0000
@@ -1,4 +1,4 @@
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003 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
@@ -106,9 +106,25 @@ set pre_corefile_extern_array \
set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test]
-gdb_test "gcore ${objdir}/${subdir}/gcore.test" \
- "Saved corefile ${escapedfilename}" \
- "save a corefile"
+gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \
+ "save a corefile" \
+{
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
+ pass "save a corefile"
+ global core_supported
+ set core_supported 1
+ }
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
+ unsupported "save a corefile"
+ global core_supported
+ set core_supported 0
+ }
+}
+
+global core_supported
+if {!$core_supported} {
+ return -1
+}
# Now restart gdb and load the corefile.
gdb_exit
Index: gdb.threads/gcore-thread.exp
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/gdb.threads/gcore-thread.exp,v
retrieving revision 1.4
diff -u -p -r1.4 gcore-thread.exp
--- gdb.threads/gcore-thread.exp 7 Aug 2003 17:55:41 -0000 1.4
+++ gdb.threads/gcore-thread.exp 29 Sep 2003 15:17:52 -0000
@@ -105,9 +105,25 @@ gdb_test "continue" "Continuing.*Breakpo
set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test]
# Drop corefile
-gdb_test "gcore ${objdir}/${subdir}/gcore.test" \
- "Saved corefile ${escapedfilename}" \
- "save a corefile"
+gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \
+ "save a corefile" \
+{
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
+ pass "save a corefile"
+ global core_supported
+ set core_supported 1
+ }
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
+ unsupported "save a corefile"
+ global core_supported
+ set core_supported 0
+ }
+}
+
+global core_supported
+if {!$core_supported} {
+ return -1
+}
# Now restart gdb and load the corefile.
gdb_exit