Re: [committed][gdb/testsuite] Update psym-external-decl.exp for gcc-10/clang

Gary Benson
2020-07-03T09:21:21Z

Tom de Vries wrote:
> On 6/29/20 2:32 PM, Pedro Alves wrote:
> > On 6/28/20 11:50 AM, Tom de Vries wrote:
> > > I think the following is a good way of dealing with this.
> > >
> > > We introduce a proc in gdb.exp called debug_info_for_decl or
> > > some such, that returns false by default for clang.
> >
> > I think it would be useful to include an intro description to
> >
> > gdb.base/psym-external-decl.exp
> >
> > since it currently doesn't describe what it is testing. Looking
> > at the commit log of the patch that introduced it helps, but
> > one shouldn't have to do that.
> >
> > So the difference between gcc and clang AFAIU is that gcc emits
> > debug info for the extern variable declaration (and with newer GCCs,
> > only if there's a reference to the variable in the CU, otherwise
> > not even so), while seemingly clang would only emit debug info for
> > the variable's definition, which isn't compiled with -g, so we
> > end up with no debug info for the variable.
> >
> > I would suggest filing a bug with clang, to confirm whether
> > this is intentional, or whether they see it as a bug. I would
> > think it is a bug, but I'm not sure. If indeed a bug, we would
> > XFAIL the test.
>
> I've filed https://bugs.llvm.org/show_bug.cgi?id=46514 .
>
> Thanks,
> - Tom

Thank for filing it Tom.

Cheers,
Gary

--
Gary Benson - he / him / his
Principal Software Engineer, Red Hat