-
Notifications
You must be signed in to change notification settings - Fork 351
Add VS debugger launch action to VS code configuration #772
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ronald,
I'm looping in Anton since he is the actual vs-code-export.
Cheers,
Henning
"name": "(Windows) Launch", | ||
"type": "cppvsdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/build_default_relwithdebinfo/bin/Orbit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of ${workspaceFolder}/build_default_relwithdebinfo}
, ${command:cmake.buildDirectory}
might work better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this needs to the cmake-extension and might also not be appropriate for your use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just substituting this naively results in an error for me: "command cmake.buildDirectory not found". Not sure what else I need to do to make this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, didn't see your other replies before replying. @antonrohr Let me know what you think we should do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're probably not using the cmake extension. In this case it's fine for me to go with your solution. Personally I'm not a big fan of having a .vscode
folder in the repo at all, but I'm also not a frequent user of vscode. Anton should have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ${workspaceFolder}/build_default_relwithdebinfo
is fine since its pretty much the standard way of doing that. I don't even know how the cmake extension would decide which build target I want to choose if I have multiple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an opinion on this, I just want my debugger to work out-of-the box (and I'm just using this one target anyway). Can either of you approve for now? We can always change / improve this later if we find a better way.
"stopAtEntry": false, | ||
"cwd": "${workspaceFolder}/build_default_relwithdebinfo/bin/", | ||
"environment": [], | ||
"externalConsole": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"externalConsole": false | |
"externalConsole": false, | |
"preLaunchTask": "shell: build default relwithdebinfo" |
This would always trigger a build before starting the debugging. This is how I have my configuration, but it is purely preference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Ronald for this!
I don't know how you are using this, but maybe it would be good to also set the environment variables or have a second debugging target with the variables.
"environment": [
{
"name": "ORBIT_COLLECTOR_EXECUTABLE_PATH",
"value": "${workspaceFolder}/build_ggp_release/bin/OrbitService"
},
{
"name": "ORBIT_COLLECTOR_ROOT_PASSWORD",
"value": "your password"
}
],
Maybe we could also have a second task for building ggp_release and then have both tasks as prerequisite. Up to you
I think these are good suggestions that we want to add in the future. I'll merge this for now as it's a big improvement for me that I can just use the VS debugger without local changes and directly in VS code. |
No description provided.