This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c++/19406
On Mon, Feb 21, 2005 at 09:59:38AM -0500, Jakub Jelinek wrote:
> On Fri, Feb 11, 2005 at 04:11:30PM -0500, Jason Merrill wrote:
> > >> > Basically, I think it's wrong to try to emit just one field of a class.
> > >> > If we need a field for some reason, then we need the entire class to put
> > >> > it in proper context.
> > >>
> > >> The idea of this optimization is that we will emit the entire class in some
> > >> file, but in others just emit enough of a husk to emit the defined member.
> > >> This husk is marked incomplete, so the debugger knows to look elsewhere for
> > >> the full definition of the class.
> > >
> > > But do any debuggers actually handle this? I don't think GDB will.
> >
> > My impression was that GDB handled it fine. This optimization was
> > non-controversial when it went in.
>
> With a.C:
> struct A
> {
> virtual int foo();
> double d, e, f;
> };
>
> struct B : public A
> {
> A::d;
> };
>
> B b;
>
> int main ()
> {
> }
>
> and b.C:
> struct A
> {
> virtual int foo();
> double d, e, f;
> };
>
> int A::foo () { }
>
> and my http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01115.html
> patch GDB knows that A has d, e and f fields, where they are located etc.,
> although a.o contains only:
Thanks for checking! Yeah, I came across the code for this in GDB last
week. GDB will not create type entries for any type with
DW_AT_declaration set, just use it to resolve DIE references.
--
Daniel Jacobowitz
CodeSourcery, LLC