Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: gdb-patches@sourceware.org
Subject: [RFA] testsuite: fix py-value tests
Date: Tue, 04 Oct 2011 15:20:00 -0000	[thread overview]
Message-ID: <D25A8D77-1384-4D05-8C8F-65D2DD9AF9E5@comcast.net> (raw)

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


             reply	other threads:[~2011-10-04 15:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 15:20 Paul Koning [this message]
2011-10-04 17:28 ` Tom Tromey
2011-10-04 17:43   ` Paul Koning

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=D25A8D77-1384-4D05-8C8F-65D2DD9AF9E5@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=gdb-patches@sourceware.org \
    /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