This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: repo to work on python scripting support
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Paul> The goal of supporting Python scripting should be to provide an
Paul> environment that is familiar to Python programmers. That means
Paul> passing arguments in the way Python normally does.
Tom> I think we're misunderstanding each other somehow. This
Tom> particular sub-discussion is just about how to parse arguments
Tom> passed from the gdb CLI into Python.
I interpreted it that way. My point is that I'd say "a call is a
call" -- this case is no different from any other Python call. And
that fits the Python model, where interactions with the interpreter
(at the >>> prompt) look just like program code. In particular, there
is no difference in the way call arguments are handled.
Tom> The Python code people write and plug into gdb will just be
Tom> plain old Python. Fetching data from gdb will look Pythonic.
Tom> Longer term, I'd like to be able to fully control gdb from
Tom> Python.
Sounds good.
On the earlier note:
Daniel> print $(py "this is a python \"program\"")
Tom> I was thinking some functions could ask for an uninterpreted
Tom> string.
Tom> print $(py do something in python)
I like that. Quoting in strings would be a major hassle, especially
if the Python code contains raw strings or block (triple quote)
strings. Parentheses should work fine given that those have to
match. The only difficulty is that you have to know at least some of
Python's syntax to find the matching close paren. (Basically, the
scanner would have to know about comments and about the various
flavors of Python strings.)
paul