From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20397 invoked by alias); 18 Jul 2012 13:54:37 -0000 Received: (qmail 20369 invoked by uid 22791); 18 Jul 2012 13:54:35 -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; Wed, 18 Jul 2012 13:54:22 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IDsKAo015005 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Jul 2012 09:54:20 -0400 Received: from host2.jankratochvil.net (ovpn-116-30.ams2.redhat.com [10.36.116.30]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6IDsGAG014880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 18 Jul 2012 09:54:19 -0400 Date: Wed, 18 Jul 2012 13:54:00 -0000 From: Jan Kratochvil To: markus.t.metzger@intel.com Cc: gdb-patches@sourceware.org, markus.t.metzger@gmail.com Subject: Re: [PATCH 1/1] gdb, python: update threads in Inferior.threads () Message-ID: <20120718135413.GA10378@host2.jankratochvil.net> References: <1341568171-27211-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: <1341568171-27211-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/msg00260.txt.bz2 On Fri, 06 Jul 2012 11:49:31 +0200, markus.t.metzger@intel.com wrote: > Update the thread list in infpy_threads () before creating the Python objects. It would be good to have a testcase for this issue. > Not sure this is the right place. We should probably update the thread list as > soon as we learn that the target stopped. So far update_thread_list is called only before (in) the commands which really need the thread list. The problem is that infpy_threads can be called from a script repeatedly which may be pretty inefficient to call update_thread_list each time. The right would be to: (1) Support update_thread_list per-inferior, not just for all inferiors at once. For example infpy_threads is interested only in specific inferior. (2) Cache the current thread list in struct inferior, clearing it from begin of target_resume according to PTID (which depends for example on 'set schedule-multiple', see user_visible_resume_ptid), therefore either the specific inferior only or all inferiors. Still it is trying to push at you optimization out of the scope of this patch. With a preferred testcase I find your patch OK. (Pedro knows better all this infrun stuff.) Thanks, Jan