www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15631] New: gdb: Parent's scope not considered for symbol

https://issues.dlang.org/show_bug.cgi?id=15631

          Issue ID: 15631
           Summary: gdb: Parent's scope not considered for symbol lookup
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: pro.mathias.lang gmail.com
                CC: ibuclaw gdcproject.org

Tested with 'GNU gdb (GDB) 7.10.1' (latest release) + DMD
2.069-but-really-2.070.

Using the following code:
```
class Base { int value; }
class Derivative : Base
{
    int derived_value;
    void foo () { assert(value == 0); assert(derived_value == 0); }
}

void main ()
{
    auto d = new Derivative();
    d.foo;
}
```

and compiling with DMD:
```
Breakpoint 1, gdb_scope.Derivative.foo() (this=0x7ffff7ec3000) at gdb_scope.d:5
5        void foo () { assert(value == 0); assert(derived_value == 0); }
(gdb) p value
No symbol "value" in current context.
(gdb) p *this
$1 = {derived_value = 0}
```

This issue makes it quite complex to trace DMD using gdb, unless DMD is
compiled with GDC.

--
Jan 30