summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/auxv.c
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 /gdb/testsuite/gdb.base/auxv.c
parente97a38f76e90bf0cb06ce6a0459be7a488bf6816 (diff)
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.
Diffstat (limited to 'gdb/testsuite/gdb.base/auxv.c')
-rw-r--r--gdb/testsuite/gdb.base/auxv.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/auxv.c b/gdb/testsuite/gdb.base/auxv.c
index ed5f2b6ec4..c87d0f7c2e 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;