From 73f4bce99aba797eb89f7947d90d96b2f42355b5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 1 Apr 2017 14:35:55 +0300 Subject: [PATCH] =?UTF-8?q?Rename=20=E2=80=9Cdebug=5Flink=E2=80=9D=20optio?= =?UTF-8?q?n=20to=20=E2=80=9Cdebug=5Ftool=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs | 2 +- platformio/__init__.py | 2 +- platformio/builder/main.py | 2 +- platformio/builder/tools/piodebug.py | 26 +++++++++++++------------- platformio/builder/tools/pioide.py | 21 ++++++++++++--------- platformio/commands/run.py | 2 +- platformio/managers/core.py | 2 +- 7 files changed, 30 insertions(+), 27 deletions(-) diff --git a/docs b/docs index b40924ea..449625ca 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit b40924ea07c2de937a3812e6c3a362904475ad21 +Subproject commit 449625cac218da2319107c93950af591645747a6 diff --git a/platformio/__init__.py b/platformio/__init__.py index 1067bc86..04858912 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 4, "0a1") +VERSION = (3, 4, "0a2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/main.py b/platformio/builder/main.py index aa8428ed..f6d32c4b 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -65,7 +65,7 @@ commonvars.AddVariables( ("UPLOAD_RESETMETHOD",), # debug options - ("DEBUG_LINK",), + ("DEBUG_TOOL",), ("DEBUG_PORT",), ("DEBUG_GDBINIT",) diff --git a/platformio/builder/tools/piodebug.py b/platformio/builder/tools/piodebug.py index bb66121e..74c53253 100644 --- a/platformio/builder/tools/piodebug.py +++ b/platformio/builder/tools/piodebug.py @@ -28,19 +28,19 @@ def ProcessDebug(env): BUILD_UNFLAGS=["-Os", "-O0", "-O1", "-O2", "-O3"]) -def DebugLinkSettings(env): +def DebugToolSettings(env): if "BOARD" not in env: return board_debug = env.BoardConfig().get("debug", {}) - if not board_debug or not board_debug.get("links"): + if not board_debug or not board_debug.get("tools"): return - debug_links = board_debug.get("links") - link_name = (env.subst("$DEBUG_LINK") or - board_debug.get("default_link", debug_links.keys()[0])) - settings = debug_links.get(link_name) + debug_tools = board_debug.get("tools") + tool_name = (env.subst("$DEBUG_TOOL") or + board_debug.get("default_tool", debug_tools.keys()[0])) + settings = debug_tools.get(tool_name) if not settings: return - settings.update({"name": link_name}) + settings.update({"name": tool_name}) return settings @@ -75,15 +75,15 @@ def AutodetectDebugPort(env): if "BOARD" not in env or ("DEBUG_PORT" in env and not _get_pattern()): return - link_settings = env.DebugLinkSettings() - if not link_settings: + tool_settings = env.DebugToolSettings() + if not tool_settings: return - if not link_settings.get("require_debug_port"): + if not tool_settings.get("require_debug_port"): return need_openocd_rules = [ system() == "Linux", - "openocd" in link_settings.get("server", {}).get("package", ""), + "openocd" in tool_settings.get("server", {}).get("package", ""), not any([ isfile("/etc/udev/rules.d/98-openocd-udev.rules"), isfile("/lib/udev/rules.d/98-openocd-udev.rules") @@ -97,7 +97,7 @@ def AutodetectDebugPort(env): "/develop/scripts/98-openocd-udev.rules\n") env.Replace( - DEBUG_PORT=_look_for_serial_port(link_settings.get("hwids", []))) + DEBUG_PORT=_look_for_serial_port(tool_settings.get("hwids", []))) if not env.subst("$DEBUG_PORT"): sys.stderr.write( @@ -111,6 +111,6 @@ def exists(_): def generate(env): env.AddMethod(ProcessDebug) - env.AddMethod(DebugLinkSettings) + env.AddMethod(DebugToolSettings) env.AddMethod(AutodetectDebugPort) return env diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index 95c7b974..ce998a90 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -15,7 +15,7 @@ from __future__ import absolute_import from glob import glob -from os.path import join +from os.path import join, sep from SCons.Defaults import processDefines @@ -64,6 +64,9 @@ def dump_defines(env): def dump_debug(env): + def _fix_path_sep(path): + return path.replace("/", sep).replace("\\", sep) + def _dump_server(configuration): if not configuration: return @@ -74,8 +77,8 @@ def dump_debug(env): return return { "cwd": pkg_dir, - "executable": configuration['executable'], - "arguments": configuration.get("arguments") + "executable": _fix_path_sep(configuration['executable']), + "arguments": _fix_path_sep(configuration.get("arguments")) } gdbinit = None @@ -85,9 +88,9 @@ def dump_debug(env): else: gdbinit = [env['DEBUG_GDBINIT']] - link_settings = env.DebugLinkSettings() - if link_settings and not gdbinit: - gdbinit = link_settings.get("gdbinit") + tool_settings = env.DebugToolSettings() + if tool_settings and not gdbinit: + gdbinit = tool_settings.get("gdbinit") env.AutodetectDebugPort() @@ -95,11 +98,11 @@ def dump_debug(env): "gdb_path": util.where_is_program( env.subst("$GDB"), env.subst("${ENV['PATH']}")), "prog_path": env.subst("$PROG_PATH"), - "link": link_settings['name'] if link_settings else None, + "tool": tool_settings['name'] if tool_settings else None, "gdbinit": [env.subst(cmd) for cmd in gdbinit] if gdbinit else None, "port": env.subst("$DEBUG_PORT"), - "server": (_dump_server(link_settings['server']) - if link_settings and "server" in link_settings else None) + "server": (_dump_server(tool_settings['server']) + if tool_settings and "server" in tool_settings else None) } diff --git a/platformio/commands/run.py b/platformio/commands/run.py index bd8a77e7..f0643911 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -129,7 +129,7 @@ class EnvironmentProcessor(object): "upload_port", "upload_protocol", "upload_speed", "upload_flags", "upload_resetmethod", "lib_install", "lib_deps", "lib_force", "lib_ignore", "lib_extra_dirs", "lib_ldf_mode", "lib_compat_mode", - "test_ignore", "test_port", "piotest", "debug_link", "debug_port", + "test_ignore", "test_port", "piotest", "debug_tool", "debug_port", "debug_gdbinit") REMAPED_OPTIONS = {"framework": "pioframework", "platform": "pioplatform"} diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 7f838a7f..c0620855 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -22,7 +22,7 @@ from platformio.managers.package import PackageManager CORE_PACKAGES = { "pysite-pioplus": ">=0.3.0,<2", - "tool-pioplus": ">=0.7.1,<2", + "tool-pioplus": ">=0.7.3,<2", "tool-unity": "~1.20302.1", "tool-scons": "~3.20501.2" }