diff --git a/HISTORY.rst b/HISTORY.rst index fc0e1b4d..cd03107d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -30,6 +30,7 @@ test-driven methodologies, and modern toolchains for unrivaled success. * Resolved an issue where ``get_systype()`` inaccurately returned the architecture when executed within a Docker container on a 64-bit kernel with a 32-bit userspace (`issue #4777 `_) * Resolved an issue with incorrect handling of the ``check_src_filters`` option when used in multiple environments (`issue #4788 `_) * Resolved an issue where running `pio project metadata `__ resulted in duplicated "include" entries (`issue #4723 `_) +* Resolved an issue where native debugging failed on the host machine (`issue #4745 `_) 6.1.11 (2023-08-31) ~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/debug/config/factory.py b/platformio/debug/config/factory.py index d7358b92..ea36b6a0 100644 --- a/platformio/debug/config/factory.py +++ b/platformio/debug/config/factory.py @@ -27,17 +27,13 @@ class DebugConfigFactory: @classmethod def new(cls, platform, project_config, env_name): - board_config = platform.board_config( - project_config.get("env:" + env_name, "board") - ) - tool_name = ( - board_config.get_debug_tool_name( - project_config.get("env:" + env_name, "debug_tool") - ) - if board_config - else None - ) + board_id = project_config.get("env:" + env_name, "board") config_cls = None + tool_name = None + if board_id: + tool_name = platform.board_config( + project_config.get("env:" + env_name, "board") + ).get_debug_tool_name(project_config.get("env:" + env_name, "debug_tool")) try: mod = importlib.import_module("platformio.debug.config.%s" % tool_name) config_cls = getattr(mod, cls.get_clsname(tool_name)) diff --git a/platformio/platform/base.py b/platformio/platform/base.py index 51b02216..0d2d57a9 100644 --- a/platformio/platform/base.py +++ b/platformio/platform/base.py @@ -169,6 +169,7 @@ class PlatformBase( # pylint: disable=too-many-instance-attributes,too-many-pub return self._BOARDS_CACHE[id_] if id_ else self._BOARDS_CACHE def board_config(self, id_): + assert id_ return self.get_boards(id_) def get_package_type(self, name):