www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How do you typically debug / write D code (Visual Studio - known to be

reply Daniel Donnelly, Jr. <enjoysmath gmail.com> writes:
I give up on Visual Studio VisualD plugin as it's had the same 
issues for over five years, and currently my program runs from 
the command line, but VisualD complains with a 528 nonsensical 
errors.

So I investigated using VScode instead (I do need a debugger), 
and I get this:

```
Couldn't find a debug adapter descriptor for debug type 'code-d' 
(extension might have failed to activate)
```

I have the D-support plugin installed and it auto-creates a 
Launch config when I select it from the dropdown after clicking 
Add Configuration.

The launch.json config looks like this:

```
{
     // Use IntelliSense to learn about possible attributes.
     // Hover to view descriptions of existing attributes.
     // For more information, visit: 
https://go.microsoft.com/fwlink/?linkid=830387
     "version": "0.2.0",
     "configurations": [
         {
             "type": "code-d",
             "request": "launch",
             "dubBuild": true,
             "name": "Build & Debug DUB project",
             "cwd": "${command:dubWorkingDirectory}",
             "program": "${command:dubTarget}"
         }

     ]
}

```

I've tried both DUB vs non-DUB launch config.  Same error either 
way.

So how do you guys efficiently debug D if there exists no working 
environment or is there a nice IDE I'm unaware of?
Aug 19
next sibling parent reply ryuukk_ <ryuukk.dev gmail.com> writes:
What's your OS?


Debugging works very nice with vscode:

```json
         {
             "name": "game: client",
             "type": "lldb",
             "request": "launch",
             "program": "${workspaceFolder}/bin/game",
             "cwd": "${workspaceFolder}/bin",
         },
```

use: 
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb


![screenshot](https://i.imgur.com/14F8FtR.png)


if you are on windows, you can try 
https://github.com/EpicGamesExt/raddebugger (from rad/Epic 
Games), they plan to make it crossplatform

When i was using windows, i was using: 
https://remedybg.itch.io/remedybg, paid but it works
Aug 19
parent reply Daniel Donnelly, Jr. <enjoysmath gmail.com> writes:
On Monday, 19 August 2024 at 13:05:55 UTC, ryuukk_ wrote:
 What's your OS?


 Debugging works very nice with vscode:

 ```json
         {
             "name": "game: client",
             "type": "lldb",
             "request": "launch",
             "program": "${workspaceFolder}/bin/game",
             "cwd": "${workspaceFolder}/bin",
         },
 ```

 use: 
 https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb


 ![screenshot](https://i.imgur.com/14F8FtR.png)


 if you are on windows, you can try 
 https://github.com/EpicGamesExt/raddebugger (from rad/Epic 
 Games), they plan to make it crossplatform

 When i was using windows, i was using: 
 https://remedybg.itch.io/remedybg, paid but it works
How do I get LLDB to work? I would like to Debug / edit from one app, or is RAD Debugger worth it as a standalone?
Aug 19
parent ryuukk_ <ryuukk.dev gmail.com> writes:
 How do I get LLDB to work?
This is why i asked you what OS you use, but you didn't answer Click on the link bellow the screenshot and follow the doc And post log about errors you encounter, otherwise i can't help you, i am not on your PC
Aug 19
prev sibling next sibling parent IchorDev <zxinsworld gmail.com> writes:
On Monday, 19 August 2024 at 10:59:33 UTC, Daniel Donnelly, Jr. 
wrote:
 So how do you guys efficiently debug D if there exists no 
 working environment or is there a nice IDE I'm unaware of?
Use gdb; unless you’re running macOS, in which case use the version of lldb included in the macOS developer tools package.
Aug 19
prev sibling parent evilrat <evilrat666 gmail.com> writes:
On Monday, 19 August 2024 at 10:59:33 UTC, Daniel Donnelly, Jr. 
wrote:
 I give up on Visual Studio VisualD plugin as it's had the same 
 issues for over five years, and currently my program runs from 
 the command line, but VisualD complains with a 528 nonsensical 
 errors.

 So I investigated using VScode instead (I do need a debugger), 
 and I get this:

 ```
 Couldn't find a debug adapter descriptor for debug type 
 'code-d' (extension might have failed to activate)
 ```

 I have the D-support plugin installed and it auto-creates a 
 Launch config when I select it from the dropdown after clicking 
 Add Configuration.

 The launch.json config looks like this:

 ```
 {
     // Use IntelliSense to learn about possible attributes.
     // Hover to view descriptions of existing attributes.
     // For more information, visit: 
 https://go.microsoft.com/fwlink/?linkid=830387
     "version": "0.2.0",
     "configurations": [
         {
             "type": "code-d",
             "request": "launch",
             "dubBuild": true,
             "name": "Build & Debug DUB project",
             "cwd": "${command:dubWorkingDirectory}",
             "program": "${command:dubTarget}"
         }

     ]
 }

 ```

 I've tried both DUB vs non-DUB launch config.  Same error 
 either way.

 So how do you guys efficiently debug D if there exists no 
 working environment or is there a nice IDE I'm unaware of?
In windows you need "C++" extension from Microsoft as it has native debugger for that OS.
Aug 19