D on Visual Studio?

Martin Fuchs martin-fuchs at gmx.net
Wed Sep 12 04:38:23 PDT 2007


> the debug information and the debugger are fine. it's the frontend that
> doesn't display the debugger's output correctly. if in doubt, try using
> ddbg from the command line.

Sorry, if I have to disappoint you. Please try to debug this simple test 
program:

import std.stdio;
import pi;

int main(char[][] args)
{
    char s[] = "test 123";

    writefln("string value before truncate: %s\n", s);

    s.length = 2;

    writefln("string value after truncate: %s\n", s);

    return 0;
}

When displaying the value of the 's'-variable, the debugger just prints 
"18401976358273026" instead of the string content. It seems it handles 
pointer/array values as values of type "ulong" and only displays the memory 
address. This is all the same in Eclipse/descent, in Code::Blocks and on the 
command line using ddbg.exe.
The same problem applies not only to strings, but also for example to int[] 
arrays. For example look at the "pi.d" example code and try to display the 
'p' and 't' array contents in the debugger.





More information about the Digitalmars-d mailing list