From: Jeff Law <law@redhat.com>
To: Tom Tromey <tromey@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 3/5] introduce the binding oracle
Date: Fri, 16 May 2014 19:12:00 -0000 [thread overview]
Message-ID: <5376632D.3000409@redhat.com> (raw)
In-Reply-To: <1400254001-12038-4-git-send-email-tromey@redhat.com>
On 05/16/14 09:26, Tom Tromey wrote:
> gdb wants to supply any declarations that may be referred to by the
> user's code. Hooking into symbol lookup was an efficient way to
> accomplish this.
>
> This patch introducing a "binding oracle" that is consulted whenever a
> symbol binding is looked up for the first time. The oracle is just a
> global function pointer. If it is NULL, no special work is done. It
> is called with the identifier to supply and with an enum argument
> indicating the kind of binding being requested. The oracle can then
> call back into the C front end (via the new functions c_pushtag and
> c_bind) to supply a binding; or it can silently do nothing if the
> request could not be fulfilled.
>
> The code caches Whether the oracle has been called to avoid repeated
> useless queries.
>
> There is a little hack in c_print_identifier to avoid calling the
> binding oracle here. This makes debugging gcc in the presence of the
> plugin remain relatively sane -- without this, calling debug_tree or
> the like can confusingly call into the plugin.
>
> 2014-05-16 Phil Muldoon <pmuldoon@redhat.com>
> Tom Tromey <tromey@redhat.com>
>
> * c-tree.h (enum c_oracle_request): New.
> (c_binding_oracle_function): New typedef.
> (c_binding_oracle, c_pushtag, c_bind): Declare.
> * c-decl.c (c_binding_oracle): New global.
> (I_SYMBOL_CHECKED): New macro.
> (i_symbol_binding): New function.
> (I_SYMBOL_BINDING, I_SYMBOL_DECL): Redefine.
> (I_TAG_CHECKED): New macro.
> (i_tag_binding): New function.
> (I_TAG_BINDING, I_TAG_DECL): Redefine.
> (I_LABEL_CHECKED): New macro.
> (i_label_binding): New function.
> (I_LABEL_BINDING, I_LABEL_DECL): Redefine.
> (c_print_identifier): Save and restore c_binding_oracle.
> (c_pushtag, c_bind): New functions.
> ---
> void
> c_print_identifier (FILE *file, tree node, int indent)
> {
> + void (*save) (enum c_oracle_request, tree identifier);
> +
> + // This makes debugging much more sane.
> + save = c_binding_oracle;
> + c_binding_oracle = NULL;
> +
Just a nit. C-style comment would be appreciated. It might also help
to clarify what "much more sane" really means here.
Otherwise, it looks OK to me.
jeff
next prev parent reply other threads:[~2014-05-16 19:12 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 15:26 [PATCH 0/5] let gdb reuse gcc'c C compiler Tom Tromey
2014-05-16 15:26 ` [PATCH 1/5] export finish_bitfield_layout from stor-layout Tom Tromey
2014-05-16 18:27 ` Jeff Law
2014-05-16 15:27 ` [PATCH 4/5] add gcc/gdb interface files Tom Tromey
2014-05-22 12:52 ` Jeff Law
2014-05-22 13:16 ` Jakub Jelinek
2014-05-22 15:13 ` Jeff Law
2014-06-04 20:39 ` Tom Tromey
2014-06-05 19:23 ` Jeff Law
2014-06-05 19:30 ` Jakub Jelinek
2014-06-06 1:54 ` Tom Tromey
2014-06-06 5:35 ` Jakub Jelinek
2014-06-09 17:09 ` Jeff Law
2014-06-19 20:45 ` Tom Tromey
2014-05-16 15:27 ` [PATCH 2/5] c_diagnostic_ignored_function hack Tom Tromey
2014-05-16 16:05 ` Joseph S. Myers
2014-06-19 20:46 ` Tom Tromey
2014-05-16 18:33 ` Jeff Law
2014-05-16 18:42 ` Tom Tromey
2014-05-16 15:27 ` [PATCH 3/5] introduce the binding oracle Tom Tromey
2014-05-16 19:12 ` Jeff Law [this message]
2014-06-05 15:31 ` Tom Tromey
2014-06-19 20:43 ` Tom Tromey
2014-05-16 16:29 ` [PATCH 0/5] let gdb reuse gcc'c C compiler Mike Stump
2014-05-16 18:48 ` [PATCH 5/5] add libcc1 Tom Tromey
2014-05-16 20:29 ` Joseph S. Myers
2014-05-16 21:03 ` Tom Tromey
2014-06-18 21:07 ` Tom Tromey
2014-06-19 20:47 ` Tom Tromey
2014-05-16 21:36 ` Mike Stump
2014-05-16 22:17 ` Mike Stump
2014-06-05 19:34 ` Tom Tromey
2014-06-05 21:35 ` Mike Stump
2014-06-19 20:52 ` Tom Tromey
2014-06-19 21:45 ` Jakub Jelinek
2014-06-19 22:22 ` Tom Tromey
2014-06-20 3:11 ` Trevor Saunders
2014-06-20 15:34 ` Tom Tromey
2014-06-23 19:09 ` Jeff Law
2014-06-24 3:13 ` Trevor Saunders
2014-06-24 17:12 ` Tom Tromey
2014-06-24 18:10 ` Trevor Saunders
2014-07-18 19:00 ` Tom Tromey
2014-07-31 4:49 ` Jeff Law
2014-07-31 8:15 ` Richard Biener
2014-07-31 10:53 ` Trevor Saunders
2014-07-31 11:28 ` Richard Biener
2014-07-31 15:08 ` Joseph S. Myers
2014-07-31 19:20 ` Tom Tromey
2014-07-31 19:21 ` Jakub Jelinek
2014-07-31 19:51 ` Trevor Saunders
2014-07-31 20:07 ` Tom Tromey
2014-08-01 2:18 ` Trevor Saunders
2014-07-31 21:14 ` Mike Stump
2014-08-04 14:23 ` Tom Tromey
2014-08-05 19:34 ` Tom Tromey
2014-08-08 12:15 ` [PATCH 5/5] add libcc1 [gcc-5/changes.html] Jan Kratochvil
2014-08-31 15:12 ` Gerald Pfeifer
2014-09-14 15:07 ` Manuel López-Ibáñez
2014-09-17 14:14 ` Jan Kratochvil
2014-10-09 9:07 ` [PATCH 5/5] add libcc1 Phil Muldoon
2014-10-09 9:12 ` Jakub Jelinek
2014-10-09 9:18 ` Phil Muldoon
2014-10-10 22:31 ` Jeff Law
2014-10-24 7:43 ` Phil Muldoon
2014-10-24 7:53 ` Jakub Jelinek
2014-10-24 16:47 ` Jeff Law
2014-10-27 20:03 ` Phil Muldoon
2014-10-28 13:29 ` Joseph S. Myers
2014-10-28 18:00 ` Phil Muldoon
2014-10-29 3:32 ` Joseph S. Myers
2014-10-29 10:29 ` Jakub Jelinek
2014-10-29 10:45 ` Paolo Bonzini
2014-10-29 10:58 ` Jakub Jelinek
2014-10-29 10:59 ` Paolo Bonzini
2014-10-29 11:03 ` Jakub Jelinek
2014-10-29 15:00 ` Paolo Bonzini
2014-10-29 11:10 ` Phil Muldoon
2014-10-29 11:42 ` Phil Muldoon
2014-10-30 5:37 ` Jeff Law
2014-06-19 20:42 ` [PATCH 0/5] let gdb reuse gcc'c C compiler Tom Tromey
2014-07-30 16:28 ` Tom Tromey
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=5376632D.3000409@redhat.com \
--to=law@redhat.com \
--cc=gcc-patches@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).