Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

Add VS debugger launch action to VS code configuration #772

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

ronaldfw
Copy link
Collaborator

@ronaldfw ronaldfw commented Jul 6, 2020

No description provided.

@ronaldfw ronaldfw requested a review from beckerhe July 6, 2020 11:57
@beckerhe beckerhe requested a review from antonrohr July 6, 2020 12:03
Copy link
Collaborator

@beckerhe beckerhe left a 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",
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Contributor

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

Copy link
Collaborator Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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

Copy link
Contributor

@antonrohr antonrohr left a 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

@ronaldfw
Copy link
Collaborator Author

ronaldfw commented Jul 6, 2020

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.

@ronaldfw ronaldfw merged commit 03bb7b3 into master Jul 6, 2020
@ronaldfw ronaldfw deleted the ronaldfw/vscode branch July 6, 2020 15:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants