diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-03-19 18:38:56 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-03-19 18:38:56 +0000 |
commit | 2e98ca5343c02e2f2e0721b38f759373ba46e321 (patch) | |
tree | 20a08ddea06a94304e9f9698f69f43738579d1e9 /gdb/testsuite/gdb.base/auxv.c | |
parent | e97a38f76e90bf0cb06ce6a0459be7a488bf6816 (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.c | 15 |
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; |