From 7d605576a6ff0e9986a68e98b0a1893ce30e1f32 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 13 Oct 2003 16:30:45 +0000 Subject: [PATCH] * gdb.base/gcore.exp: Issue an UNSUPPORTED and exit if we can't create a core file. * gdb.threads/gcore-thread.exp: Likewise. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/gcore.exp | 24 ++++++++++++++++++---- gdb/testsuite/gdb.threads/gcore-thread.exp | 22 +++++++++++++++++--- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4807d7f4747..c22d93e9f53 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2003-10-13 Daniel Jacobowitz + + * gdb.base/gcore.exp: Issue an UNSUPPORTED and exit if we can't + create a core file. + * gdb.threads/gcore-thread.exp: Likewise. + 2003-10-13 Corinna Vinschen * gdb.base/call-rt-st.c (struct bit_flags_char_t): New bitfield diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp index 8c0ae8eb5c4..0576638b9b0 100644 --- a/gdb/testsuite/gdb.base/gcore.exp +++ b/gdb/testsuite/gdb.base/gcore.exp @@ -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 diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp index 5cb80bd7c79..40c9adaad80 100644 --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -105,9 +105,25 @@ gdb_test "continue" "Continuing.*Breakpoint.* thread2 .*" "thread 2 is running" 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 -- 2.30.2