aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-03-19 18:38:56 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-03-19 18:38:56 +0000
commit2e98ca5343c02e2f2e0721b38f759373ba46e321 (patch)
tree20a08ddea06a94304e9f9698f69f43738579d1e9
parente97a38f76e90bf0cb06ce6a0459be7a488bf6816 (diff)
downloadgdb-2e98ca5343c02e2f2e0721b38f759373ba46e321.zip
gdb-2e98ca5343c02e2f2e0721b38f759373ba46e321.tar.gz
gdb-2e98ca5343c02e2f2e0721b38f759373ba46e321.tar.bz2
gdb/testsuite/
* gdb.base/auxv.c (func2): setrlimit to infinity to enable core dumps. * gdb.base/auxv.exp: Try to compile it with -DUSE_RLIMIT first. (generate native core dump): Make the test unsupported if core cannot be generated.
-rw-r--r--gdb/testsuite/ChangeLog8
-rw-r--r--gdb/testsuite/gdb.base/auxv.c15
-rw-r--r--gdb/testsuite/gdb.base/auxv.exp7
3 files changed, 28 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2a8bf9d..0c05576 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,4 +1,12 @@
2012-03-19 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * gdb.base/auxv.c (func2): setrlimit to infinity to enable core dumps.
+ * gdb.base/auxv.exp: Try to compile it with -DUSE_RLIMIT first.
+ (generate native core dump): Make the test unsupported if core cannot
+ be generated.
+
+2012-03-19 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.gdb/selftest.exp (do_steps_and_nexts): New entry
for cmdarg_vec = NULL. Remove entries for cmdsize = 1, cmdarg = and
diff --git a/gdb/testsuite/gdb.base/auxv.c b/gdb/testsuite/gdb.base/auxv.c
index ed5f2b6..c87d0f7 100644
--- a/gdb/testsuite/gdb.base/auxv.c
+++ b/gdb/testsuite/gdb.base/auxv.c
@@ -35,6 +35,13 @@
#define ABORT {char *invalid = 0; *invalid = 0xFF;}
#endif
+#ifdef USE_RLIMIT
+# include <sys/resource.h>
+# ifndef RLIM_INFINITY
+# define RLIM_INFINITY -1
+# endif
+#endif /* USE_RLIMIT */
+
/* Don't make these automatic vars or we will have to walk back up the
stack to access them. */
@@ -53,6 +60,14 @@ func2 (int x)
int i;
static int y;
+#ifdef USE_RLIMIT
+ {
+ struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY };
+
+ setrlimit (RLIMIT_CORE, &rlim);
+ }
+#endif
+
/* Make sure that coremaker_local doesn't get optimized away. */
for (i = 0; i < 5; i++)
coremaker_local[i] = i;
diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp
index da10f05..16f12c7 100644
--- a/gdb/testsuite/gdb.base/auxv.exp
+++ b/gdb/testsuite/gdb.base/auxv.exp
@@ -31,7 +31,10 @@ set binfile ${objdir}/${subdir}/${testfile}
set corefile ${objdir}/${subdir}/${testfile}.corefile
set gcorefile ${objdir}/${subdir}/${testfile}.gcore
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
+ {debug additional_flags=-DUSE_RLIMIT}] != ""
+ && [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
+ {debug}] != "" } {
untested "couldn't compile ${srcdir}/${subdir}/${srcfile}"
return -1
}
@@ -155,7 +158,7 @@ if {$core_works} {
} else {
set core_works 0
warning "can't generate a core file - core tests suppressed - check ulimit -c"
- fail $test
+ unsupported $test
}
} else {
unsupported $test