From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10120 invoked by alias); 4 Jun 2012 17:40:51 -0000 Received: (qmail 9967 invoked by uid 22791); 4 Jun 2012 17:40:49 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-we0-f169.google.com (HELO mail-we0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Jun 2012 17:40:34 +0000 Received: by wefh52 with SMTP id h52so3776923wef.0 for ; Mon, 04 Jun 2012 10:40:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.228.29 with SMTP id e29mr11933799weq.153.1338831632698; Mon, 04 Jun 2012 10:40:32 -0700 (PDT) Received: by 10.216.232.76 with HTTP; Mon, 4 Jun 2012 10:40:32 -0700 (PDT) In-Reply-To: References: Date: Mon, 04 Jun 2012 17:40:00 -0000 Message-ID: Subject: Re: Loop over threads in python From: Tim Black To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00023.txt.bz2 This article gives a good overview of driving gdb with python and answers your question: http://www.linuxjournal.com/article/11027 On Sun, Jun 3, 2012 at 11:40 PM, Dov Grobgeld wrote: > Hello, > > I would like to write a python command that lists all threads (of a > C++ program) that in its call path has a function matching a user > specified pattern. > > To do that I have to iterate over all the threads. But I couldn't find > such a python API. Do I currently have to resort to using gdb commands > and parsing the output myself? > > Thanks! > Dov