Thread overview
How do you debug DMD?
Mar 14, 2011
%u
Mar 14, 2011
Walter Bright
Mar 14, 2011
%u
Mar 14, 2011
Simon
Mar 15, 2011
Walter Bright
Mar 14, 2011
Trass3r
Mar 14, 2011
Denis Koroskin
Mar 14, 2011
%u
Mar 14, 2011
Regan Heath
March 14, 2011
I tried using Visual Studio to set breakpoints in DMD and everything (after compiling with -g), but it said that the source file is a "different version" (it isn't), and so it doesn't really let me set breakpoints.

What tools (aka debuggers) do you guys use to debug DMD? Any free
tools we can use to help find bugs? (Or is there some trick to getting
Visual Studio to debug this?)
March 14, 2011
On 3/13/2011 10:53 PM, %u wrote:
> I tried using Visual Studio to set breakpoints in DMD and everything
> (after compiling with -g), but it said that the source file is a
> "different version" (it isn't), and so it doesn't really let me set
> breakpoints.
>
> What tools (aka debuggers) do you guys use to debug DMD? Any free
> tools we can use to help find bugs? (Or is there some trick to getting
> Visual Studio to debug this?)

You can use windbg.exe, which is in \dmd\windows\bin. Of course, you'll also need to download the Digital Mars C++ compiler from http://www.digitalmars.com/download/freecompiler.html
March 14, 2011
> You can use windbg.exe, which is in \dmd\windows\bin. Of course,
you'll also need to download the Digital Mars C++ compiler from http://www.digitalmars.com/download/freecompiler.html

Hm... I already have WinDbg (and DMC), but I never thought it's any more efficient to debug with WinDbg than with Visual Studio... is there some sort of advantage I don't know about?
March 14, 2011
%u Wrote:
> What tools (aka debuggers) do you guys use to debug DMD?

Debugging dmd with Visual Studio works flawlessly for me.
I just cv2pdb -C it, open devenv bla\dmd.exe, set the working directory to the D code I want to compile and then open the dmd source code to set breakpoints.
March 14, 2011
On Mon, 14 Mar 2011 12:27:45 +0300, Trass3r <un@known.com> wrote:

> %u Wrote:
>> What tools (aka debuggers) do you guys use to debug DMD?
>
> Debugging dmd with Visual Studio works flawlessly for me.
> I just cv2pdb -C it, open devenv bla\dmd.exe, set the working directory to the D code I want to compile and then open the dmd source code to set breakpoints.

I'd like to note that you need to compile with DMC using the makefiles provided, then cv2pdb -C and debug with Visual Studio.
March 14, 2011
On Mon, 14 Mar 2011 05:53:42 -0000, %u <wfunction@hotmail.com> wrote:

> I tried using Visual Studio to set breakpoints in DMD and everything
> (after compiling with -g), but it said that the source file is a
> "different version" (it isn't), and so it doesn't really let me set
> breakpoints.
>
> What tools (aka debuggers) do you guys use to debug DMD? Any free
> tools we can use to help find bugs? (Or is there some trick to getting
> Visual Studio to debug this?)

Try VisualD:
http://www.dsource.org/projects/visuald

The latest version was crashing my visual studio, but that might be my unique setup.  The previous version works fine.  It comes with cv2pdb to convert the dmd debug symbols from cv to pdb format, and also with Mago which lets you display D arrays (including strings) in the debugger.

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
March 14, 2011
On 14/03/2011 07:20, %u wrote:
>> You can use windbg.exe, which is in \dmd\windows\bin. Of course,
> you'll also need to download the Digital Mars C++ compiler from
> http://www.digitalmars.com/download/freecompiler.html
>
> Hm... I already have WinDbg (and DMC), but I never thought it's any
> more efficient to debug with WinDbg than with Visual Studio... is
> there some sort of advantage I don't know about?

I created a VS project and patch that lets you compile & debug w/ VS.
Might be a little out of date now, but should be easy enough to get working.

http://www.sstk.co.uk/d.php

-- 
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk
March 14, 2011
> I'd like to note that you need to compile with DMC using the
makefiles provided, then cv2pdb -C and debug with Visual Studio.

Ohh so I need to use cv2pdb, that's why! Thanks a lot! :)
March 15, 2011
On 3/14/2011 12:20 AM, %u wrote:
>> You can use windbg.exe, which is in \dmd\windows\bin. Of course,
> you'll also need to download the Digital Mars C++ compiler from
> http://www.digitalmars.com/download/freecompiler.html
>
> Hm... I already have WinDbg (and DMC), but I never thought it's any
> more efficient to debug with WinDbg than with Visual Studio... is
> there some sort of advantage I don't know about?

Well, it works :-)