This is the mail archive of the gdb-patches@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: [RFA/python:2/2] First script in GDB python library - command/pahole.py


>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> This patch makes use of the work done in the previous patch that allows
Joel> to store the GDB python library at a global location.  It updates the
Joel> Makefile.in, adding install-python and uninstall-python targets. And
Joel> it also introduces the first script in the GDB python library: pahole.py.

Today I remembered the other reasons we haven't upstreamed any of the
new commands written in Python :-(

There is no sensible way for a user to activate such a command.  With
this patch a user would have to know the name of the command's file and
invoke "python import gdb.command.pahole".

On the branch we have this "require" system so that users can write
"require command pahole" (with completion!).  But that was just a kind
of experiment, I don't think it is a very good idea.

One idea would be to allow some kind of auto-loading when a command is
not found.  That is, load pahole.py the first time the "pahole" command
is used.  Or even better, scan the install tree first so that command
completion still works.  (This is not ideal, though, since there is not
actually a way to discover command names without loading the file.)

FWIW I did not want to load all the commands at startup, as I was
concerned about slowing down startup.


Also there is the documentation issue.  If we ship a command then it
seems like we are giving it an official stamp, and it ought to be
documented in the manual.


I realize this is a lot of problems to solve.  The command activation
solution is one that would also be useful to users, since (ideally) it
would let them install local commands alongside built-in ones.

Tom


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