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

set env commands with newlines trigger GDB problems #1364

Closed
bspeice opened this issue Oct 23, 2022 · 1 comment · Fixed by #1365
Closed

set env commands with newlines trigger GDB problems #1364

bspeice opened this issue Oct 23, 2022 · 1 comment · Fixed by #1365

Comments

@bspeice
Copy link
Contributor

bspeice commented Oct 23, 2022

Related: matepek/vscode-catch2-test-adapter#364, microsoft/vscode-cmake-tools#2442

Environment variables that contain newline characters cause problems when attempting to run set env commands (gdb.cs and Debugger.cs), I believe because newlines aren't escaped properly (Debugger.cs). Downstream VS Code plugins have so far worked around this by removing environment variables containing newlines.

I'm currently working to set up a local copy of OpenDebugAD7 to test whether variable escaping is enough to fix the problem, but wanted to raise the issue here in case one of the maintainers had a better solution in mind.

@bspeice bspeice changed the title set env commands don't properly escape newline characters set env commands with newlines trigger GDB problems Oct 23, 2022
@bspeice
Copy link
Contributor Author

bspeice commented Oct 24, 2022

Was able to compile OpenDebugAD7, run the cpptools extension with it loaded, and recreate the problem by adding an "environment": [{"name": "MY_VAR", "value": "Hello\nWorld"}] block to the launch.json. The debugger crashes out prior to #1365, and is able to properly debug when #1365 is applied.

WardenGnaw pushed a commit that referenced this issue Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant