From: Pierre-Marie de Rodat <derodat@adacore.com>
To: GDB <gdb@sourceware.org>
Subject: Re: Pretty-printers auto-loading and static libraries
Date: Mon, 19 Jan 2015 15:02:00 -0000 [thread overview]
Message-ID: <54BD1C99.20005@adacore.com> (raw)
In-Reply-To: <54B53450.5090007@adacore.com>
On 01/13/2015 04:05 PM, Pierre-Marie de Rodat wrote:
> I guess my pretty-printers should be temptatively loaded when the
> new_objfile event is triggered: if the corresponding Objfile defines an
> "adainit" symbol they should be registered in it. Unfortunately I failed
> so far to implement this behavior: Objfile do not expose the
> corresponding symbol table and Symtab_and_line instances don't even
> enable one to perform symbol lookups.
I dived into the Python API documentation with a fresh mind:
- gdb.lookup_global_symbol returns Symbol instances;
- Symbol instances have a symtab attribute;
- Symtab instances have an objfile attribute.
So it is actually possible to register pretty-printers depending on the
presence of a symbol! I tried it with my setups and it works properly. :-)
Still to be determined: I don't know if performing a global symbol
lookup at each objfile load is acceptable from a performance point of view.
--
Pierre-Marie de Rodat
next prev parent reply other threads:[~2015-01-19 15:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 15:05 Pierre-Marie de Rodat
[not found] ` <201501140221.t0E2LeCl028119@new.toad.com>
2015-01-14 9:29 ` Pierre-Marie de Rodat
2015-01-19 15:02 ` Pierre-Marie de Rodat [this message]
[not found] ` <CAP9bCMTKi6zZCcNaXiYmvVqNbGSam1ovN8-BpjTjL_5+kbQyVg@mail.gmail.com>
2015-02-03 14:51 ` Pierre-Marie de Rodat
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=54BD1C99.20005@adacore.com \
--to=derodat@adacore.com \
--cc=gdb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).