Debugging D in windows

Rainer Schuetze via Digitalmars-d-debugger digitalmars-d-debugger at puremagic.com
Wed Jun 15 13:39:41 PDT 2016



On 15.06.2016 19:53, moe wrote:
> Hi,
>
> I am trying to debug in windows. So far I am trying to use windbg like
> described here: http://dlang.org/windbg.html
>
> However, in windbg when using "g _Dmain" I get an error message: "No
> Debuggee specified". Can anybody tell me what I am missing here? I could
> not find anything online and I can not find any option to specify a
> debugger.
>
> If you know about better ways to debug in windows, please let me know.

Forget the version of windbg that comes with dmd. It must be one of 
Walter's nastier jokes.

If you build an executable with -m64 or -m32mscoff and -g you'll get MS 
compatible debug information in a PDB file. This works with most 
debuggers like Visual Studio, more recent versions of windbg and others. 
Use option -gc to get slightly changed debug info that works better with 
the debugger as they assume to be debugging C++.

If you need to build with -m32, the resulting debug info is some ancient 
CodeView format. This can converted by cv2pdb 
(https://github.com/rainers/cv2pdb) to a PDB file or debugged directly 
by mago (http://dsource.org/projects/mago_debugger). These tools are 
also part of the Visual D installation 
(http://rainers.github.io/visuald/visuald/StartPage.html).


More information about the Digitalmars-d-debugger mailing list