From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
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:24:00 -0000 [thread overview]
Message-ID: <383937c5180dc6f6e3f762e45c895563@polymtl.ca> (raw)
In-Reply-To: <735b109f-4ae4-5993-57f0-eb548752fc23@redhat.com>
On 2019-03-07 13:20, Pedro Alves wrote:
> 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.
Yeah, I recalled these discussions, but I couldn't make the pieces fit
in my head...
>> 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
Ok, the key I was missing is that gdb and gnulib are in the same
namespace, so if you call "close", for example, it uses gnulib's close.
Thanks!
Simon
next prev parent reply other threads:[~2019-03-07 18:24 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
2019-03-07 18:24 ` Simon Marchi [this message]
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=383937c5180dc6f6e3f762e45c895563@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=palves@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