From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13605 invoked by alias); 17 Feb 2011 16:53:51 -0000 Received: (qmail 13545 invoked by uid 22791); 17 Feb 2011 16:53:50 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Feb 2011 16:53:44 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1HGrb1C010062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Feb 2011 11:53:37 -0500 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1HGrZkk005182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Feb 2011 11:53:36 -0500 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p1HGrYQD029523; Thu, 17 Feb 2011 17:53:34 +0100 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id p1HGrXNo029512; Thu, 17 Feb 2011 17:53:33 +0100 Date: Thu, 17 Feb 2011 16:57:00 -0000 From: Jan Kratochvil To: Michael Snyder Cc: Pedro Alves , "gdb-patches@sourceware.org" , Tom Tromey Subject: Re: [RFC] info threads takes an argument Message-ID: <20110217165333.GA29274@host1.dyn.jankratochvil.net> References: <4D54964A.2070401@vmware.com> <4D5AEDA7.1000405@vmware.com> <201102161148.36948.pedro@codesourcery.com> <4D5C16D9.9030204@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D5C16D9.9030204@vmware.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-02/txt/msg00427.txt.bz2 On Wed, 16 Feb 2011 19:26:33 +0100, Michael Snyder wrote: > Pedro Alves wrote: > >Anyway, the reason I'm replying is that I noticed a couple > >of new FAILs in this test, and looking at the log, I noticed > >another issue: > > Urk. I did half my work on the 7.2 branch, where it doesn't do this. > Let me fix it. I also see the failure: info threads 2 4 6 Id Target Id Frame 2 Thread 0x7ffff759e700 (LWP 24773) "threadname_2" 0x00007ffff7678213 in select () at ../sysdeps/unix/syscall-template.S:82 Id Target Id Frame 4 Thread 0x7ffff659c700 (LWP 24775) "threadname_4" 0x00007ffff7678213 in select () at ../sysdeps/unix/syscall-template.S:82 Id Target Id Frame 6 Thread 0x7ffff559a700 (LWP 24777) "threadname_6" __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136 (gdb) FAIL: gdb.threads/thread-find.exp: info threads 2 4 6 -re ". 6 .*\"threadname_6.*\" \[\r\n\]*" { set see6 1 exp_continue } -re ". 5 .*\"threadname_5.*\" \[\r\n\]*" { set see5 1 exp_continue } This is racy, * of the regexp is greedy by default and there can be multiple threadnames available during a single read/match, one match can swallow multiple entries. There should be some \[^\r\n\]* instead of any .* during such unanchored matching. One may also rather catch the whole output and regex-match by hand the caught output afterwards. Thanks, Jan