Summary: GDB print strange value
           Product: D
           Version: future
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Mihail Zenkov <> 2010-05-12 14:51:01 
PDT ---
GDB print strange value if source compiled with dmd -g (with dmd -gc it print
correct value).

# cat test.d
import std.stdio: writefln;

int x;

struct STest {
        static int y;

void dummy() {}

int main() {
        x = 11;
        STest.y = 22;
        writefln("x=%d STest.y=%d", x, STest.y);

        return 0;

# dmd -g test.d
# gdb test
GNU gdb (GDB)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /mnt/work/source/dgdb/test1/test...done.
(gdb) break 'test.dummy'
Breakpoint 1 at 0x8049a94: file test.d, line 9.
(gdb) run
Starting program: /mnt/work/source/dgdb/test1/test
[Thread debugging using libthread_db enabled]
x=11 STest.y=22

Breakpoint 1, test.dummy () at test.d:9
9       void dummy() {}
(gdb) p 'test.x'
$1 = 11
(gdb) p 'test.STest.y'
$2 = 11

I also have more complex example that have p 'test.x' incorrect too.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to