Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Dov Grobgeld <dov.grobgeld@gmail.com>
To: Tim Black <timblaktu@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Loop over threads in python
Date: Tue, 05 Jun 2012 05:28:00 -0000	[thread overview]
Message-ID: <CA++fsGH-1Uph7j_v7u4ST5t03tTX=6YrO3TwBaxesOoaOs74pg@mail.gmail.com> (raw)
In-Reply-To: <CA+23wiRZmt9hs3MCtj-Tgd3pY6AU=iD0Od5v03G=RxwU5U6+SA@mail.gmail.com>

Great! This is exactly what I needed. The documentation is really lacking.

Meanwhile I put together a "threadgrep" command yesterday by using
gdb.execute() and string parsing.

If someone is interested it may be gotten from:

https://github.com/dov/dov-env/blob/master/gdb/pythreadgrep.py

Regards,
Dov

On Mon, Jun 4, 2012 at 8:40 PM, Tim Black <timblaktu@gmail.com> wrote:
>
> 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 <dov.grobgeld@gmail.com> 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


  reply	other threads:[~2012-06-05  5:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA++fsGEES6rmeqWK9C5nyKH30+agT5ie+cY5tXMKpCx_0Cokhg@mail.gmail.com>
2012-06-04  6:40 ` Dov Grobgeld
2012-06-04 17:40   ` Tim Black
2012-06-05  5:28     ` Dov Grobgeld [this message]
2012-06-06 18:11       ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA++fsGH-1Uph7j_v7u4ST5t03tTX=6YrO3TwBaxesOoaOs74pg@mail.gmail.com' \
    --to=dov.grobgeld@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=timblaktu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox