From f46072f769188ec13a93e5e959642a13111bce08 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 Apr 2018 18:01:08 +0300 Subject: [PATCH] Generate beta configuration for the new PIO Debugger for VSCode --- .../ide/tpls/vscode/.vscode/launch.json.tpl | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/platformio/ide/tpls/vscode/.vscode/launch.json.tpl b/platformio/ide/tpls/vscode/.vscode/launch.json.tpl index 788edc2a..0277c921 100644 --- a/platformio/ide/tpls/vscode/.vscode/launch.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/launch.json.tpl @@ -1,4 +1,16 @@ +// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY + +// PIO Unified Debugger +// +// http://docs.platformio.org/page/plus/debugging.html +// http://docs.platformio.org/page/section_env_debug.html#projectconf-debug-tool + % from os.path import dirname, join +% +% def _escape_path(path): +% return path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"') +% end +% { "version": "0.2.0", "configurations": [ @@ -7,11 +19,28 @@ "request": "launch", "cwd": "${workspaceRoot}", "name": "PlatformIO Debugger", - "target": "{{prog_path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"')}}", - "gdbpath": "{{join(dirname(platformio_path), "piodebuggdb").replace('\\\\', '/').replace('\\', '/').replace('"', '\\"')}}", + "target": "{{ _escape_path(prog_path) }}", + "gdbpath": "{{ _escape_path(join(dirname(platformio_path), "piodebuggdb")) }}", "autorun": [ "source .pioinit" ], "preLaunchTask": "PlatformIO: Pre-Debug", "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PlatformIO Debugger (Beta)", + "executable": "{{ _escape_path(prog_path) }}", + "toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}", + "preLaunchTask": "PlatformIO: Pre-Debug", + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PlatformIO Debugger (Beta) (Quick)", + "executable": "{{ _escape_path(prog_path) }}", + "toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}", + "internalConsoleOptions": "openOnSessionStart" } ] } \ No newline at end of file