This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Loop over threads in python


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]