This is the mail archive of the mailing list for the Archer 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: source command for python scripts

El miÃ, 05-11-2008 a las 11:13 -0700, Tom Tromey escribiÃ:
> Tom> (gdb) python execfile('')
> Thiago> I was wondering if it would be useful to have a command in GDB to source
> Thiago> Python scripts, something like "source -p". 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
by default.
Thiago Jung Bauermann
IBM Linux Technology Center

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