www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to debug in vscode with mago-mi?

reply Domain <dont_email empty.com> writes:
Could anyone show me how to debug in vscode with mago-mi?
I have installed vscode with Native Debug, SDLang. I have tried 
dlang-vscode and code-d.

My tasks.json:
{
     "version": "2.0.0",
     "command": "dub",
     "type": "shell",

     "presentation": {
         "echo": true,
         "reveal": "always",
         "focus": false,
         "panel": "shared"
     },

     "tasks" : [
         {
             "taskName": "build",
             "group": {
                 "kind": "build",
                 "isDefault": true
             },
             "args": [],
             //Pattern match DMD error messages
             "problemMatcher": {
                 "owner": "d",
                 "fileLocation": ["relative", "${workspaceRoot}"],
                 "pattern": {
                     "regexp": 
"^(.*)\\((\\d+),(\\d+)\\):\\s+(Warning|Error):\\s+(.*)$",
                     "file": 1,
                     "line": 2,
                     "column": 3,
                     "severity": 4,
                     "message": 5
                 }
             }
         }
     ]
}

And my launch.json:
{
     "version": "0.2.0",
     "configurations": [
         {
             "name": "Debug",
             "type": "mago-mi",
             "request": "launch",
             "target": "./bin/app.exe",
             "cwd": "${workspaceRoot}"
         }
     ]
}

I have placed mago-mi.exe in PATH.

I can build app.exe successfully. But when I click the debug 
button, nothing happen.
Jul 17 2017
parent reply WebFreak001 <d.forum webfreak.org> writes:
On Monday, 17 July 2017 at 08:44:46 UTC, Domain wrote:
 Could anyone show me how to debug in vscode with mago-mi?
 I have installed vscode with Native Debug, SDLang. I have tried 
 dlang-vscode and code-d.

 [...]
Is the application actually being put in bin/app.exe? Also try a different debugger (the windows debugger from the C/C++ Extension by Microsoft which uses the visual studio debugger is quite good)
Jul 20 2017
parent Domain <dont_email empty.com> writes:
On Thursday, 20 July 2017 at 15:31:55 UTC, WebFreak001 wrote:
 On Monday, 17 July 2017 at 08:44:46 UTC, Domain wrote:
 Could anyone show me how to debug in vscode with mago-mi?
 I have installed vscode with Native Debug, SDLang. I have 
 tried dlang-vscode and code-d.

 [...]
Is the application actually being put in bin/app.exe? Also try a different debugger (the windows debugger from the C/C++ Extension by Microsoft which uses the visual studio debugger is quite good)
Yes, I have visual studio installed. I can debug with VisualD. And I can debug with mago-mi from commandline, but not in vs code. When I click debug button, I can see the debug toolbar, but it will be gone in seconds. And no breakpoint hit. My source structure --| |--bin | |--app.exe | |--src | |--app.d | |--dub.json | |--.vscode | |--task.json | |--launch.json | |--.dub
Jul 20 2017