From: Luis Machado <lgustavo@codesourcery.com>
To: Pedro Alves <palves@redhat.com>, Eli Zaretskii <eliz@gnu.org>,
Joel Brobecker <brobecker@adacore.com>
Cc: <markus.t.metzger@intel.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/3] Introduce gdb::unique_ptr
Date: Tue, 11 Oct 2016 17:15:00 -0000 [thread overview]
Message-ID: <4bdcd06e-1324-db5b-2c49-941a7dcfaed6@codesourcery.com> (raw)
In-Reply-To: <d603f6d2-a541-ebdc-9f56-e02af19ec6b2@redhat.com>
On 10/11/2016 11:24 AM, Pedro Alves wrote:
> On 10/11/2016 04:16 PM, Eli Zaretskii wrote:
>
>> IMO, requiring to build GCC as a prerequisite for building GDB is a
>> major setback. Building GDB is a relatively easy and straightforward
>> task today, even a native MS-Windows build. By contrast, building GCC
>> requires quite a few additional prerequisites, which will also need to
>> be built correctly. It also requires to configure the GCC being built
>> itself, which involves considering a large number of opt-in and
>> opt-out features, whose descriptions are not well suited for casual
>> users, and therefore whose consequences cannot be easily understood.
>
> Windows may be one of the hardest systems on which to build GCC.
> For Unix systems, it's relatively painless. It's easy to find scripts
> around the web that download the necessary dependencies and build gcc,
> all in one go. I think the GCC source tree has contrib patches for
> at least the downloading part.
>
>> Yes, I use GCC, of course, but I just upgraded to 5.3.0 here a few
>> months ago, while you seem to be already talking about 6.x. If we
>> start on this slippery slope, I can easily envision the requirement to
>> go up to 7.x very soon, exactly like switching to C++-compatible GDB
>> caused, within just few months,
>
> That's a misunderstanding. Full C++11 support is available
> in gcc 4.8 already. I believe it's easy to find binary mingw
> gcc's of (at least) that vintage easily, for both mingw and mingw-64.
>
> mingw talks about gcc 4.8 binaries here:
>
> http://www.mingw.org/wiki/howto_install_the_mingw_gcc_compiler_suite
>
> I don't expect anyone to _have_ to build any mingw compiler to be able
> to build gdb for mingw.
>
> It's just that gcc 6.x is the first version that has switched
> the _default_ mode for C++ to -std=gnu++14. So until someone writes a
> patch that make gdb's build system enable C++11 support with gcc < 6,
> then the C++11-only code in the gdb::unique_ptr patch that I'm proposing
> will only be active with gcc 6.1 onward. But really I'm not
> proposing to _require_ 6.x at all.
>
>> a massive rewrite of GDB in complex C++.
>
> Most of the changes have been around using std::string, destructors,
> and RAII, which are basic everyday C++ things. The latter two are
> mainly about using compiler support for things we have to manually
> today (make_cleanup). std::string just makes code shorter and safer,
> I don't see a real downside or anything complex about it.
>
> A few patches that build supporting widgets will naturally use a
> bit more complex C++ internally, all in the name of making _users_ of
> such widgets significantly simpler. This patch is one such example.
> These kinds of support patches naturally will need to come
> before we can make use of the features they add support for, so
> while it may appear we're going to keep adding lots of magic
> things, I don't think that's true.
Maybe this should be discussed in gdb@, but...
Some of Eli's points resonate with me. It seems we just recently got the
C++ compatibility sorted out and we're quickly moving on to try and
C++-ify what we can with no clear goal, priority list or high level
picture. So, just to make it C++ now that we require a C++ compiler.
I thought i'd throw this question out there. Wasn't the goal of moving
to C++ to help the implementation of features that were hard to
implement with C like some of the Fortran bits with dynamic arrays? Also
improve the poor experience with C++ debugging?
I was asking myself, this week, if GCC went through such a big
C++-ification effort when they moved away from C.
Another point i worry about is that we will switch the focus, at least
for a few months, to C++-ifying things "just because" instead of taking
the opportunity of such a big change to review bits of GDB that need to
be redesigned/dropped/go away. Maybe just converting existing things to
C++ is not the right answer, even though it is fun to do and will
provide enough hacking fun?
I have another point about whether this will stimulate more contributors
to send patches to GDB or not, but that's enough rambling for now. :-)
next prev parent reply other threads:[~2016-10-11 17:15 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-10 16:46 [PATCH 0/3] More cleanup elimination / gdb::unique_ptr Pedro Alves
2016-10-10 16:46 ` [PATCH 3/3] 'struct parse_expression *' -> gdb::unique_ptr<expression> Pedro Alves
2016-10-10 16:46 ` [PATCH 1/3] Introduce gdb::unique_ptr Pedro Alves
2016-10-10 17:49 ` Simon Marchi
2016-10-10 18:03 ` Pedro Alves
2016-10-11 6:48 ` Metzger, Markus T
2016-10-11 10:23 ` Pedro Alves
2016-10-11 10:53 ` Andreas Schwab
2016-10-11 11:17 ` Metzger, Markus T
2016-10-11 11:43 ` Pedro Alves
2016-10-11 13:58 ` Yao Qi
2016-10-11 14:05 ` Trevor Saunders
2016-10-11 12:16 ` Joel Brobecker
2016-10-11 13:46 ` Pedro Alves
2016-10-11 14:47 ` Joel Brobecker
2016-10-11 15:17 ` Eli Zaretskii
2016-10-11 16:24 ` Pedro Alves
2016-10-11 16:58 ` Eli Zaretskii
2016-10-11 17:41 ` Pedro Alves
2016-10-11 18:37 ` Eli Zaretskii
2016-10-11 19:19 ` Pedro Alves
2016-10-11 20:47 ` Eli Zaretskii
2016-10-11 21:32 ` Pedro Alves
2016-10-12 6:34 ` Eli Zaretskii
2016-10-12 8:11 ` Metzger, Markus T
2016-10-12 9:31 ` Eli Zaretskii
2016-10-12 10:12 ` Pedro Alves
2016-10-12 11:05 ` Eli Zaretskii
2016-10-12 11:25 ` Pedro Alves
2016-10-12 11:45 ` Eli Zaretskii
2016-10-13 12:12 ` Pedro Alves
2016-10-12 10:28 ` Pedro Alves
2016-10-12 11:07 ` Eli Zaretskii
2016-10-12 11:19 ` Pedro Alves
2016-10-12 11:41 ` Eli Zaretskii
2016-10-12 11:55 ` Pedro Alves
2016-10-13 0:38 ` [PATCH] Enable C++11 starting with gcc 4.8 (was: Re: [PATCH 1/3] Introduce gdb::unique_ptr) Pedro Alves
2016-10-13 0:45 ` [PATCH 1/2] gdb: Import AX_CXX_COMPILE_STDCXX from the GNU Autoconf Archive Pedro Alves
2016-10-13 0:45 ` [PATCH 2/2] gdb: Enable C++11 if available Pedro Alves
2016-10-12 9:37 ` [PATCH 1/3] Introduce gdb::unique_ptr Pedro Alves
2016-10-12 10:51 ` Eli Zaretskii
2016-10-12 11:15 ` Pedro Alves
2016-10-12 11:40 ` Eli Zaretskii
2016-10-12 11:45 ` Jan Kratochvil
2016-10-12 11:56 ` Luis Machado
2016-10-12 12:03 ` Eli Zaretskii
2016-10-13 9:07 ` Jan Kratochvil
2016-10-13 10:07 ` Eli Zaretskii
2016-10-13 10:27 ` Pedro Alves
2016-10-13 13:22 ` Eli Zaretskii
2016-10-13 13:36 ` Pedro Alves
2016-10-13 13:59 ` Eli Zaretskii
2016-10-13 14:04 ` Pedro Alves
2016-10-13 15:06 ` Joel Brobecker
2016-10-13 10:46 ` Jan Kratochvil
2016-10-13 11:15 ` Pedro Alves
2016-10-13 13:28 ` Eli Zaretskii
2016-10-13 13:42 ` Pedro Alves
2016-10-13 14:07 ` Eli Zaretskii
2016-10-11 19:23 ` Simon Marchi
2016-10-11 20:54 ` Eli Zaretskii
2016-10-11 21:28 ` Simon Marchi
2016-10-12 6:23 ` Eli Zaretskii
2016-10-11 21:16 ` Jan Kratochvil
2016-10-11 17:15 ` Luis Machado [this message]
2016-10-11 18:21 ` Pedro Alves
2016-10-10 16:58 ` [PATCH 0/3] More cleanup elimination / gdb::unique_ptr Pedro Alves
2016-10-16 7:05 ` Tom Tromey
2016-10-17 13:57 ` Pedro Alves
2016-10-17 14:07 ` Tom Tromey
2016-10-17 14:59 ` Pedro Alves
2016-10-20 13:46 ` Pedro Alves
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=4bdcd06e-1324-db5b-2c49-941a7dcfaed6@codesourcery.com \
--to=lgustavo@codesourcery.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=markus.t.metzger@intel.com \
--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