* gdb.base/gcore-buffer-overflow.exp: Check whether gdb supports
authorMark Kettenis <kettenis@gnu.org>
Sun, 9 Sep 2007 21:31:00 +0000 (21:31 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 9 Sep 2007 21:31:00 +0000 (21:31 +0000)
gcore, before continuing with the test.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/gcore-buffer-overflow.exp

index c9ffd0e9f88fc4aeeac1b5720d153d21bf78604c..b7ecb215fc42410bc4f73a734770284983633963 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-09  Mark Kettenis  <kettenis@gnu.org>
+
+       * gdb.base/gcore-buffer-overflow.exp: Check whether gdb supports
+       gcore, before continuing with the test.
+
 2007-09-06  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gdb.mi/mi2-watch.exp: Set can-use-hw-watchpoints to 0 if required.
index 27905b596b20ab94d11da0cf22090d51d31b7710..27bed794455ba5eb9625a5613f207da96c75cc63 100644 (file)
@@ -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"