This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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: Some feedback about the python scripting feature


On Tue, Nov 10, 2009 at 08:49:18PM +0200, Marcelo Taube wrote:
> Hello,
> >I don't know if it has completion or automatic indentation, because no
> >version of Python I have installed does either :-)  Is this new?
> I am sorry, i guess i was "slightly" wrong.
> The completion is not automatic, someone added it to my working
> environment and i just thought it was part of the default behaiviour.
> But it should be very easy to add to any other environment, i saw
> that the next three lines should do the job:
> 
> >>>import rlcompleter
> >>>import readline
> >>>readline.parse_and_bind("tab: complete")

This "works" in GDB... but it doesn't do anything you want it to do.
It changes the tab completion used by the GDB prompt!  Whoops.

> In spite of that, i still think that the python shell has advantages,
> there is a difference between having direct response to the commands
> executed in python and having to imagine that the syntax is ok till
> you finish writing all the code. Also mixing the history of lines
> insterted in python context and lines inserted in gdb language is
> kind of bothering, they cannot really be reused.

That should work with the command I showed you, at least to some
extent.

-- 
Daniel Jacobowitz
CodeSourcery


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