Skip to content

Support QuoteArgs in OpenDebugAD7#1006

Merged
WardenGnaw merged 3 commits intomasterfrom
dev/waan/addQuoteArgsInODAD7
Jun 9, 2020
Merged

Support QuoteArgs in OpenDebugAD7#1006
WardenGnaw merged 3 commits intomasterfrom
dev/waan/addQuoteArgsInODAD7

Conversation

@WardenGnaw
Copy link
Copy Markdown
Member

@WardenGnaw WardenGnaw commented Jun 8, 2020

This PR adds in the QuoteArgs toggle that we have in
MIEngineLaunchOptions. This will toggle if we quote the debugger command
or not.

Examples:
Configuration:

"pipeTransport": {
                "debuggerPath": "/usr/bin/gdb",
                "pipeProgram": "${env:windir}\\system32\\bash.exe",
                "pipeArgs": ["-c", "${debuggerCommand}"],
                "pipeCwd": "",
                "quoteArgs": true
},

Output:
1: (8103) Starting: "C:\windows\sysnative\bash.exe" -c "/usr/bin/gdb --interpreter=mi"
Configuration:

"pipeTransport": {
                "debuggerPath": "/usr/bin/gdb",
                "pipeProgram": "${env:windir}\\system32\\wsl.exe",
                "pipeArgs": ["${debuggerCommand}"],
                "pipeCwd": "",
                "quoteArgs": false
},

Output:
1: (6374) Starting: "C:\windows\sysnative\wsl.exe" /usr/bin/gdb --interpreter=mi

In this case, we will not be quoting anything at all in the arguments and it is up to the user to quote their arguments. E.g. pipeArgs: [""quoted argument with spaces""]

This PR adds in the QuoteArgs toggle that we have in
MIEngineLaunchOptions. This will toggle if we quote the debugger command
or not.
Comment thread src/OpenDebugAD7/MILaunchOptions.cs
It is only used for pipeTransport.
Comment thread src/OpenDebugAD7/MILaunchOptions.cs Outdated
Copy link
Copy Markdown
Member

@gregg-miskelly gregg-miskelly left a comment

Choose a reason for hiding this comment

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

Aside from Pierson's comment - looks good to me.

@WardenGnaw WardenGnaw merged commit d3ac6bb into master Jun 9, 2020
WardenGnaw added a commit to microsoft/vscode-cpptools that referenced this pull request Jun 12, 2020
With microsoft/MIEngine#1006, the debug adapter
supports 'quoteArgs' in pipeTransports. If the user wishes to handle the
quoting for pipeTransport arguments, they should set this field to
'false'. It currently defaults to true.

For example, if quoteArgs is 'true', the pipe command will result in
"bash.exe -c '/usr/bin/gdb --interpreter=mi'" If false,
it will result to "wsl.exe -c /usr/bin/gdb --interpreter=mi"
WardenGnaw added a commit to microsoft/vscode-cpptools that referenced this pull request Jun 15, 2020
With microsoft/MIEngine#1006, the debug adapter
supports 'quoteArgs' in pipeTransports. If the user wishes to handle the
quoting for pipeTransport arguments, they should set this field to
'false'. It currently defaults to true.

For example, if quoteArgs is 'true', the pipe command will result in
"bash.exe -c '/usr/bin/gdb --interpreter=mi'" If false,
it will result to "wsl.exe -c /usr/bin/gdb --interpreter=mi"
WardenGnaw added a commit to microsoft/vscode-cpptools that referenced this pull request Jun 15, 2020
With microsoft/MIEngine#1006, the debug adapter
supports 'quoteArgs' in pipeTransports. If the user wishes to handle the
quoting for pipeTransport arguments, they should set this field to
'false'. It currently defaults to true.

For example, if quoteArgs is 'true', the pipe command will result in
"bash.exe -c '/usr/bin/gdb --interpreter=mi'" If false,
it will result to "wsl.exe -c /usr/bin/gdb --interpreter=mi"
@WardenGnaw WardenGnaw deleted the dev/waan/addQuoteArgsInODAD7 branch August 7, 2020 23:46
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 this pull request may close these issues.

3 participants