This is the mail archive of the gdb-patches@sourceware.org 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]

[commit] check whether gcore is a supported command first


The new gcode-buffer-overflow.exp test doesn't check whether gcore is
available.  Copied the check from gcore.exp.

Committed,

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* gdb.base/gcore-buffer-overflow.exp: Check whether gdb supports
	gcore, before continuing with the test.

Index: gdb.base/gcore-buffer-overflow.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/gcore-buffer-overflow.exp,v
retrieving revision 1.1
diff -u -p -r1.1 gcore-buffer-overflow.exp
--- gdb.base/gcore-buffer-overflow.exp 2 Sep 2007 14:03:58 -0000 1.1
+++ gdb.base/gcore-buffer-overflow.exp 9 Sep 2007 21:28:10 -0000
@@ -45,6 +45,25 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
+# Does this gdb support gcore?
+send_gdb "help gcore\n"
+gdb_expect {
+    -re "Undefined command: .gcore.*$gdb_prompt $" {
+	# gcore command not supported -- nothing to test here.
+	unsupported "gdb does not support gcore on this target"
+	return -1;
+    }
+    -re "Save a core file .*$gdb_prompt $" {
+	pass "help gcore"
+    }
+    -re ".*$gdb_prompt $" {
+	fail "help gcore"
+    }
+    timeout {
+	fail "help gcore (timeout)"
+    }
+}
+
 gdb_test "set args ${pattern}"	\
          ""			\
          "Set buffer exceeding arguments"


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