From: Phil Muldoon <pmuldoon@redhat.com>
To: Kieran Bingham <kieran.bingham@linaro.org>, gdb@sourceware.org
Cc: Yao Qi <yao.qi@linaro.org>, Peter Griffin <peter.griffin@linaro.org>
Subject: Re: [RFC] Target Layer Python Interface
Date: Sun, 31 Jan 2016 15:21:00 -0000 [thread overview]
Message-ID: <56AE2674.5060101@redhat.com> (raw)
In-Reply-To: <56AB5C11.1020800@linaro.org>
On 29/01/16 12:33, Kieran Bingham wrote:
> While investigating how to get Python to define the threads presented by > the application layer (in my instance the linux kernel) I found that I > could create threads with a call from Python, (by writing a hook through > the inferior object)
A snippet would be cool to see what you are doing here, if possible.
> However, whilst these threads were added, they were immediately removed > by the next call to (target).to_update_thread_list()
I presume you mean GDB's accounting of them, not the actual threads?
> This has led me to believe I should create a Python Target layer > interface, which I have started, and have been able to register a > target, and provide Python bindings so that (currently _to_thread_name) > calls into the python layer object, and returns a new name. > > My intention is that this can be extended to provide the whole set of > target operations allowing me to implement much of the Linux Kernel > Debugger interface in Python.
At this point, there's just not enough information to form an opinion
of this being a good thing or a bad thing. Do you have an interface in
mind? An API?
> > Through this layer, we can even tackle some of the issues with memory > address spaces, by adding appropriate hooks to adjust MMU context, or > interpret page tables through the relevant target_ops hooks.
Interesting!
> Some of the interface can even hopefully be autogenerated by a > make-target-delegate equivalent
Presume you mean the Python C code/interface?
> Before I head too much further, I wanted to ask the opinions of the > community as to whether this is an acceptable interface to implement, or > if it opens up too much of the GDB internals, to external dependencies.
This is something that is always a balancing act with Python
GDB. There are, as you allude too, some parts of GDB that are not
suitable to be extended to the Python layer, and some parts that while
theoretically OK, need a little work to make safe and accessible in a
Pythonic way.
I can't comment without more details though. My initial reaction
though is yeah, this sounds useful and exciting.
> We could of course tackle this by providing a versioned API which would > allow adaptation in the Python objects, but I thought it was a big > enough question that it should be posed to a wider audience (wider than > just me!)
The versioned API would also need some documenting first.
I ask a few questions here that might provide you with some
additional work! Sorry ;) But I find this an interesting proposal.
Cheers
Phil
next prev parent reply other threads:[~2016-01-31 15:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-29 12:33 Kieran Bingham
2016-01-31 15:21 ` Phil Muldoon [this message]
2016-02-01 18:19 ` Kieran Bingham
2016-02-04 22:16 ` Ales Novak
2016-02-05 16:36 ` Kieran Bingham
2016-02-05 16:38 ` Jeff Mahoney
2016-02-05 16:47 ` Kieran Bingham
2016-02-05 17:06 ` Kieran Bingham
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=56AE2674.5060101@redhat.com \
--to=pmuldoon@redhat.com \
--cc=gdb@sourceware.org \
--cc=kieran.bingham@linaro.org \
--cc=peter.griffin@linaro.org \
--cc=yao.qi@linaro.org \
/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