Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Siddhesh Poyarekar <siddhesh@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix core dump test case failure with a ulimit check in gdb.base/auxv.exp
Date: Mon, 19 Mar 2012 16:13:00 -0000	[thread overview]
Message-ID: <20120319161324.GA25524@host2.jankratochvil.net> (raw)
In-Reply-To: <20120319155729.GC26662@spoyarek.pnq.redhat.com>

On Mon, 19 Mar 2012 16:57:31 +0100, Siddhesh Poyarekar wrote:
> To check whether setrlimit and sys/resource.h exist, I added an auto-header
> feature to the testsuite configure script

Sorry but there are IIRC rather plans to remove the testsuite configure script
at all.  I also find your solution too heavyweight.

I hope you find this simplified patch sufficient enough.


Thanks,
Jan


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.

--- 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;
--- 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


  reply	other threads:[~2012-03-19 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 14:29 [PATCH] Fix gdb.base/auxv and gdb.base/cond-eval-mode test cases Siddhesh Poyarekar
2012-03-16 15:50 ` Pedro Alves
2012-03-17  7:27   ` Siddhesh Poyarekar
2012-03-19  9:35     ` [commit] " Jan Kratochvil
2012-03-17  7:37   ` [PATCH] Fix core dump test case failure with a ulimit check in gdb.base/auxv.exp Siddhesh Poyarekar
2012-03-19  9:43     ` Jan Kratochvil
2012-03-19 15:57       ` Siddhesh Poyarekar
2012-03-19 16:13         ` Jan Kratochvil [this message]
2012-03-19 16:39           ` Siddhesh Poyarekar
2012-03-19 18:40             ` [commit] " Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120319161324.GA25524@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=siddhesh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox