D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1455 - gdb: DMD does not generate debug info for class and struct members
Summary: gdb: DMD does not generate debug info for class and struct members
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 regression
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2007-08-30 01:41 UTC by Cristi Vlasceanu
Modified: 2014-02-14 20:35 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Cristi Vlasceanu 2007-08-30 01:41:20 UTC
Compile the program below with dmd -debug -g, and step inside Bobo::coco and Foo::coco respectively, using either GDB or ZeroBUGS.

The struct / classes are shown as opaque (GDC generates the correct information).

import std.stdio;

struct Bobo
{
    int a;

    void coco()
    {
        writefln("Bobo::coco");
        a += 1;
    }
};


class Foo
{
    int a;

    void coco()
    {
        writefln("Foo::coco");
        a += 1;
    }
};

void main()
{
    Bobo b;
    b.coco();

    Foo i = new Foo;
    i.coco();
}
Comment 1 Leandro Lucarella 2009-10-12 14:23:52 UTC
I can confirm this is still present in DMD 2.034 (DMD 1.049 works fine), at least using GDB 7.0 (with D patches) and -gc compiler flag (-g is known to be broken when using GDB).
Comment 2 Leandro Lucarella 2009-10-12 16:33:32 UTC
Woops, forgot the -gc flag. The test can't be explored because of the bug 1079, but removing the "import std.stdio" and the calls to writefln() I can see the struct Bobo and class Foo members without any problems, so I'm closing this bug.