From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29720 invoked by alias); 26 Sep 2008 03:52:13 -0000 Received: (qmail 29710 invoked by uid 22791); 26 Sep 2008 03:52:13 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 26 Sep 2008 03:51:19 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m8Q3pGK4015202 for ; Thu, 25 Sep 2008 23:51:16 -0400 Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m8Q3pEas025606; Thu, 25 Sep 2008 23:51:14 -0400 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.stuttgart.redhat.com (8.13.1/8.13.1) with ESMTP id m8Q3pC6P018673; Thu, 25 Sep 2008 23:51:13 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.2) with ESMTP id m8Q3pC3x001368; Fri, 26 Sep 2008 05:51:12 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.2/Submit) id m8Q3pBdD001365; Fri, 26 Sep 2008 05:51:11 +0200 Date: Fri, 26 Sep 2008 03:52:00 -0000 From: Jan Kratochvil To: Andreas Schwab Cc: Roland McGrath , Doug Evans , GDB Patches , mark.kettenis@xs4all.nl Subject: Re: [patch] Fix Linux attach to signalled/stopped processes Message-ID: <20080926035111.GA1197@host0.dyn.jankratochvil.net> References: <20080401223012.GA14076@host0.dyn.jankratochvil.net> <20080410153735.GD21662@caradoc.them.org> <20080410154839.GA5375@host0.dyn.jankratochvil.net> <20080410231205.2DBFD26F992@magilla.localdomain> <20080411161824.GA4183@host0.dyn.jankratochvil.net> <20080412000155.7F07A26FA5E@magilla.localdomain> <20080414143448.GA32227@caradoc.them.org> <20080414150919.GB32227@caradoc.them.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="oC1+HKm2/end4ao3" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2008-09/txt/msg00509.txt.bz2 --oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 210 On Wed, 24 Sep 2008 14:45:46 +0200, Andreas Schwab wrote: > > +set testpid2 [expr $testpid + 2] > > There is no reason that this is required to work. Yes, thanks for the notice. OK to commit? Regards, Jan --oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="gdb-attachstop-mt.patch" Content-length: 2185 2008-09-26 Jan Kratochvil * gdb.threads/attachstop-mt.exp: Note a real testcase name this testcase is derived from. Fix racy dependency on an expected PID number. No longer support the testcase on Linux kernel 2.4.x. --- gdb/testsuite/gdb.threads/attachstop-mt.exp 1 May 2008 18:50:14 -0000 1.1 +++ gdb/testsuite/gdb.threads/attachstop-mt.exp 26 Sep 2008 03:45:31 -0000 @@ -14,9 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# This test was created by modifying gdb.threads/attachstop. -# This file was created by Jan Kratochvil . -# Regression for: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197584 +# This test is based on gdb.base/attach.exp with modifications by Jeff Johnston +# and Jan Kratochvil . # This test only works on Linux if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { @@ -52,17 +51,25 @@ set testpid [eval exec $binfile &] # No race sleep 2 -# Do not: set testpid2 [expr $testpid + 1] -# as it will not exist on Red Hat 2.6.9-34.0.2.ELsmp -set testpid2 [expr $testpid + 2] - -set status2 /proc/${testpid}/task/${testpid2}/status -if {[expr ! [file exists $status2]]} { - # kernel-2.4 - set status2 /proc/${testpid2}/status +# The testcase has three threads, find some other thread TID for $testpid2. +set tids [exec sh -c "echo /proc/$testpid/task/*"] +regsub -all /proc/$testpid/task/ $tids {} tids +if {$tids == "*"} { + unresolved "/proc/PID/task is not supported (kernel-2.4?)" + remote_exec build "kill -9 ${testpid}" + return -1 } +set tids [lsort -integer [split $tids]] +if {[llength $tids] != 3 || [lindex $tids 0] != $testpid} { + verbose -log "Invalid TIDs <$tids> for PID $testpid" + fail "Invalid TIDs found" + remote_exec build "kill -9 ${testpid}" + return -1 +} +set testpid2 [lindex $tids 2] # Initial sanity test it is normally sleeping +set status2 /proc/${testpid}/task/${testpid2}/status set fileid0 [open $status2 r]; gets $fileid0 line1; gets $fileid0 line2; --oC1+HKm2/end4ao3--