Lambda type names in debug info

2021-11-11 Thread Mario Demontis via Gcc
Hi all
Using gdb in the following c++ code:

template
struct Wrap{
   T w;
};

int main() {
   auto l1 = [x = 5](int a){return x+a;};
   auto l2 = [x = 6](int a){return x+1;};
   auto l3 = [x = 7](){return 0.5;};
   Wrap w1{l1};
   Wrap w2{l2};
   Wrap w3{l3};
   return 0;
}

(gdb) info types Wrap
All types matching regular expression "Wrap":

File C:\Sandbox\sampleproj\main.cpp:
8:  Wrap >;
8:  Wrap >;

It looks like the debugging information for Wrap and
Wrap are generated with the same name.

Also readelf --debug-dump=info confirms this insight.


This is preventing me to properly analyze the contents of Wrap objects in gdb.

Is there a way to work around this issue?

Kind regards

Mario


Re: Generating GCC Documentation

2021-11-11 Thread Eric Gallager via Gcc
On Wed, Nov 10, 2021 at 9:26 AM Joel Sherrill  wrote:
>
> Thanks for the quick reply.
>
> On Wed, Nov 10, 2021 at 8:20 AM Jonathan Wakely  wrote:
> >
> > On Wed, 10 Nov 2021 at 14:08, Joel Sherrill wrote:
> > >
> > > Hi
> > >
> > > It's been a while since I tried this and it appears things have
> > > changed. I tried to follow the instructions at:
> > >
> > > https://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_hacking.html
> >
> > Are you asking about docs for GCC itself, or libstdc++? Those docs are
> > for the latter only.
>
> I was hoping to build everything including libstdc++.

This is something I've been meaning to work on lately; I recently did
a patch to allow the install-dvi target to work from the top-level,
and was meaning to do likewise for install-man, too... but instead I
ran into bug 102824 first, so I kinda want to get that fixed first:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102824

>
> FYI Google found that page for "generating GCC docs" and I obviously missed
> that it was C++ only. The URL has C++ and the first sentence also says that 
> but
> the section title must be more important to the search.
>
> > > with gcc 11.2 and had a few questions:
> > >
> > > + I did a simple configure --prefix=/tmp/gcc-docs the first time and
> > > then "make html". One of those told me prerequisites were missing so I
> > > downloaded them and then it proceeded to build the compiler before
> > > building the html. Is that expected? Can you build the docs without
> > > building the compiler itself?
> >
> > For libstdc++? Yes, see maintainer-scripts/generate_libstdcxx_web_docs
> >
> > For GCC itself, I am not sure, but
> > maintainer-scripts/update_web_docs_git might help.
>
> Thanks. I'll try those.
>
> > > + I was going through the formats in the order on the document. I
> > > sucessfully built html and pdf. But make man from the top of the build
> > > directory doesn't work.
> > >
> > >  make man
> > > make: *** No rule to make target `man'.  Stop.
> >
> > You seem to be trying to follow the libstdc++ docs in the top-level,
> > that's not going to work.
>
> Gotcha.

IMO it *should* work, though; `make man` is a common Makefile target
that is recognized in some of the subdirectories, which ought to be
made consistent throughout all of them.

>
> > > "make -C gcc install-man" does install some man pages so I'm guessing
> > > something is wrong with the top Makefile.
> >
> > I think you're following the wrong docs.
> >
> > At the top-level, 'make -C gcc doc' works, and so does 'make -C gcc html'
>
> Is there a top-level stanza to generate docs for everything or is just
> a sequence of commands and I need to look at the scripts?
>

I agree that having a top-level `make docs` target (and `make
install-docs` target) that does all of the other documentation targets
would be useful; feel free to open a bug on bugzilla about it, and
I'll confirm it.

> > If you really do want to build the libstdc++ docs, you need to be in
> > the $target/libstdc++-v3/ sub-directory to use the libstdc++ makefile
> > targets.
>
> OK. Plenty to digest.
>
> Thanks.
>
> --joel


gcc-9-20211111 is now available

2021-11-11 Thread GCC Administrator via Gcc
Snapshot gcc-9-2021 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/9-2021/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 9 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch releases/gcc-9 
revision 65c7c67ad6d093b58cb2143003b8ac90fa40d907

You'll find:

 gcc-9-2021.tar.xzComplete GCC

  SHA256=52e27fe2112d253ce12a66a944004c9204a73cada7847c8d9c45d5d63f97d917
  SHA1=2a43390d536b888f9a5ffc4dbfa902e7b7cde839

Diffs from 9-20211104 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-9
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.