www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Setup help?

reply Charles <charles.joseph.smith icloud.com> writes:
Does anyone know of a video that shows setting up vscode (or 
another editor with debugging support)? I always feel like I miss 
a step when I decide to try D out again, and it never ends well.

I don't use C++, and I do use Windows, which has me wondering if 
I'm just missing some normal/exepcted configuration.

My most recent attempt I tried to get Native Debug to make VS 
Code debugging stop on the first line. Instead, it just runs the 
program, and exits.

Debug console output:

     No symbol table is loaded.  Use the "file" command.
     Running executable
     [New Thread 10256.0x23d8]
     [New Thread 10256.0x2d30]
     [New Thread 10256.0xebc]
     [New Thread 10256.0x19f4]
     Edit source/app.d to start your project.
     [Thread 10256.0xebc exited with code 0]
     [Thread 10256.0x2d30 exited with code 0]
     [Thread 10256.0x19f4 exited with code 0]

Thanks
Feb 06
parent reply evilrat <evilrat666 gmail.com> writes:
On Wednesday, 6 February 2019 at 23:59:07 UTC, Charles wrote:
 I don't use C++, and I do use Windows, which has me wondering 
 if I'm just missing some normal/exepcted configuration.

 My most recent attempt I tried to get Native Debug to make VS 
 Code debugging stop on the first line. Instead, it just runs 
 the program, and exits.
"Native Debug" is for GDB and looks like it doesn't even works on Windows. But even on Linux I found that C++ tools are much nicer. You need C++ tools from Microsoft to debug D code, don't mind the name, its debugger works for any (compatible formats) native code. Then add C++ Windows debug configuration and set your paths. Done. You can debug now. (Though it is possible that it will require Visual Studio Build Tools installation) Of course this will not work for default DMD builds because it is using ancient object files format that is not compatible with VS debugger engine, so using DMD you need to build with -m32mscoff (dub --arch=x86_mscoff) or -m64 (dub --arch=x86_64) flags.
Feb 06
parent Charles <charles.joseph.smith icloud.com> writes:
On Thursday, 7 February 2019 at 02:55:15 UTC, evilrat wrote:
 You need C++ tools from Microsoft to debug D code, don't mind 
 the name, its debugger works for any (compatible formats) 
 native code.

 Then add C++ Windows debug configuration and set your paths. 
 Done. You can debug now. (Though it is possible that it will 
 require Visual Studio Build Tools installation)

 Of course this will not work for default DMD builds because it 
 is using ancient object files format that is not compatible 
 with VS debugger engine, so using DMD you need to build with 
 -m32mscoff (dub --arch=x86_mscoff) or -m64 (dub --arch=x86_64) 
 flags.
Thanks, I'll give it a shot.
Feb 06