rock-core / vscode-rock

VSCode extension for Rock integration
MIT License
1 stars 1 forks source link

Use launch.json to start and debug processes #21

Closed doudou closed 6 years ago

doudou commented 6 years ago

This handles C++ and Ruby debug configurations in launch.json to allow running them within a Rock workspace transparently.

Behind the scenes, the extension now starts all the debugged processes using the workspace's environment (using autoproj exec)

In addition, the extension provides four variable expansions that can be used within launch.json in the program and cwd fields of the debug configurations:

For instance, a Ruby rake test configuration would be:

{
"name": "rock - Run test suite (Rake)",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${rock:which:rake}",
"args": ["test"]
}

a C++ Run Rock's default test suite would be:

        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${rock:buildDir}/test/suite",
            "cwd": "${rock:buildDir}",
            "args": [],
            "stopAtEntry": false,
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
doudou commented 6 years ago

STATUS SO FAR

One provides a program path relative to the build, source or prefix dir. The extension resolves it. I think I'll change it to rather expand variables like `${autoproj:buildDir} instead, which would make it explicit.