You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.11
Description of problem
Steps to Reproduce
Create a project
Add a custom board to the project that does not specify "platform" or "platforms"
Add a configuration environment that specifies platform = native and debug_test = *
Attempt to launch a native debug session pio debug -e native --interface=gdb
Actual Results
AttributeError: Traceback (most recent call last):
File "/home/mspatz/code/platformio-core/platformio/__main__.py", line 103, in main
cli() # pylint: disable=no-value-for-parameter
^^^^^
File "/home/mspatz/.local/pipx/venvs/platformio/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mspatz/.local/pipx/venvs/platformio/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/mspatz/code/platformio-core/platformio/cli.py", line 85, in invoke
return super().invoke(ctx)
^^^^^^^^^^^^^^^^^^^
File "/home/mspatz/.local/pipx/venvs/platformio/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mspatz/.local/pipx/venvs/platformio/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mspatz/.local/pipx/venvs/platformio/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mspatz/.local/pipx/venvs/platformio/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mspatz/code/platformio-core/platformio/debug/cli.py", line 104, in cli
debug_config = _configure(*configure_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mspatz/code/platformio-core/platformio/debug/cli.py", line 113, in _configure
debug_config = DebugConfigFactory.new(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mspatz/code/platformio-core/platformio/debug/config/factory.py", line 34, in new
board_config.get_debug_tool_name(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'get_debug_tool_name'
============================================================
An unexpected error occurred. Further steps:
* Verify that you have the latest version of PlatformIO using
`python -m pip install -U platformio` command
* Try to find answer in FAQ Troubleshooting section
https://docs.platformio.org/page/faq/index.html
* Report this problem to the developers
https://github.com/platformio/platformio-core/issues
============================================================
Configuration
PlatformIO Version (
platformio --version
): PlatformIO Core, version 6.1.11Description of problem
Steps to Reproduce
"platform"
or"platforms"
platform = native
anddebug_test = *
pio debug -e native --interface=gdb
Actual Results
Expected Results
GDB launches and attaches to my test
If problems with PlatformIO Build System:
The content of
platformio.ini
:Source file to reproduce issue:
boards/custom_disco_h747xi.json (unmodified form platform ststm32, but copied into project board dir):
** Other Info **
This was reported here: #4685
The root of the problem is in
PlatformBase.get_boards()
, which returns EITHER aPlatformBoardConfig
or a dict of them ifid_ == None
.platformio-core/platformio/platform/base.py
Line 133 in 091c96e
If
[env:native]
doesn't specify aboard
(which it shouldn't),DebugConfigFactory.new()
ends up callingPlatformBase.get_boards(None)
, which as I said returns a dict instead of aPlatformBoardConfig
, resulting in the exception.The exception is avoided if the dict happens to be empty, which it is if there are no custom boards in the project or
core_dir
, thus the difficulty in reproducing this bug.https://github.com/platformio/platformio-core/blob/091c96eb078964dd18eaa1cb9d84ee0079584e53/platformio/debug/config/factory.py#L30C1-L30C46
The text was updated successfully, but these errors were encountered: