www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - How do you debug DMD?

reply %u <wfunction hotmail.com> writes:
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?)
Mar 13 2011
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
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
Mar 13 2011
parent reply %u <wfunction hotmail.com> writes:
 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?
Mar 14 2011
next sibling parent Simon <s.d.hammett gmail.com> writes:
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
Mar 14 2011
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
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 :-)
Mar 15 2011
prev sibling next sibling parent reply Trass3r <un known.com> writes:
%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.
Mar 14 2011
parent reply "Denis Koroskin" <2korden gmail.com> writes:
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.
Mar 14 2011
parent %u <wfunction hotmail.com> writes:
 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! :)
Mar 14 2011
prev sibling parent "Regan Heath" <regan netmail.co.nz> writes:
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/
Mar 14 2011