From: Tom Tromey <tromey@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: Python pretty-printing [5/6]
Date: Thu, 09 Apr 2009 16:16:00 -0000 [thread overview]
Message-ID: <m3vdpdvm3u.fsf@fleche.redhat.com> (raw)
In-Reply-To: <83prfm46rv.fsf@gnu.org> (Eli Zaretskii's message of "Thu\, 09 Apr 2009 10\:37\:24 +0300")
Eli> I couldn't quite understand the importance of the version numbers, and
Eli> how that would allow GDB to have multiple versions of the same
Eli> pretty-printer. I asked myself how the ``right'' version will be
Eli> selected in that case. Is the way this works documented somewhere
Eli> else? if so, a cross-reference here would be good. If not, I think we
Eli> need to say a few words about that.
I modified a couple of paragraphs; the text now reads:
We recommend that you put your core pretty-printers into a Python
package. If your pretty-printers are for use with a library, we
further recommend embedding a version number into the package name.
This practice will enable @value{GDBN} to load multiple versions of
your pretty-printers at the same time, because they will have
different names).
You should write auto-loaded code (@pxref{Auto-loading}) such that it
can be evaluated multiple times without changing its meaning. An
ideal auto-load file will consist solely of @code{import}s of your
printer modules, followed by a call to a register pretty-printers with
the current objfile.
Taken as a whole, this approach will scale nicely to multiple
inferiors, each potentially using a different library version.
Embedding a version number in the Python package name will ensure that
@value{GDBN} is able to load both sets of printers simultaneously.
Then, because the search for pretty-printers is done by objfile, and
because your auto-loaded code took care to register your library's
printers with a specific objfile, @value{GDBN} will find the correct
printers for the specific version of the library used by each
inferior.
To continue the @code{std::string} example (@pxref{Pretty Printing}),
this code might appear in @code{gdb.libstdcxx.v6}:
@smallexample
[...]
>> +You should write auto-loaded code such that it can be evaluated
>> +multiple times without changing its meaning.
Eli> Here, I suggest a cross-reference to where auto-loading is described.
I added this.
Tom
next prev parent reply other threads:[~2009-04-09 16:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-02 20:57 Tom Tromey
2009-04-03 15:29 ` Eli Zaretskii
2009-04-09 0:29 ` Tom Tromey
2009-04-04 16:39 ` Thiago Jung Bauermann
2009-04-09 0:52 ` Tom Tromey
2009-04-09 15:00 ` Thiago Jung Bauermann
2009-04-09 15:19 ` Phil Muldoon
2009-04-09 15:41 ` Thiago Jung Bauermann
2009-04-09 16:18 ` Tom Tromey
2009-04-09 15:44 ` Tom Tromey
2009-04-09 19:37 ` Tom Tromey
2009-04-09 22:09 ` Thiago Jung Bauermann
2009-04-09 22:36 ` Tom Tromey
2009-04-07 18:32 ` Joel Brobecker
2009-04-07 18:41 ` Tom Tromey
2009-04-07 20:38 ` Joel Brobecker
2009-04-09 1:08 ` Tom Tromey
2009-04-09 7:40 ` Eli Zaretskii
2009-04-09 16:16 ` Tom Tromey [this message]
2009-04-09 16:41 ` Eli Zaretskii
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=m3vdpdvm3u.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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