This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] [gdb.threads/testsuite] failure while checking backtrace into main


While checking for non-regression in the gdb.threads part of the testsuite, I noticed one test fails with gcc4 since the argument of the main are removed by the compiler so don't appear when printing backtrace:
FAIL: gdb.threads/pthreads.exp: check backtrace from main thread


Either we can change the .exp file to avoid checking these arguments, or we can ensure compiler keeps them as proposed hereby.

--
Denis Pilat
STMicroelectronics
2007-01-31  Denis Pilat  <denis.pilat@st.com>

	* gdb.threads/pthreads.c: ensure argc and argv won't be removed by
	a compiler optimization.

Index: testsuite/gdb.threads/pthreads.c
===================================================================
--- testsuite/gdb.threads/pthreads.c	(revision 553)
+++ testsuite/gdb.threads/pthreads.c	(working copy)
@@ -122,6 +122,8 @@ main(argc, argv)
   void (*xxx) ();
   pthread_attr_t attr;
 
+  if (argv);
+  j = argc;
   if (verbose) printf ("pid = %d\n", getpid());
 
   foo (1, 2, 3);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]