www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - Help getting a debug environment setup.

reply "ChrisG" <joe hotmail.com> writes:
I've been playing with D for a bit, but something that's
preventing me from using it for any serious tasks is the apparent
lack of a usable debugger.

I was playing with D under OS X. Editing code was fine, but
trying to debug on the platform was slap in the face. Looks like
GDB is the only recommended approach under OS X and guess what?
GDB was removed from the latest OS X version Mavericks. LLDB sort
of works, but between the name mangling and super verbose
command-line interface it was pure torture to use. I could try
and get the mac ports version of GDB, but then I'll have to deal
with having both brew and ports on the same system.

So, I moved over to Windows. I've installed Visual D on VS 2012
(at this point I'm scared to install it on my machine with VS
2013). Once again, I can edit and build mostly OK, but debugging
appears to be almost completely broken. Almost all of the
important VS hot-keys for debugging fail with a dialog box "The
method or operation is not implemented" (F5, Ctrl+Shift+F5, F10,
F11). I've tried with both the cv2pdb and mango options.

Does anyone use a debugger on D code? Does GDB on Linux work?
What am I missing?

Thanks,

-Chris
Dec 17 2013
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 18.12.2013 00:59, ChrisG wrote:
 I've been playing with D for a bit, but something that's
 preventing me from using it for any serious tasks is the apparent
 lack of a usable debugger.
[...]
 So, I moved over to Windows. I've installed Visual D on VS 2012
 (at this point I'm scared to install it on my machine with VS
 2013). Once again, I can edit and build mostly OK, but debugging
 appears to be almost completely broken. Almost all of the
 important VS hot-keys for debugging fail with a dialog box "The
 method or operation is not implemented" (F5, Ctrl+Shift+F5, F10,
 F11). I've tried with both the cv2pdb and mango options.
If you select the Visual Studio Debugger in the "Debugging" options of the D project, the same debugger is used as with C++ projects. So all the hotkeys should work. Maybe you have some other plugin installed that expects special support from the language service? Did you change some of the debugger options in Tools->Options->Debugging that might be causing the trouble? Unfortunately, VS 2012 comes with a new debug engine that does not work well with watches in D programs. You can restore the previous debug engine if you select "Enable native debug and continue" on the "Edit and Continue" page. With mago, the debug engine is replaced, but the front end is still the same, so hotkeys work the same. There are some functions that are not supported yet (like "Set next statement"), but the basic operations should work. Stopping debugging (with Shift+F5) is known to cause a message box as you describe, this is fixed in a recent beta: https://github.com/D-Programming-Language/visuald/releases
Dec 17 2013
parent "ChrisG" <joe hotmail.com> writes:
Rainer, thanks for the reply. Based on your suggestion I started 
yanking extensions our of Visual Studio until I thought I'd 
broken it totally. I have a ton of stuff installed (...you don't 
want to know). Looks like I had a bad extension 
"Microsoft.DriverKit.DriverTestPackage" (from the WDK... I 
think?) that was interacting poorly with the Visual D plugin.

BTW, if anyone else experiences the same problem, I couldn't seem 
to fix it by just uninstalling the WDK. I ended up having to 
manually delete this registry key to fix it: 
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Packages\{18B934DB-9F52-4F48-A988-B3325DD23A4B}

Debugging hot-keys work now. Thanks.
Dec 18 2013