Description
Is your feature request related to a problem? Please describe.
I would like to ask is there is a way to pass in Arduino platform.txt relative directories into the Cortex-Debug launch.json serverArgs field. If not, consider this a request for the feature.
When trying to add in debugging support for a 3rd party board, I find that I need to give the JLink gdb server a JLinkscript file for debugging to work properly. This can be achieved by including
"serverArgs": ["-scriptfile", "{pathToFile}\\script.JLinkScript"]
in the debug_custom.json file in the sketch directory, which will be included into the launch.json Cortex-Debug config file.
Ideally, the JLinkscript file would be included in the tools or variant directory of the Arduino package for the board, but I have been unable to find a way to pass in the relative file directory from platform.txt into the "serverArgs": [ ]
field. Using debug.server.jlink.script={runtime.tools.path}/debug/script.JLinkScript
just puts it in the "configFiles": [ ]
field instead, which does not work with JLink gdb server.
Describe the solution you'd like
It would be best if debug.server.jlink.script={}
can directly cause the IDE to add in "-scriptfile" "{pathToFile}/script.JLinkScript"
when invoking JLinkGDBserverCL.exe, with the ability to use platform.txt file path variables for the script file.
An alternative would be a way to add in "serverArgs": [ ]
through platform.txt.