[Issue 15631] gdb: Parent's scope not considered for symbol lookup

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 26 05:07:36 UTC 2021


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

--- Comment #7 from hsteoh at quickfur.ath.cx ---
A simpler example with module globals:

--------
import std;
int x = 12345;
void main() {
        writeln(x);
}
--------

Compile with `dmd -g prog.d`.

In gdb:
--------
(gdb) break D main 
Breakpoint 1 at 0xe1b9c: file prog.d, line 4.
(gdb) run
Starting program: /tmp/prog 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, D main () at prog.d:4
4               writeln(x);
(gdb) p x
No symbol "x" in current context.
--------

Expected behaviour: the module global `x` should be known to the debugger and
inspectable from the debugger.

--


More information about the Digitalmars-d-bugs mailing list