From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/python:2/2] First script in GDB python library - command/pahole.py
Date: Fri, 28 May 2010 01:34:00 -0000 [thread overview]
Message-ID: <20100528001820.GL3019@adacore.com> (raw)
In-Reply-To: <m3aarlf5n7.fsf@fleche.redhat.com>
> 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".
That's what I did to test the code, and I thought that this was OK.
In my mind, I was not suggesting the addition of a new command, but
rather of a new script. The distinction is really subtle but it makes
the "python import ..." command the natural way to use that script.
But the ulterior motive is not about the pahole command, but rather
about getting things started in terms of the gdb python library.
I think it would be nice to indeed have a better way of activating
these commands. But in the meantime, I thought that this would already
be enough of an improvement to be worthwhile on its own. We could work
on the activation as a separate patch?
> 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.
I tend to agree that it's not ideal to just import every gdb.command.*
module at startup. It seems like a nice idea
In terms of documentation, I agree we need to write something up.
I can take care of that:
- Document the location where the GDB scripts are;
- Add a section where we document new commands implemented
in python.
--
Joel
next prev parent reply other threads:[~2010-05-28 0:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 0:09 Add support for the GDB Python Library Joel Brobecker
2010-05-27 0:09 ` [RFA/python:2/2] First script in GDB python library - command/pahole.py Joel Brobecker
2010-05-27 20:37 ` Tom Tromey
2010-05-28 1:34 ` Joel Brobecker [this message]
2010-06-03 0:11 ` Joel Brobecker
2010-06-03 6:28 ` Doug Evans
2010-06-03 15:35 ` Joel Brobecker
2010-07-11 18:49 ` Tom Tromey
2010-05-27 0:25 ` [RFA/python:1/2] Add support for --with-pythondir Joel Brobecker
2010-05-27 6:49 ` Doug Evans
2010-05-27 20:32 ` Tom Tromey
2010-05-28 9:55 ` Doug Evans
2010-05-28 17:20 ` Joel Brobecker
2010-05-30 17:10 ` Doug Evans
2010-06-01 20:15 ` Joel Brobecker
2010-06-01 20:39 ` Doug Evans
2010-06-01 20:53 ` Joel Brobecker
2010-05-27 1:54 ` Add support for the GDB Python Library Doug Evans
2010-05-27 3:42 ` Doug Evans
2010-05-27 15:17 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100528001820.GL3019@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox