public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Enze Li <enze.li@hotmail.com>
To: Christopher Di Bella <cjdb@google.com>
Cc: gdb-patches@sourceware.org, manojgupta@google.com
Subject: Re: [PATCH] [PATCH] [gdb] adds `<iterator>` to list of includes
Date: Sat, 09 Jul 2022 12:30:10 +0800	[thread overview]
Message-ID: <OS3P286MB21523D4CC8D9C21785CC2BF2F0859@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAKCW6pvyqGjFwLXSa-1k22LUezy9X7DRvJGHHysNxk3SdP2-_A@mail.gmail.com>

Hi Christopher,

Unfortunately, since I don't have a ChromeBook, I can not reproduce the
problem you encountered.

I tried to reproduce your problem on a x86_64-linux device and still
did not reproduce it with the trunk.  After digging into this deeply, I
found that 'gdb/value.c' has already includes the 'vector' header file
after preprocessing.

Here's what I got,

value.c
  |--defs.h
      |--common-defs.h
          |--common-utils.h (#include <vector>)

Finally, I noticed that you were compiling gdb-9.2.  I know nothing
about the maintenance of closed branch.  You may want to keep PING and
maintainers would show up to look at this.

Thanks,
Enze

On Fri, 2022-07-01 at 14:50 -0700, Christopher Di Bella wrote:
> Hi Enze,
> 
> `std::back_inserter` is defined in <iterator>, which isn't included
> in `gdb/value.c`. Because the C preprocessor imports headers by
> copy/pasting the contents at the `#include` site, this means that
> another standard library header is exposing it (presumably
> `<algorithm>`).
> 
> We experienced this on ChromeOS, which uses Clang and libc++ to build
> things.
> 
> ```
> /tmp/portage/sys-devel/gdb-9.2.20200923-r7/work/gdb-
> 9.2/gdb/value.c:1648:52: error: no member named 'back_inserter' in
> namespace 'std'
>        std::move (iter + 1, all_values.end (), std::back_inserter
> (result));
>                                                ~~~~~^
>  1 error generated.
> ```
> 
> On Fri, 1 Jul 2022 at 06:45, Enze Li <enze.li@hotmail.com> wrote:
> > On Tue, 2022-06-28 at 01:04 +0000, Christopher Di Bella via Gdb-
> > patches
> > wrote:
> > > `std::back_inserter` is defined in `<iterator>`, which is
> > > currently
> > > being transitively included by one of the other headers. This is
> > > causing
> > > gdb to fail to build on certain platforms, which is fixed by
> > > explicitly
> > > including it.
> > 
> > Hi Christopher,
> > 
> > I didn't get your point through the commit message.  Can you
> > clarify
> > exactly on which platforms, and what build error you encountered? 
> > So
> > that I can reproduce the issue.
> > 
> > Thanks,
> > Enze
> > 
> > 
> > > ---
> > >  gdb/value.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/gdb/value.c b/gdb/value.c
> > > index 022fca91a42..ba7ae1a0e18 100644
> > > --- a/gdb/value.c
> > > +++ b/gdb/value.c
> > > @@ -40,6 +40,7 @@
> > >  #include "cp-abi.h"
> > >  #include "user-regs.h"
> > >  #include <algorithm>
> > > +#include <iterator>
> > >  #include "completer.h"
> > >  #include "gdbsupport/selftest.h"
> > >  #include "gdbsupport/array-view.h"
> > 
> 
> 


  reply	other threads:[~2022-07-09  4:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  1:04 Christopher Di Bella
2022-07-01 13:45 ` Enze Li
2022-07-01 21:50   ` Christopher Di Bella
2022-07-09  4:30     ` Enze Li [this message]
2022-07-09  5:57       ` Manoj Gupta
2022-07-09  8:54         ` Enze Li
2022-07-10 18:52           ` Simon Marchi
2022-07-16 12:38             ` Enze Li
2022-07-09  9:10 ` Andrew Burgess

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=OS3P286MB21523D4CC8D9C21785CC2BF2F0859@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM \
    --to=enze.li@hotmail.com \
    --cc=cjdb@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=manojgupta@google.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).