This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [python] Make it easier to call into inferior from python when "this" pointer is already available?
- From: Tom Tromey <tromey at redhat dot com>
- To: ppluzhnikov at google dot com (Paul Pluzhnikov)
- Cc: archer at sourceware dot org
- Date: Thu, 18 Dec 2008 15:09:45 -0700
- Subject: Re: [python] Make it easier to call into inferior from python when "this" pointer is already available?
- References: <20081218201123.414423A6B3D@localhost>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
Paul> This works, but is somewhat "unnatural": we already have 'self.val',
Paul> so a more intuitive expression would be something like:
Paul> self.val.parse_and_eval_subexpr("->str()")
Paul> or some such. It would probably also be less work for GDB, since
Paul> Python is already holding a value for part of the evaluation stack.
Paul> Comments?
I think what we want to do is add more methods to Value, and in
particular a way to call inferior functions. So, the above could be
something like:
self.val.call_method('str')
There are probably some other holes in Value.
We also want a way to create expressions, though so far I think this
is mostly useful for a new language implementation, which isn't on my
near-term to-do list. One fun idea here is that we can give
Expression the same API as Value. Then you can write generic code
that either directly computes a value, or that creates the expression
to compute the value, depending on what you pass it. Or is that too
wacky?
Tom