[RFA] testsuite: fix py-value tests

Paul Koning paulkoning@comcast.net
Tue Oct 4 15:20:00 GMT 2011


In my test runs, the py-value.exp tests produced 10 failures apparently because of values going dead by the time the breakpoint (at the "return" in main()) is hit.  For example, I see argv==0x19 at that point, which is not a good value.

The attached patch fixes this; the breakpoint now happens at the assignment and gcc doesn't optimize away things yet at that point.  Result is all pass instead of 10 failures.

I'm not sure how to describe the change for the ChangeLog.

	paul

ChangeLog:

2011-10-04  Paul Koning  <paul_koning@dell.com>

	* gdb.python/py-value.c (main): Break before return.

Index: testsuite/gdb.python/py-value.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-value.c,v
retrieving revision 1.8
diff -u -r1.8 py-value.c
--- testsuite/gdb.python/py-value.c	1 Jan 2011 15:33:49 -0000	1.8
+++ testsuite/gdb.python/py-value.c	4 Oct 2011 15:12:25 -0000
@@ -66,6 +66,8 @@
   return arg1 + arg2;
 }
 
+char **save_argv;
+
 int
 main (int argc, char *argv[])
 {
@@ -94,5 +96,6 @@
   ptr_ref(ptr_i);
 #endif
 
-  return 0;      /* break to inspect struct and union */
+  save_argv = argv;      /* break to inspect struct and union */
+  return 0;
 }



More information about the Gdb-patches mailing list