mirror of
https://github.com/platformio/platformio-core.git
synced 2025-08-02 11:24:27 +02:00
Configure a custom pattern to determine when debugging server is started with a new debug_server_ready_pattern option
This commit is contained in:
@@ -15,6 +15,7 @@ PlatformIO Core 5
|
||||
|
||||
- Boosted `PlatformIO Debugging <https://docs.platformio.org/page/plus/debugging.html>`__ performance thanks to migrating the codebase to the pure Python 3 Asynchronous I/O stack
|
||||
- Support debugging on Windows using Windows CMD/CLI (`pio debug <https://docs.platformio.org/page/core/userguide/cmd_debug.html>`__) (`issue #3793 <https://github.com/platformio/platformio-core/issues/3793>`_)
|
||||
- Configure a custom pattern to determine when debugging server is started with a new `debug_server_ready_pattern <https://docs.platformio.org/page/projectconf/section_env_debug.html#debug-server-ready-pattern>`__ option
|
||||
|
||||
5.1.1 (2021-03-17)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
2
docs
2
docs
Submodule docs updated: 0487c24f93...b76e3d53bb
@@ -22,7 +22,7 @@ import click
|
||||
|
||||
from platformio import __version__, exception
|
||||
from platformio.commands import PlatformioCLI
|
||||
from platformio.compat import IS_CYGWIN, PY2, ensure_python3
|
||||
from platformio.compat import IS_CYGWIN, ensure_python3
|
||||
|
||||
try:
|
||||
import click_completion # pylint: disable=import-error
|
||||
@@ -118,7 +118,7 @@ def main(argv=None):
|
||||
exit_code = int(e.code)
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
if not isinstance(e, exception.ReturnErrorCode):
|
||||
if not PY2:
|
||||
if sys.version_info.major != 2:
|
||||
from platformio import maintenance
|
||||
|
||||
maintenance.on_platformio_exception(e)
|
||||
|
@@ -130,7 +130,9 @@ class DebugConfigBase: # pylint: disable=too-many-instance-attributes
|
||||
|
||||
@property
|
||||
def server_ready_pattern(self):
|
||||
return (self.server or {}).get("ready_pattern")
|
||||
return self.env_options.get(
|
||||
"debug_server_ready_pattern", (self.server or {}).get("ready_pattern")
|
||||
)
|
||||
|
||||
def _load_build_data(self):
|
||||
data = load_project_ide_data(self.project_config.path, self.env_name)
|
||||
|
@@ -14,6 +14,7 @@
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
|
||||
from platformio import fs
|
||||
@@ -120,7 +121,13 @@ class DebugServerProcess(DebugBaseProcess):
|
||||
return self._ready
|
||||
ready_pattern = self.debug_config.server_ready_pattern
|
||||
if ready_pattern:
|
||||
self._ready = ready_pattern.encode() in data
|
||||
if ready_pattern.startswith("^"):
|
||||
self._ready = re.match(
|
||||
ready_pattern,
|
||||
data.decode("utf-8", "ignore"),
|
||||
)
|
||||
else:
|
||||
self._ready = ready_pattern.encode() in data
|
||||
return self._ready
|
||||
|
||||
def stdout_data_received(self, data):
|
||||
|
@@ -695,6 +695,14 @@ ProjectOptions = OrderedDict(
|
||||
),
|
||||
type=click.Path(exists=True, file_okay=True, dir_okay=False),
|
||||
),
|
||||
ConfigEnvOption(
|
||||
group="debug",
|
||||
name="debug_server_ready_pattern",
|
||||
description=(
|
||||
"A pattern to determine when debugging server is ready "
|
||||
"for an incoming connection"
|
||||
),
|
||||
),
|
||||
# Advanced
|
||||
ConfigEnvOption(
|
||||
group="advanced",
|
||||
|
Reference in New Issue
Block a user