View mode: basic / threaded / horizontal-split · Log in · Help
September 12, 2007
Re: D on Visual Studio?
> There is DDBG that works under code blocks. Most of item a is available 
> and much of item b is there but not integrated (expression work but aren't 
> available from the IDE, watches don't work etc.)
>
> There is room for improvment but it's a start

Well, I tried Code::Blocks and the DDBG integration with the current 
development snapshot.
First of all I must say, I had some hassles setting up the environment to 
build and debug a test program:

- There was missing the -g linker option in the default debug settings of 
Code::Blocks.

- To configure the debugger I had to specify the GDB wrapper script 
"ddbg_gdb.bat" instead of "ddbg.exe" itself in code block's toolchain 
configuration.


OK, now I can build D programs and launch thd ddbg debugger in Code::Blocks.
But what I am still missing is:

You can't see the contents of all varaiables. For example it isn't even 
possible to display strings and array variables in the watch window.
This is what I described in my initial post. So again: What exactly is the 
problem - Is there only missing some extension to display complex types in 
the debugger or is the information completely missing in the debug 
information generated by the compiler? If it's only a debugger display 
program, it's only a matter of time when the goal will be reached. In the 
second case it might require a completely new debug info format. So the 
compiler *and* the debugger would require some rewrite.
September 12, 2007
Re: D on Visual Studio?
Martin Fuchs wrote:
> OK, now I can build D programs and launch thd ddbg debugger in Code::Blocks.
> But what I am still missing is:
> 
> You can't see the contents of all varaiables. For example it isn't even 
> possible to display strings and array variables in the watch window.

i don't know about the latest codeblocks version but it used to work.
codeblocks has a hand full of bugs in the display of watch variables.
you can try other frontends for ddbg if codeblocks doesn't work properly.

> This is what I described in my initial post. So again: What exactly is the 
> problem - Is there only missing some extension to display complex types in 
> the debugger or is the information completely missing in the debug 
> information generated by the compiler? If it's only a debugger display 
> program, it's only a matter of time when the goal will be reached. In the 
> second case it might require a completely new debug info format. So the 
> compiler *and* the debugger would require some rewrite. 

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.
September 12, 2007
Re: D on Visual Studio?
As Robert Fraser said, you should try Descent. It displays the contents 
of all variables, and in a nice format if you are using ddbg (i.e.: 
strings are shown as strings, nested members appear, etc.). To do that, 
i advice you to read: 
http://dsource.org/projects/descent/wiki/DebuggingPrograms

(also check the screenshots)

Martin Fuchs escribió:
>> There is DDBG that works under code blocks. Most of item a is available 
>> and much of item b is there but not integrated (expression work but aren't 
>> available from the IDE, watches don't work etc.)
>>
>> There is room for improvment but it's a start
> 
> Well, I tried Code::Blocks and the DDBG integration with the current 
> development snapshot.
> First of all I must say, I had some hassles setting up the environment to 
> build and debug a test program:
> 
> - There was missing the -g linker option in the default debug settings of 
> Code::Blocks.
> 
> - To configure the debugger I had to specify the GDB wrapper script 
> "ddbg_gdb.bat" instead of "ddbg.exe" itself in code block's toolchain 
> configuration.
> 
> 
> OK, now I can build D programs and launch thd ddbg debugger in Code::Blocks.
> But what I am still missing is:
> 
> You can't see the contents of all varaiables. For example it isn't even 
> possible to display strings and array variables in the watch window.
> This is what I described in my initial post. So again: What exactly is the 
> problem - Is there only missing some extension to display complex types in 
> the debugger or is the information completely missing in the debug 
> information generated by the compiler? If it's only a debugger display 
> program, it's only a matter of time when the goal will be reached. In the 
> second case it might require a completely new debug info format. So the 
> compiler *and* the debugger would require some rewrite. 
> 
>
September 12, 2007
Re: D on Visual Studio?
> 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.
September 12, 2007
Re: D on Visual Studio?
> Not to advertise or anything, but such an IDE does exist:
> http://www.dsource.org/projects/descent .
> In fact, I think some of the other IDEs (Code::Blocks or Poseidon, maybe?)
> have those features, too.

OK, Descent is quite usefull to write code in Eclipse with its convenient 
source code editor. But what's missing here is the integration with 
Eclipse's build system: You have to use rebuild.exe of DSSS in an aditional 
external build configuration in order to compile your source code. Launching 
and debugging the executable is also nit quite forward: You have to setup 
the launch configuration by hand, the default behavior is not correct. And 
when using the debugger DDBG in Eclipse, the same problems as in 
Code::Blocks apply: Evaluating expressions works only for some very basic 
variable types. If you want to display global variables, you have to prefix 
the variable name with the module name by hand.

So currently it's all not quite ready to be used without problems. And in no 
way comparable to using the VC++ IDE for C++ programs.
September 12, 2007
Re: D on Visual Studio?
> 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.

Ooop, I must apologize a bit. I found my problem: There was an older version 
(January 2007) of the DMD compiler in my path, which seems to generate 
incomplete debug information. Using the current version, I can now also 
evaluate strings and arrays - with Descent and also in CodeBlocks.

May be I can now start writing some usefull D programs, as there are now 
"only" missing some extended capabilities like "quick view", variable 
evaluation in tooltips, smart code completition, ... in the D IDEs.  ;-)
September 12, 2007
Re: D on Visual Studio?
All of this is currently work in progress in Descent... Yes, you are 
right, a tool like what you describe is really needed for me too, and it 
doesn't exist yet... That's why we are making it. :-)

Martin Fuchs escribió:
>> Not to advertise or anything, but such an IDE does exist:
>> http://www.dsource.org/projects/descent .
>> In fact, I think some of the other IDEs (Code::Blocks or Poseidon, maybe?)
>> have those features, too.
> 
> OK, Descent is quite usefull to write code in Eclipse with its convenient 
> source code editor. But what's missing here is the integration with 
> Eclipse's build system: You have to use rebuild.exe of DSSS in an aditional 
> external build configuration in order to compile your source code. Launching 
> and debugging the executable is also nit quite forward: You have to setup 
> the launch configuration by hand, the default behavior is not correct. And 
> when using the debugger DDBG in Eclipse, the same problems as in 
> Code::Blocks apply: Evaluating expressions works only for some very basic 
> variable types. If you want to display global variables, you have to prefix 
> the variable name with the module name by hand.
> 
> So currently it's all not quite ready to be used without problems. And in no 
> way comparable to using the VC++ IDE for C++ programs. 
> 
>
September 13, 2007
Re: D on Visual Studio?
Ary Manzana Wrote:

> All of this is currently work in progress in Descent... Yes, you are 
> right, a tool like what you describe is really needed for me too, and it 
> doesn't exist yet... That's why we are making it. :-)

Descent ui download link broken.
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home