diff --git a/HISTORY.rst b/HISTORY.rst index efa87c51..804737ee 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,6 +6,12 @@ Release Notes PlatformIO 4.0 -------------- +4.0.1 (2019-??-??) +~~~~~~~~~~~~~~~~~~ + +* Print `debug tool `__ name for the active debugging session +* Fixed an issue with incorrect escaping of Windows slashes when using `PIO Unified Debugger `__ and "piped" openOCD + 4.0.0 (2019-07-10) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/commands/debug/client.py b/platformio/commands/debug/client.py index ec0bb3d8..d17636c1 100644 --- a/platformio/commands/debug/client.py +++ b/platformio/commands/debug/client.py @@ -66,9 +66,9 @@ class GDBClient(BaseProcess): # pylint: disable=too-many-instance-attributes self._kill_previous_session() patterns = { - "PROJECT_DIR": helpers.escape_path(self.project_dir), - "PROG_PATH": helpers.escape_path(prog_path), - "PROG_DIR": helpers.escape_path(dirname(prog_path)), + "PROJECT_DIR": self.project_dir, + "PROG_PATH": prog_path, + "PROG_DIR": dirname(prog_path), "PROG_NAME": basename(splitext(prog_path)[0]), "DEBUG_PORT": self.debug_options['port'], "UPLOAD_PROTOCOL": self.debug_options['upload_protocol'], diff --git a/platformio/commands/debug/helpers.py b/platformio/commands/debug/helpers.py index daaa8d93..fc7161bb 100644 --- a/platformio/commands/debug/helpers.py +++ b/platformio/commands/debug/helpers.py @@ -121,7 +121,7 @@ def validate_debug_options(cmd_ctx, env_options): cwd=server_package_dir if server_package else None, executable=tool_settings['server'].get("executable"), arguments=[ - a.replace("$PACKAGE_DIR", escape_path(server_package_dir)) + a.replace("$PACKAGE_DIR", server_package_dir) if server_package_dir else a for a in tool_settings['server'].get("arguments", []) ]) diff --git a/platformio/commands/debug/process.py b/platformio/commands/debug/process.py index 98c7cc1a..f363ccb5 100644 --- a/platformio/commands/debug/process.py +++ b/platformio/commands/debug/process.py @@ -17,7 +17,6 @@ import signal import click from twisted.internet import protocol # pylint: disable=import-error -from platformio.commands.debug import helpers from platformio.compat import string_types from platformio.proc import get_pythonexe_path from platformio.project.helpers import get_project_core_dir @@ -30,8 +29,8 @@ class BaseProcess(protocol.ProcessProtocol, object): STDOUT_CHUNK_SIZE = 2048 COMMON_PATTERNS = { - "PLATFORMIO_HOME_DIR": helpers.escape_path(get_project_core_dir()), - "PLATFORMIO_CORE_DIR": helpers.escape_path(get_project_core_dir()), + "PLATFORMIO_HOME_DIR": get_project_core_dir(), + "PLATFORMIO_CORE_DIR": get_project_core_dir(), "PYTHONEXE": get_pythonexe_path() } diff --git a/platformio/commands/debug/server.py b/platformio/commands/debug/server.py index 83bba340..98f1e0e1 100644 --- a/platformio/commands/debug/server.py +++ b/platformio/commands/debug/server.py @@ -19,7 +19,6 @@ 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.commands.debug import helpers from platformio.commands.debug.process import BaseProcess from platformio.proc import where_is_program @@ -67,15 +66,15 @@ class DebugServer(BaseProcess): if openocd_pipe_allowed: args = [] if server['cwd']: - args.extend(["-s", helpers.escape_path(server['cwd'])]) + args.extend(["-s", server['cwd']]) args.extend([ "-c", "gdb_port pipe; tcl_port disabled; telnet_port disabled" ]) args.extend(server['arguments']) str_args = " ".join( [arg if arg.startswith("-") else '"%s"' % arg for arg in args]) - self._debug_port = '| "%s" %s' % ( - helpers.escape_path(server_executable), str_args) + self._debug_port = '| "%s" %s' % (server_executable, str_args) + self._debug_port = self._debug_port.replace("\\", "\\\\") else: env = os.environ.copy() # prepend server "lib" folder to LD path