This is the mail archive of the
mailing list for the Archer project.
Re: Using Python to infer some internal data
- From: Tom Tromey <tromey at redhat dot com>
- To: "Andrew Brampton" <brampton at gmail dot com>
- Cc: archer at sourceware dot org
- Date: Tue, 13 Jan 2009 11:33:55 -0700
- Subject: Re: Using Python to infer some internal data
- References: <firstname.lastname@example.org>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Andrew" == Andrew Brampton <email@example.com> writes:
Andrew> So my question is. Is it possible for a python script to tell GDB
Andrew> about what processes/threads are currently running? If it is not
Andrew> possible, why not? If it will be possible one day, but not yet, is
Andrew> there any way I can help?
This touches parts of gdb I don't know very well. Maybe this fits
into the "let the user write a target entirely in Python" feature?
That is definitely on the wish-list, but there's no code.
Andrew> Also, is it possible for a python script to set a breakpoint, and be
Andrew> able to handle it itself without user interference?
You can do it hackily by making a breakpoint from Python, making it
silent, and then using gdb.execute to put commands on it.
This isn't really that nice though. I'd like to add something nicer,
say a function-valued attribute on Breakpoint or just the ability to
subclass and provide a handler method.
More stuff for the wish-list, I guess. We'll get to it eventually, or
we're eager to get patches. (If you want to go this route, we do
require copyright papers, since we will push this code into the FSF
Andrew> P.S If someone wouldn't mind, could they look at , and advice me if
Andrew> I used this new python gdb feature correctly? I have never coded in
Andrew> python, and I'm quite new to gdb.
Nice! It looks reasonable enough to me.