Escaped double quotes in postLaunchCommands = 'Problem parsing arguments' error
See original GitHub issueThe upcoming OpenOCD 0.11.0 supports a new set of rtt commands. One of the commands requires that its last argument is wrapped in double quotes, e.g. rtt setup 0x20000000 49152 "SEGGER RTT"
.
Specifying that command with escaped double quotes in the postLaunchCommands
results in a parsing error.
This is the launch.json
file I used:
{
"version": "0.2.0",
"configurations": [
{
"cwd": "${workspaceRoot}",
"executable": "./target/thumbv7em-none-eabihf/debug/stm-app",
"name": "Debug Microcontroller (launch)",
"request": "launch",
"preLaunchTask": "rust: cargo build",
"type": "cortex-debug",
"runToMain": true,
"configFiles": [
"interface/stlink.cfg",
"target/stm32l4x.cfg"
],
"servertype": "openocd",
"postLaunchCommands": [
"monitor rtt setup 0x20000000 49152 \"SEGGER RTT\"", // <-
"monitor rtt start",
"monitor rtt server start 8765 0",
],
"svdFile": "STM32L4x3.svd"
}
]
}
I get the following pop-up error message when I try to use the above launch configuration:
Failed to launch GDB: Problem parsing arguments: interpreter-exec console "monitor rtt setup 0x20000000 49152 "SEGGER RTT"" (from interpreter-exec console "monitor rtt setup 0x20000000 49152 "SEGGER RTT"")
Is there a way to execute OpenOCD commands that contain double quotes after the main
breakpoint has been hit (i.e. with "runToMain": true
in the launch.json)?
Workaround
As a workaround I’m currently using an external GDB script file.
"postLaunchCommands": [
"source rtt.gdb",
],
$ cat rtt.gdb
monitor rtt setup 0x20000000 49152 "SEGGER RTT"
monitor rtt start
monitor rtt server start 8765 0
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
PowerShell stripping double quotes from command line ...
For now, the fix is to escape command line arguments in accordance with these rules (which seem to be used (indirectly) by the...
Read more >Escaped double quotes and Parse JSON
Solved: Hello. I've got an issue. I have some JSON object I want to convert into Power Automate object with Parse JSON ....
Read more >Double quotes in CSV file fields cause parsing to truncate ...
DataWave, how to parse double double quotes when included in CSV fields. ... Adding escape sequence to the called function parameter.
Read more >Quotes, Escape Characters, Delimiters - Windows CMD - SS64
Delimiters separate one parameter from the next - they split the command line up into words. Parameters are most often separated by spaces,...
Read more >How to Use PowerShell to Escape Double Quotes
Knowing these differences will make you a more effective PowerShell scriptwriter and help you avoid a rather simple mistake. In this post, you ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah - once I put in a proper encoding fix (not sure if I expect this will come in 0.3.9 - as I’ve already started the 0.3.8 preparations then you’ll have to remove that extra
\\
- but just thought that might be a nicer work-around than the source variation until I can do that.thanks for the quick fix, 0.3.9 works nicely!