From patchwork Tue Mar 1 14:20:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 590544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 78EB61402CD for ; Wed, 2 Mar 2016 01:20:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=DkL67xzl; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=mm8lgCmIKbaaaqJ2n206LWJt1pW3YuX196+fl4jO8sPDgNN+jd fCX8IV+zSvPzJCxyTxSSqkbRhl0ar/hwBlUoWqIPxabQSMX7q92MZoXPq/ghBcwt swzlitukA7FZ3oIah7gpbA02oeLo3/ozfGd9gHkv7wPXhQ0yaq5UNt/+4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=qvMk0bn7q+6FglYiD31cyfdX/lg=; b=DkL67xzlSPhYdYXADu44 YxWmkGA8mLGoHmT2vWK6JRp9L5oGe1arSTQC2U+JppqqdwH1Zmenl+5hZ5/G9TnS 2Hom6S96CzE5PQdoQCS0SpU3VBwyXGbwIF7jXkpVMZQrQ8CCwmuNof0Slh2ekFeB VUGisNXGmdTQUQ6ztKlaHUg= Received: (qmail 37033 invoked by alias); 1 Mar 2016 14:20:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 37000 invoked by uid 89); 1 Mar 2016 14:20:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*r:Sun, fortunately, lying, 498 X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Mar 2016 14:20:23 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 34626DA8; Tue, 1 Mar 2016 15:20:21 +0100 (CET) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CR7bQ41EcwjJ; Tue, 1 Mar 2016 15:20:18 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id C2988DA7; Tue, 1 Mar 2016 15:20:17 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id u21EKHSj001976; Tue, 1 Mar 2016 15:20:17 +0100 (CET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Mike Stump Subject: [testsuite] Invoke gdb with -batch to avoid prompts Date: Tue, 01 Mar 2016 15:20:16 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes When switching from gdb 7.10 to the newly released gdb 7.11 on Solaris, all simulate-thread tests started to timeout, adding about 2 1/2 hours to bootstrap time. It turned out that this happens as follows: with gdb 7.10, a test is run like this and runs to completion without interaction: /vol/gcc/bin/amd64/gdb-7.10 -nx -nw -x /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb ./atomic-load-int.exe With gdb 7.11, OTOH, I see /vol/gcc/bin/amd64/gdb-7.11 -nx -nw -x /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb ./atomic-load-int.exe and the test goes interactive once per page Thread 2 hit Breakpoint 1, simulate_thread_main () at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c:97 97 for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--) ---Type to continue, or q to quit--- when run interactively, and hangs the test inside the testsuite. Strangely, this doesn't happen on x86_64-pc-linux-gnu, and I couldn't find anything related mentioned in the gdb NEWS file. I didn't dig too deeply into gdb source code to investigate. Fortunately, it turns out that the fix is simple: when gdb is invoked with -batch, both versions behave the same and never go interactive in this scenario. The -batch option goes way back (at least to gdb 5.2 which I still had lying around), so this seems a safe change. Tested with the appropriate runtest invocation on i386-pc-solaris2.12 and x86_64-pc-linux-gnu (with GDB_FOR_GCC_TESTING set to either gdb version) for gcc.dg/simulate-thread on both and gcc.dg/guality on Linux only. Ok for mainline, gcc-5 and gcc-4.9 branches (given that it adds hours to total bootstrap time)? Rainer 2016-02-29 Rainer Orth * lib/gcc-gdb-test.exp (gdb-test): Make log message match command. Invoke gdb with -batch. * lib/gcc-simulate-thread.exp (simulate-thread): Likewise. # HG changeset patch # Parent b8273f68b9015179dc5b11f384d55efd5b4130a8 Invoke gdb with -batch to avoid prompts diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp b/gcc/testsuite/lib/gcc-gdb-test.exp --- a/gcc/testsuite/lib/gcc-gdb-test.exp +++ b/gcc/testsuite/lib/gcc-gdb-test.exp @@ -73,8 +73,8 @@ proc gdb-test { args } { puts $fd "quit" close $fd - send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$output_file\n" - set res [remote_spawn target "$gdb_name -nx -nw -quiet -x $cmd_file ./$output_file"] + send_log "Spawning: $gdb_name -nx -nw -quiet -batch -x $cmd_file ./$output_file\n" + set res [remote_spawn target "$gdb_name -nx -nw -quiet -batch -x $cmd_file ./$output_file"] if { $res < 0 || $res == "" } { unsupported "$testname" file delete $cmd_file diff --git a/gcc/testsuite/lib/gcc-simulate-thread.exp b/gcc/testsuite/lib/gcc-simulate-thread.exp --- a/gcc/testsuite/lib/gcc-simulate-thread.exp +++ b/gcc/testsuite/lib/gcc-simulate-thread.exp @@ -49,8 +49,8 @@ proc simulate-thread { args } { set message "thread simulation test" - send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$exec_file\n" - set res [remote_spawn target "$gdb_name -nx -nw -x $cmd_file ./$exec_file"] + send_log "Spawning: $gdb_name -nx -nw -batch -x $cmd_file ./$exec_file\n" + set res [remote_spawn target "$gdb_name -nx -nw -batch -x $cmd_file ./$exec_file"] if { $res < 0 || $res == "" } { unsupported "$testcase $message" return