I'm using nimble to build, this is my vscode launch.json: 
    
    
    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Debug",
                "type": "gdb",
                "request": "launch",
                "target": "./bin/testapp",
                "cwd": "${workspaceRoot}",
                "internalConsoleOptions": "openOnSessionStart"
                //,"terminal": ""
            }
        ]
    }
    

the nimble project config looks like this - testapp.nimble: 
    
    
    
    version       = "0.1.0"
    author        = "gil"
    description   = "testapp"
    license       = "MIT"
    bin           = @["testapp"]
    binDir        = "bin"
    srcDir        = "src"
    
    # Dependencies
    
    requires "nim >= 0.14.2"
    

in addition to that, I use the vscode GDB plugin to debug, so the tasks.json 
looks like this: 
    
    
    {
        "version": "0.1.0",
        "command": "nimble",
        "isShellCommand": true,
        "args": ["build"],
        "showOutput": "always"
    }
    

to enable debug you need to pass debugger:"native" to nim compiler, i'm doing 
this by having a nim.cfg file in my root folder with this inside 
    
    
    debugger:"native"
    

with these settings i hit ctrl+shift+b to build and F5 to debug. 

Reply via email to