www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to debug ?

reply "Derix" <derix dexample.com> writes:
OK, I have the newest Eclipse+DDT on Linux.

Debugging capabilies look great :
https://github.com/bruno-medeiros/DDT/blob/latest/documentation/Features.md#debugging-functionality

However so far I haven't been able to step throug source code.
What am I missing ? Is there an option to pass to the compiler ?
Yet another tweak to json.dub ?
May 24 2014
parent reply "bioinfornatics" <bioifornatics fedoraproject.org> writes:
On Saturday, 24 May 2014 at 10:14:23 UTC, Derix wrote:
 OK, I have the newest Eclipse+DDT on Linux.

 Debugging capabilies look great :
 https://github.com/bruno-medeiros/DDT/blob/latest/documentation/Features.md#debugging-functionality

 However so far I haven't been able to step throug source code.
 What am I missing ? Is there an option to pass to the compiler ?
 Yet another tweak to json.dub ?
Hi, To debug you nee to use -g flag to compiler I use cgdb to debug D programm it wrap gdb and have a syntax color for D. You need to take a recent cgdb version to get his D support
May 24 2014
parent reply "Derix" <derix dexample.com> writes:
 To debug you nee to use -g flag to compiler
Thanks, but how ?
May 24 2014
parent "Rene Zwanenburg" <renezwanenburg gmail.com> writes:
On Saturday, 24 May 2014 at 15:48:11 UTC, Derix wrote:
 To debug you nee to use -g flag to compiler
Thanks, but how ?
I don't use Eclipse, but for debugging you usually have to do two things. As mentioned before you need to have debug information in the executable. Dub will generate debug executables by default. Then the debugger needs to be attached to your process. Most IDE's have a Run command and a Debug command. Only the latter will automatically attach the debugger to your process. If this doesn't work there's usually also an Attach to Process option which allows you to manually attach the debugger to an already running process. This is less than ideal but can sometimes be useful.
May 25 2014