From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28329 invoked by alias); 19 Jul 2012 18:41:18 -0000 Received: (qmail 28315 invoked by uid 22791); 19 Jul 2012 18:41:17 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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, 19 Jul 2012 18:41:01 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6JIewfQ023771 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 Jul 2012 14:40:58 -0400 Received: from host2.jankratochvil.net (ovpn-116-30.ams2.redhat.com [10.36.116.30]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6JIes6C015119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 19 Jul 2012 14:40:56 -0400 Date: Thu, 19 Jul 2012 18:41:00 -0000 From: Jan Kratochvil To: markus.t.metzger@intel.com Cc: gdb-patches@sourceware.org, markus.t.metzger@gmail.com, palves@redhat.com, tromey@redhat.com Subject: Re: [PATCH 1/1] gdb, python: update threads in Inferior.threads () Message-ID: <20120719184050.GA15108@host2.jankratochvil.net> References: <1342711757-7243-1-git-send-email-markus.t.metzger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1342711757-7243-1-git-send-email-markus.t.metzger@intel.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: 2012-07/txt/msg00368.txt.bz2 On Thu, 19 Jul 2012 17:29:17 +0200, markus.t.metzger@intel.com wrote: > gdb/python/ > * py-inferior.c (infpy_threads): Call update_thread_list (). > > gdb/testsuite/gdb.python/ > * py-threads.c: New file. > * py-threads.exp: New file. OK with the issue below but please check it in only after several days, there is questionable the caching of threads list. > +static void * > +thread (void *param) > +{ > + for (;;) > + ; (1) Never create needlessly busy-looping testcases. Therefore use sleep(). (2) Never create testcases which run forever, always use some reasonable timeout (such as 60 seconds). > + return param; > +} [...] > +gdb_test "python print len(gdb.selected_inferior().threads())" "9" "py-threads" Nitpick but better "\r\n9" as otherwise any number x%10==9 would match. Thanks, Jan