This is the mail archive of the
mailing list for the Archer project.
Re: source command for python scripts
El miÃ, 05-11-2008 a las 11:13 -0700, Tom Tromey escribiÃ:
> Tom> (gdb) python execfile('simple.py')
> Thiago> I was wondering if it would be useful to have a command in GDB to source
> Thiago> Python scripts, something like "source -p foo.py". But the command above
> Thiago> is short enough that we wouldn't need a separate command. What do you
> Thiago> think?
> How about the appended? :-)
This is great. I'm surprised I didn't think about implementing a command
in Python. :-)
> * Make it possible to rename existing gdb commands, or have Python
> objects wrap the underlying command structure.
> This would let us write a new "source" (e.g.) in Python that could
> delegate to the old "source" when needed.
I liked this idea.
> For this to work well I think we'd also need to fix the existing gdb
> crash involving redefining commands with aliases.
At least now we have a motivation to fix it. :-)
> * Put interesting commands into a Python module, like gdb.commands.
> Ship a bunch of them with gdb -- but not activated. Then users
> could pick the ones they like:
> python import gdb.commands.PSource
> python import gdb.commands.FancyBacktrace
Good idea. But IMHO the PSource command in particular could be enabled
Thiago Jung Bauermann
IBM Linux Technology Center