Guarantee save-and-restore of GDBFLAGS on gdb.base/checkpoint-ns.exp
authorSergio Durigan Junior <sergiodj@redhat.com>
Wed, 12 Aug 2015 16:32:16 +0000 (12:32 -0400)
committerSergio Durigan Junior <sergiodj@redhat.com>
Wed, 12 Aug 2015 16:32:16 +0000 (12:32 -0400)
Keith found out that several tests were failing when testing the
native-gdbserver board on Fedora (x86_64).  Strangely, these failures
had not been reported by our BuildBot.  Later, he found that the reason
for this was because the failures only happened when running the
testsuite without FORCE_PARALLEL (i.e., on serial mode; maybe it would
be worth having a builder testing things on serial...).  Then, he
decided to start bisecting the changes to see which one introduced the
failure (it was not trivial to know this only by looking at gdb.log).

After a lot of time, he found that Pedro's commit
e1316e60d4d1fe406efc6e7536b2bdb43733e9d2 was the culprit.  There was
nothing wrong in the code, but the new gdb.base/checkpoint-ns.exp
testcase did something that left the GDBFLAGS variable in an
inconsistent state.  This test works by modifying this variable to set
non-stop on, sourcing gdb.base/checkpoint.exp (which does the hard
work), and then restoring the old value on GDBFLAGS.  However, this was
not working because gdb.base/checkpoint.exp bails out if it is being
tested on gdbserver, and when it calls "continue" the control goes back
to the function calling the tests, and not to
gdb.base/checkpoint-ns.exp.

The fix is simple: just wrap the "source" call, and make
gdb.base/checkpoint-ns.exp aware of the "continue"/"return" calls made
by gdb.base/checkpoint.exp.

gdb/testsuite/ChangeLog:
2015-08-12  Sergio Durigan Junior  <sergiodj@redhat.com>
    Pedro Alves  <palves@redhat.com>
    Keith Seitz  <keiths@redhat.com>

* gdb.base/checkpoint-ns.exp: Use save_vars to save and restore
GDBFLAGS.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/checkpoint-ns.exp

index 3324baab453b8de595f3c4b2432bab6cdb70425e..916da1f35b3f1705e612461a63baa9a3f652e191 100644 (file)
@@ -1,3 +1,10 @@
+2015-08-12  Sergio Durigan Junior  <sergiodj@redhat.com>
+           Pedro Alves  <palves@redhat.com>
+           Keith Seitz  <keiths@redhat.com>
+
+       * gdb.base/checkpoint-ns.exp: Use save_vars to save and restore
+       GDBFLAGS.
+
 2015-08-12  Patrick Palka  <patrick@parcs.ath.cx>
 
        * gdb.base/gdbhistsize-history.exp
index d3698bab818313dcbf61e40de948fc5e74d1c072..d470bc415564ea1a7d1daff7991d62580dea5831 100644 (file)
@@ -18,9 +18,8 @@
 # We drive non-stop mode from a separate file because the whole test
 # takes a while to run.  This way, we can test both modes in parallel.
 
-set saved_gdbflags $GDBFLAGS
-append GDBFLAGS " -ex \"set non-stop on\""
+save_vars { GDBFLAGS } {
+    append GDBFLAGS " -ex \"set non-stop on\""
 
-source $srcdir/$subdir/checkpoint.exp
-
-set GDBFLAGS $saved_gdbflags
+    source $srcdir/$subdir/checkpoint.exp
+}
This page took 0.035946 seconds and 4 git commands to generate.