Skip to content

Commit e4c4f2a

Browse files
committed
Resolved an issue where native debugging failed on the host machine // Resolve platformio#4745
1 parent 77e6d1b commit e4c4f2a

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
3030
* 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 <https://github.com/platformio/platformio-core/issues/4777>`_)
3131
* Resolved an issue with incorrect handling of the ``check_src_filters`` option when used in multiple environments (`issue #4788 <https://github.com/platformio/platformio-core/issues/4788>`_)
3232
* Resolved an issue where running `pio project metadata <https://docs.platformio.org/en/latest/core/userguide/project/cmd_metadata.html>`__ resulted in duplicated "include" entries (`issue #4723 <https://github.com/platformio/platformio-core/issues/4723>`_)
33+
* Resolved an issue where native debugging failed on the host machine (`issue #4745 <https://github.com/platformio/platformio-core/issues/4745>`_)
3334

3435
6.1.11 (2023-08-31)
3536
~~~~~~~~~~~~~~~~~~~

platformio/debug/config/factory.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,13 @@ def get_clsname(name):
2727

2828
@classmethod
2929
def new(cls, platform, project_config, env_name):
30-
board_config = platform.board_config(
31-
project_config.get("env:" + env_name, "board")
32-
)
33-
tool_name = (
34-
board_config.get_debug_tool_name(
35-
project_config.get("env:" + env_name, "debug_tool")
36-
)
37-
if board_config
38-
else None
39-
)
30+
board_id = project_config.get("env:" + env_name, "board")
4031
config_cls = None
32+
tool_name = None
33+
if board_id:
34+
tool_name = platform.board_config(
35+
project_config.get("env:" + env_name, "board")
36+
).get_debug_tool_name(project_config.get("env:" + env_name, "debug_tool"))
4137
try:
4238
mod = importlib.import_module("platformio.debug.config.%s" % tool_name)
4339
config_cls = getattr(mod, cls.get_clsname(tool_name))

platformio/platform/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def _append_board(board_id, manifest_path):
169169
return self._BOARDS_CACHE[id_] if id_ else self._BOARDS_CACHE
170170

171171
def board_config(self, id_):
172+
assert id_
172173
return self.get_boards(id_)
173174

174175
def get_package_type(self, name):

0 commit comments

Comments
 (0)