Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
Subject: Re: MinGW build failure for GDB 8.2.90 with source-highlight
Date: Thu, 07 Mar 2019 18:20:00 -0000	[thread overview]
Message-ID: <735b109f-4ae4-5993-57f0-eb548752fc23@redhat.com> (raw)
In-Reply-To: <353a11fc68f77c293d7b706586b06724@polymtl.ca>

On 03/07/2019 06:09 PM, Simon Marchi wrote:
> On 2019-03-07 12:11, Pedro Alves wrote:
>> On 03/07/2019 04:59 PM, Simon Marchi wrote:
>>
>>> I don't recall what's the long term solution for this.  We could use gnulib's namespace support [2], but the disadvantage is that we would need to use gnulib::some_function (assuming we name the namespace "gnulib") instead of just some_function to use the "fixed" version.  If we use some_function directly, it will use the buggy version on those systems where it is buggy.
>>
>> Wrap all of gdb in a namespace.  Recall that this was what led to C++
>> wildmatching support.
> 
> I don't understand how this will help.

Sorry, I thought the reference would make you recall
the previous discussions.  See below.

> If you have
> 
> #define open rpl_open
> 
> namespace gdb {
>   struct target_ops {
>     void open();
>   }
> }
> 
> The macro will still wrongfully replace open.

See slides #16-#17 of my Cauldron 2017 presentation:

 https://gcc.gnu.org/wiki/cauldron2017?action=AttachFile&do=view&target=gdb+-+C%2B%2B+conversion+%26+dogfood.pdf

The idea is to put all of gdb under "namespace gdb", and also put
gnulib in the same namespace, using gnulib's namespace support.
That way, there are no macros, and, the code looks just like it
does today, except for the "namespace gdb" wrapping.

Prototyped here:
 https://github.com/palves/gdb/commits/palves/cxx-gdb-namespace

Thanks,
Pedro Alves


  reply	other threads:[~2019-03-07 18:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 14:36 Eli Zaretskii
2019-03-07 16:59 ` Simon Marchi
2019-03-07 17:11   ` Pedro Alves
2019-03-07 18:09     ` Simon Marchi
2019-03-07 18:20       ` Pedro Alves [this message]
2019-03-07 18:24         ` Simon Marchi
2019-03-07 20:29         ` Eli Zaretskii
2019-03-07 20:13   ` Eli Zaretskii
2019-03-11 14:18 ` Eli Zaretskii
2019-03-12  2:31   ` Simon Marchi
2019-03-12 10:52     ` Pedro Alves
2019-03-12 13:43       ` Simon Marchi
2019-03-12 15:49     ` Eli Zaretskii
2019-03-12 16:29       ` Simon Marchi
2019-03-12 17:53         ` 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=735b109f-4ae4-5993-57f0-eb548752fc23@redhat.com \
    --to=palves@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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