Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb-patches@sourceware.org
Cc: Phil Muldoon <pmuldoon@redhat.com>
Subject: Re: [PATCH] compile: Use libcc1.so->libcc1.so.0
Date: Thu, 23 Apr 2015 11:42:00 -0000	[thread overview]
Message-ID: <5538DA94.6080704@redhat.com> (raw)
In-Reply-To: <20150421213616.14023.38329.stgit@host1.jankratochvil.net>

On 04/21/2015 10:36 PM, Jan Kratochvil wrote:
> (2) Currently GDB does only dlopen("libcc1.so") and then depending on which
>     libcc1.so version it would find first it would succeed/fail.
>     I guess it is more convenient to do dlopen("libcc1.so.1") instead
>     (where ".1"=".x" corresponds to GCC_FE_VERSION_x).
>     That is this patch (with x=0).

I don't agree with tying the so version with GCC_FE_VERSION.
The so version is supposed to indicate binary compatibility.
And the ABI is maintained as long as the ABI of the single
entry point -- gcc_c_fe_context -- is maintained.

We can bump GCC_C_FE_VERSION_x leaving the .so version alone,
and on the plugin/gcc side, add new functions at the end of
the context vtable, keeping the vtable compatible
with GCC_C_FE_VERSION_0:

/* The type of the initialization function.  The caller passes in the
   desired base version and desired C-specific version.  If the
   request can be satisfied, a compatible gcc_context object will be
                               ^^^^^^^^^^
   returned.  Otherwise, the function returns NULL.  */

typedef struct gcc_c_context *gcc_c_fe_context_function
    (enum gcc_base_api_version,
     enum gcc_c_api_version);

With that, an older gdb that requests GCC_FE_VERSION_0
should still work.  A newer gdb that understands both v1
and v0 can first try GCC_FE_VERSION_1, and if that fails,
try GCC_FE_VERSION_0, etc.

It's that code that does the initialization/handshake
on both ends (gdb/gcc) that should decide which versions
each end supports.  Doesn't have to be a single version.

Thanks,
Pedro Alves


  parent reply	other threads:[~2015-04-23 11:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 21:36 Jan Kratochvil
2015-04-21 21:38 ` mail dup cancel: " Jan Kratochvil
2015-04-22 21:13 ` Phil Muldoon
2015-04-23  5:29   ` Jan Kratochvil
2015-04-23 10:53     ` Phil Muldoon
2015-04-23 11:24       ` Pedro Alves
2015-04-23 11:47       ` Jan Kratochvil
2015-04-23 11:59         ` Pedro Alves
2015-04-23 11:42 ` Pedro Alves [this message]
2015-04-23 11:51   ` Jan Kratochvil
2015-04-23 11:52   ` Jan Kratochvil
2015-04-23 12:07     ` Pedro Alves
2015-04-23 12:24       ` Jan Kratochvil

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=5538DA94.6080704@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=pmuldoon@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