Has anyone been able to debug with VS2005?

Jim Hewes jhewesNOSPAM at ix.netcom.com
Tue Nov 14 08:54:24 PST 2006

"Lionello Lunesu" <lionello at lunesu.remove.com> wrote in message 
news:ej6p57$2nhe$1 at digitaldaemon.com...
> Actually, I only program D from within VS2005!
> I use the vsplugind found on dsource, but that's only needed for building 
> right from VS. Just for debugging, you don't need anything. Compiling your 
> program using dmd -g will add the needed symbols to the obj/exe and VS 
> will understand them! Arrays are shown as 64-bit integers, but when seen 
> in hex, it's obvious what part is the count and what the pointer. 
> Alternatively, you can take the array's address and cast it to a int*.
> For syntax highlighting you should add .d to the extensions list in the 
> options dialog, and let VS treat it as C++ or C#. Missing keywords can be 
> added using a text-file called usertype.dat with a keyword on each line. 
> It goes in the VS "IDE" folder, if I'm not mistaken, but better google to 
> duoble check that (no VS2005 here at home).
> L.

Thanks, I'll check out the plug-in when dsource is back.
I was able to debug the sample hello.exe app in VS2005 by doing the 

1. Load hello.exe into VS2005 as a project. Also, open the hello.d source 
2. Press F11 to take one step into the code. Source is not available, so 
show disassembly.
3. In the disassembly window, enter the address as "_Dmain" and hit return. 
The window will show the mixed source/assembly at _Dmain.
4. In the disassembly window, set a breakpoint at the first line of _Dmain 
and hit Go.
5. In the source window, you should now see execution stop at the first line 
and you can single step from there.

However, I wasn't able to set breakpoints from the source window. But I 
haven't had much time to play with it yet. Hopefuly I can spend more time 
next weekend. (Hey! I have a day job.)


More information about the Digitalmars-d-learn mailing list