Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev] vscode debug launch.json #1537

Merged
merged 6 commits into from
Aug 2, 2022
Merged

Conversation

esigo
Copy link
Member

@esigo esigo commented Aug 1, 2022

Adds vscode launch.json
launch.json is needed for debugging in VS code.

Changes

how to use:
build in debug mode e.g. bazel:
--compilation_mode=dbg

or CMake with:
-DCMAKE_BUILD_TYPE=Debug

change the target to the executable of interest e.g. curl_http_test:
"target": "${workspaceFolder}/bazel-bin/ext/test/http/curl_http_test"

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@esigo esigo added the priority:p2 Issues that are not blocking label Aug 1, 2022
@esigo esigo requested a review from a team August 1, 2022 20:57
@codecov
Copy link

codecov bot commented Aug 1, 2022

Codecov Report

Merging #1537 (deb240b) into main (78551fb) will decrease coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1537      +/-   ##
==========================================
- Coverage   84.63%   84.57%   -0.06%     
==========================================
  Files         156      156              
  Lines        4795     4795              
==========================================
- Hits         4058     4055       -3     
- Misses        737      740       +3     
Impacted Files Coverage Δ
ext/src/http/client/curl/http_client_curl.cc 79.93% <0.00%> (-1.13%) ⬇️

@owent
Copy link
Member

owent commented Aug 2, 2022

Should we commit IDE setting to repository?Different users use different IDE and toolchains.

@esigo
Copy link
Member Author

esigo commented Aug 2, 2022

Should we commit IDE setting to repository?Different users use different IDE and toolchains.

We discussed this PR in the SIG meeting. I think it is good to at least have something minimal if everybody agrees of course.

@marcalff
Copy link
Member

marcalff commented Aug 2, 2022

Should we commit IDE setting to repository?Different users use different IDE and toolchains.

We discussed this PR in the SIG meeting. I think it is good to at least have something minimal if everybody agrees of course.

LGTM.

I don't see how this can hurt, and it will increase our productivity.

@reyang
Copy link
Member

reyang commented Aug 2, 2022

Should we commit IDE setting to repository?Different users use different IDE and toolchains.

Looks like OpenTelemetry C++ is not the first one https://github.com/open-telemetry/opentelemetry-specification/blob/main/.vscode/settings.json.

"valuesFormatting": "parseText"
}
]
}
Copy link
Member

Choose a reason for hiding this comment

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

nit: consider adding a blank new line here

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, done

"name": "Debug",
"type": "gdb",
"request": "launch",
"target": "${workspaceFolder}/bazel-bin/<path to the bin file>",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is bazel specific and some some manual update for CMake?

Copy link
Member Author

Choose a reason for hiding this comment

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

it can be used with CMake too, just need to change the target path.

"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText"
}
]
Copy link
Member

Choose a reason for hiding this comment

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

Should we add the configuration for Windows too? Something like this should work.

        {
            "name": "Debug on Windows",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/<path-to-bin-file>",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false
        }

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, added

.vscode/launch.json Outdated Show resolved Hide resolved
esigo and others added 2 commits August 2, 2022 21:36
Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>
@lalitb lalitb merged commit 90fd291 into open-telemetry:main Aug 2, 2022
@esigo esigo deleted the vscode-debug-launch branch August 11, 2022 20:06
yxue pushed a commit to yxue/opentelemetry-cpp that referenced this pull request Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p2 Issues that are not blocking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants