This is the mail archive of the archer@sourceware.org mailing list for the Archer 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: Using Python to infer some internal data


>>>>> "Andrew" == Andrew Brampton <brampton@gmail.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
gdb.)

Andrew> P.S If someone wouldn't mind, could they look at [2], 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.

Tom


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