From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119232 invoked by alias); 11 Aug 2015 23:31:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 119223 invoked by uid 89); 11 Aug 2015 23:31:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 11 Aug 2015 23:31:50 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 8254F4C083; Tue, 11 Aug 2015 23:31:49 +0000 (UTC) Received: from localhost (unused-10-15-17-51.yyz.redhat.com [10.15.17.51]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7BNVmm0017510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 11 Aug 2015 19:31:49 -0400 From: Sergio Durigan Junior To: GDB Patches Cc: Pedro Alves , Keith Seitz , Patrick Palka Subject: [PATCH] Guarantee save-and-restore of GDBFLAGS on gdb.base/checkpoint-ns.exp X-URL: http://blog.sergiodj.net Date: Tue, 11 Aug 2015 23:31:00 -0000 Message-ID: <87614l766z.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00259.txt.bz2 Hello, This is a very simple patch, which depends on Patrick Palka's "save_vars" patch (, approved but not pushed yet). 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. For that, we decided to use "save_vars". The testsuite now is back to normal, and no regressions have been introduced by this patch. OK to apply (after Patrick applies his save_var patch)? -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/ 2015-08-11 Sergio Durigan Junior Pedro Alves Keith Seitz * gdb.base/checkpoint-ns.exp: Use save_vars to save and restore GDBFLAGS. diff --git a/gdb/testsuite/gdb.base/checkpoint-ns.exp b/gdb/testsuite/gdb.base/checkpoint-ns.exp index d3698ba..d470bc4 100644 --- a/gdb/testsuite/gdb.base/checkpoint-ns.exp +++ b/gdb/testsuite/gdb.base/checkpoint-ns.exp @@ -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 +}