From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13645 invoked by alias); 20 Jun 2012 13:55:23 -0000 Received: (qmail 13624 invoked by uid 22791); 20 Jun 2012 13:55:21 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jun 2012 13:55:07 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1ShLND-0005D3-6l from Yao_Qi@mentor.com ; Wed, 20 Jun 2012 06:55:07 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 20 Jun 2012 06:54:26 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Wed, 20 Jun 2012 06:55:05 -0700 Message-ID: <4FE1D637.2070901@codesourcery.com> Date: Wed, 20 Jun 2012 13:55:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120601 Thunderbird/13.0 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH 4/4] gdb: kfail for PR14161 References: <1339246002-1987-1-git-send-email-yao@codesourcery.com> <1339246002-1987-5-git-send-email-yao@codesourcery.com> <4FD76C4E.20107@redhat.com> <201206142301.34598.yao@codesourcery.com> <4FDB8E0B.8090908@redhat.com> In-Reply-To: <4FDB8E0B.8090908@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 X-SW-Source: 2012-06/txt/msg00630.txt.bz2 On 06/16/2012 03:33 AM, Pedro Alves wrote: >> > + # Due to PR gdb/14161, sockets files are not removed when agent exists. >> > + if [is_remote target] { >> > + foreach match [glob -nocomplain "/tmp/gdb_ust*"] { >> > + remote_file target delete $match > > That's unfortunately not good, because while the "delete" runs on > the "target", the "glob" is running on the "build" machine (which is usually > the "host", unless you're doing remote-host testing). > >> > + } >> > + } else { >> > + eval file delete [glob "/tmp/gdb_ust*"] >> > + } > This else doesn't work for remote-host testing either. With remote- > -host testing, you have expect running on machine A (build), GDB > running on machine B (host), and that GDB connecting to machine > C (target). Usually, either A and B are the same, or B and C are > the same, though A != B != C is possible. > I am using 'remote_exec target "sh -c \"rm -r $socket_file\""' to delete them in a unique way. The reason is explained in the comments. > Maybe we can avoid the need for globing in the first place, by making > strace_remove_socket (and whatever other function in the file, if > necessary), remove the socket file before returning, while they > still know the inferior's PID? Yes, at the end of strace_remove_socket, we can delete socket file if it still exists. In proc strace_info_marker, I simply force GDB to detach inferior, so the socket file can be removed as well. -- Yao (齐尧) gdb/testsuite: 2012-06-20 Yao Qi KFAIL for PR14161. * gdb.trace/strace.exp (strace_remove_socket): kfail for native. Cleanup socket files. (strace_info_marker): Detach inferior. --- gdb/testsuite/gdb.trace/strace.exp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gdb/testsuite/gdb.trace/strace.exp b/gdb/testsuite/gdb.trace/strace.exp index d45c66d..587d9b3 100644 --- a/gdb/testsuite/gdb.trace/strace.exp +++ b/gdb/testsuite/gdb.trace/strace.exp @@ -111,6 +111,9 @@ proc strace_remove_socket { action } { if { $exists } { fail $test + # Since $socket_file is a socket file instead of a regular file, we + # can't use 'remote_file target delete $socket_file' here. + remote_exec target "sh -c \"rm -r $socket_file\"" } else { pass $test } @@ -145,6 +148,13 @@ proc strace_info_marker { } { with_test_prefix "info_marker" { pass "info threads" } } + + # GDB detaches inferior so that the socket file can be removed. + gdb_test_multiple "detach" "detach" { + -re "Detaching .*, process .*${gdb_prompt} $" { + pass "detach" + } + } }} proc strace_probe_marker { } { with_test_prefix "probe_marker" { -- 1.7.9.5