diff --git a/HISTORY.rst b/HISTORY.rst index dfae91a9..9897b738 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -11,6 +11,7 @@ PlatformIO 4.0 * Update SCons tool to 3.1.1 * Remove ProjectConfig cache when "platformio.ini" was modified outside +* Fixed an issue with PIO Unified Debugger on Windows OS when debug server is piped 4.0.2 (2019-08-23) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/commands/debug/helpers.py b/platformio/commands/debug/helpers.py index 91f06318..33e1e855 100644 --- a/platformio/commands/debug/helpers.py +++ b/platformio/commands/debug/helpers.py @@ -19,7 +19,7 @@ from hashlib import sha1 from io import BytesIO from os.path import isfile -from platformio import exception, util +from platformio import exception, fs, util from platformio.commands.platform import \ platform_install as cmd_platform_install from platformio.commands.run import cli as cmd_run @@ -165,11 +165,11 @@ def configure_esp32_load_cmds(debug_options, configuration): mon_cmds = [ 'monitor program_esp32 "{{{path}}}" {offset} verify'.format( - path=item['path'], offset=item['offset']) + path=fs.to_unix_path(item['path']), offset=item['offset']) for item in configuration.get("flash_extra_images") ] mon_cmds.append('monitor program_esp32 "{%s.bin}" 0x10000 verify' % - configuration['prog_path'][:-4]) + fs.to_unix_path(configuration['prog_path'][:-4])) return mon_cmds diff --git a/platformio/commands/debug/process.py b/platformio/commands/debug/process.py index f363ccb5..87ad74ec 100644 --- a/platformio/commands/debug/process.py +++ b/platformio/commands/debug/process.py @@ -17,6 +17,7 @@ import signal import click from twisted.internet import protocol # pylint: disable=import-error +from platformio import fs from platformio.compat import string_types from platformio.proc import get_pythonexe_path from platformio.project.helpers import get_project_core_dir @@ -38,6 +39,11 @@ class BaseProcess(protocol.ProcessProtocol, object): _patterns = self.COMMON_PATTERNS.copy() _patterns.update(patterns or {}) + for key, value in _patterns.items(): + if key.endswith(("_DIR", "_PATH")): + print(13, key) + _patterns[key] = fs.to_unix_path(value) + def _replace(text): for key, value in _patterns.items(): pattern = "$%s" % key diff --git a/platformio/commands/debug/server.py b/platformio/commands/debug/server.py index 98f1e0e1..e5bc6e45 100644 --- a/platformio/commands/debug/server.py +++ b/platformio/commands/debug/server.py @@ -18,7 +18,7 @@ from os.path import isdir, isfile, join from twisted.internet import error # pylint: disable=import-error from twisted.internet import reactor # pylint: disable=import-error -from platformio import exception, util +from platformio import exception, fs, util from platformio.commands.debug.process import BaseProcess from platformio.proc import where_is_program @@ -74,7 +74,7 @@ class DebugServer(BaseProcess): str_args = " ".join( [arg if arg.startswith("-") else '"%s"' % arg for arg in args]) self._debug_port = '| "%s" %s' % (server_executable, str_args) - self._debug_port = self._debug_port.replace("\\", "\\\\") + self._debug_port = fs.to_unix_path(self._debug_port) else: env = os.environ.copy() # prepend server "lib" folder to LD path