From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77075 invoked by alias); 22 Aug 2016 14:28:23 -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 76859 invoked by uid 89); 22 Aug 2016 14:28:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:209.85.220.67, H*RU:209.85.220.67, spawn, sk:build_e X-HELO: mail-pa0-f67.google.com Received: from mail-pa0-f67.google.com (HELO mail-pa0-f67.google.com) (209.85.220.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Aug 2016 14:28:12 +0000 Received: by mail-pa0-f67.google.com with SMTP id vy10so8189464pac.0 for ; Mon, 22 Aug 2016 07:28:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=FUAoNMdfwkynq+S4e7rD1nL2zkGspPn8bqKoS1Hnstw=; b=RVy4TQXzpg6u//7pP5qRGu07nTmY8qtOOXKXi96omlIWUPvoBJMCCogVGbc22hphOo uwj+TNfAkIh7fjzb1nmBLkK3PD8WYE5cBHmfY5RJmxrMcfctruCycEB8k8kiZLF8Jv6y hc0lCl5n/a843vquaYlTIuBQgXNc6RsvTI/aVeq+Wdd3gDW1f5GGOnKgXPI5cxNweYo1 z08i99Z3R5EbtLEdZKMuuWKWVP+4+UfiWUg3fFuwVHsLu1NXbOlZ3lSO1X/dvmRUkFnb 0k5aOVgyU/JpI2GrJFYkhMJHc2EPZxZIK2SMIWVBPR1uq6axTsf+ESdlA3ZQa6FTUCBi 9mNQ== X-Gm-Message-State: AEkooutY+U9j8Pqei38Pg2vVWuZXYcmqyUH7OiT4Yj1eDzuLoasb/MUEHkjNiyXjvFf0aA== X-Received: by 10.66.219.200 with SMTP id pq8mr43257924pac.75.1471876091271; Mon, 22 Aug 2016 07:28:11 -0700 (PDT) Received: from E107787-LIN (gcc115.osuosl.org. [140.211.9.73]) by smtp.gmail.com with ESMTPSA id f6sm27827772pfa.17.2016.08.22.07.28.08 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 22 Aug 2016 07:28:10 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: John Baldwin , gdb-patches@sourceware.org Subject: Re: [PATCH v2] Fix PR gdb/18653: gdb disturbs inferior's inherited signal dispositions References: <1470332251-10857-1-git-send-email-palves@redhat.com> <2148041.k6fglmTO5R@ralph.baldwin.cx> <86d1ddee-9841-d332-27d5-15c8c185063e@redhat.com> Date: Mon, 22 Aug 2016 14:28:00 -0000 In-Reply-To: <86d1ddee-9841-d332-27d5-15c8c185063e@redhat.com> (Pedro Alves's message of "Fri, 5 Aug 2016 11:56:56 +0100") Message-ID: <864m6cdgju.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00211.txt.bz2 Pedro Alves writes: > diff --git a/gdb/testsuite/gdb.base/signals-state-child.exp b/gdb/testsui= te/gdb.base/signals-state-child.exp > new file mode 100644 > index 0000000..f5fdcb2 > + > +set gdb_txt [standard_output_file gdb.txt] > +set standalone_txt [standard_output_file standalone.txt] > +remote_exec host "rm -f $gdb_txt" > +remote_exec host "rm -f $standalone_txt" > + > +set options [list debug "additional_flags=3D-DOUTPUT_TXT=3D\"$gdb_txt\""] > +if {[build_executable $testfile.exp $testfile $srcfile $options]} { > + untested $testfile.exp > + return -1 > +} $gdb_txt and $standalone_txt is the file location on build, but we pass them to the test file, which will be run on target. It won't work if build !=3D target. > + > +set options [list debug "additional_flags=3D-DOUTPUT_TXT=3D\"$standalone= _txt\""] > +if {[build_executable $testfile.exp $testfile-standalone $srcfile $optio= ns]} { > + untested $testfile.exp > + return -1 > +} > + > +# Run the program directly, and dump its initial signal actions and > +# mask in "standalone.txt". > + > +# Use remote_spawn instead of remote_exec, like how we spawn gdb. > +# This is in order to take the same code code paths in dejagnu > +# compared to when running the program through gdb. E.g., because > +# local_exec uses -ignore SIGHUP, while remote_spawn does not, if we > +# used remote_exec, the test program would start with SIGHUP ignored > +# when run standalone, but not when run through gdb. > +set res [remote_spawn host "$binfile-standalone"] s/host/target/ > +if { $res < 0 || $res =3D=3D "" } { > + untested "spawning $binfile-standalone failed" > + return 1 > +} else { > + pass "collect standalone signals state" > +} > +remote_close host How about the patch below? It follows the way we fix the problem of this kind in mi-traceframe-changed.exp and tfile.exp. How about the patch below? It should go to master and 7.12 branch. --=20 Yao (=E9=BD=90=E5=B0=A7) =46rom 6be8c11c9dc2f733449c1a988dee5f8354f5dfc6 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Fri, 19 Aug 2016 14:49:31 +0100 Subject: [PATCH] Fix signals-state-child.exp in remote testing Remote testing isn't considered in signals-state-child.exp, so the it fails like shell diff -s /scratch/yao/gdb/build-git/aarch64-linux-gnu/gdb/testsuite/ou= tputs/gdb.base/signals-state-child/standalone.txt /scratch/yao/gdb/build-gi= t/aarch64-linux-gnu/gdb/testsuite/outputs/gdb.base/signals-state-child/gdb.= txt^M diff: /scratch/yao/gdb/build-git/aarch64-linux-gnu/gdb/testsuite/outputs/gd= b.base/signals-state-child/standalone.txt: No such file or directory^M (gdb) FAIL: gdb.base/signals-state-child.exp: signals states are identical This patch is to fix it. gdb/testsuite: 2016-08-22 Yao Qi * gdb.base/signals-state-child.exp: Set variables gdb_txt and standalone_txt. Delete gdb_txt and standalone_txt on host and target. Spawn the binary on target. Copy files from target to host. diff --git a/gdb/testsuite/gdb.base/signals-state-child.exp b/gdb/testsuite= /gdb.base/signals-state-child.exp index f5fdcb2..cd6a9a5 100644 --- a/gdb/testsuite/gdb.base/signals-state-child.exp +++ b/gdb/testsuite/gdb.base/signals-state-child.exp @@ -29,10 +29,20 @@ =20 standard_testfile =20 -set gdb_txt [standard_output_file gdb.txt] -set standalone_txt [standard_output_file standalone.txt] -remote_exec host "rm -f $gdb_txt" -remote_exec host "rm -f $standalone_txt" +if {![is_remote host] && ![is_remote target]} { + set gdb_txt [standard_output_file gdb.txt] + set standalone_txt [standard_output_file standalone.txt] + set purely_local 1 +} else { + set gdb_txt gdb.txt + set standalone_txt standalone.txt + set purely_local 0 +} + +remote_file host delete $gdb_txt +remote_file host delete $standalone_txt +remote_file target delete $gdb_txt +remote_file target delete $standalone_txt =20 set options [list debug "additional_flags=3D-DOUTPUT_TXT=3D\"$gdb_txt\""] if {[build_executable $testfile.exp $testfile $srcfile $options]} { @@ -55,14 +65,14 @@ if {[build_executable $testfile.exp $testfile-standalon= e $srcfile $options]} { # local_exec uses -ignore SIGHUP, while remote_spawn does not, if we # used remote_exec, the test program would start with SIGHUP ignored # when run standalone, but not when run through gdb. -set res [remote_spawn host "$binfile-standalone"] +set res [remote_spawn target "$binfile-standalone"] if { $res < 0 || $res =3D=3D "" } { untested "spawning $binfile-standalone failed" return 1 } else { pass "collect standalone signals state" } -remote_close host +remote_close target =20 # Now run the program through gdb, and dump its initial signal actions # and mask in "gdb.txt". @@ -76,6 +86,12 @@ if { ! [ runto_main ] } then { =20 gdb_continue_to_end "collect signals state under gdb" =20 +if {!$purely_local} { + # Copy file from target to host through build. + remote_download host [remote_upload target gdb.txt] gdb.txt + remote_download host [remote_upload target standalone.txt] standalone.= txt +} + # Diff the .txt files. They should be identical. gdb_test "shell diff -s $standalone_txt $gdb_txt" \ "Files .* are identical.*" \