Re: [RFA][patch 1/9] Yet another respin of the patch with initial Python support

Tom Tromey
2008-07-26T18:45:08Z

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

>> The "define" command creates new user-defined commands, which are
>> sequences of gdb commands.
>>
>> The python command accesses the python interpreter. It is not really
>> useful unless you already know python and want to use gdb's python
>> api. So, it has a much narrower audience.

Eli> But the goal is the same: create user-defined commands, isn't it? Or
Eli> is there something else?

There's a distinction to be aware of here ... what we have and what is
planned are not identical. So, for instance, with the current patch
under consideration, you really cannot do much at all with python.

Future (existing ones in this series) patches add a lot of different
features. Adding new commands is one of them. However, there is a
lot more. For instance, you will be able to write new "gdb-side"
functions in Python; this is related to exprsseion evaluation, not new
commands. And, you will be able to script gdb in any number of ways.

Some of the immediate things will not be visible as user commands.
For example, pretty-printing will not be exposed that way. It will be
part of the "print" command (or just automatic in the MI case).
However, library authors and the like will be able to write new
pretty-printers; for this they will need to read gdb's python api
documentation.

Long term I want to make it possible to fully script gdb. In
particular I want to be able to start a python script with
"#!/usr/bin/gdb" and have it completely control execution.

Tom