From d07a1d265ee37e1adfd29e9df1f58dc534fa3c32 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 27 Jun 2019 13:38:46 +0300 Subject: [PATCH] Log stdout of GDB client --- platformio/commands/debug/client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platformio/commands/debug/client.py b/platformio/commands/debug/client.py index 03daed25..a7ed9b2b 100644 --- a/platformio/commands/debug/client.py +++ b/platformio/commands/debug/client.py @@ -170,11 +170,12 @@ class GDBClient(BaseProcess): # pylint: disable=too-many-instance-attributes stdio.StandardIO(p) def onStdInData(self, data): - self._last_server_activity = time.time() if LOG_FILE: with open(LOG_FILE, "ab") as fp: fp.write(data) + self._last_server_activity = time.time() + if b"-exec-run" in data: if self._target_is_run: token, _ = data.split(b"-", 1) @@ -198,6 +199,10 @@ class GDBClient(BaseProcess): # pylint: disable=too-many-instance-attributes reactor.stop() def outReceived(self, data): + if LOG_FILE: + with open(LOG_FILE, "ab") as fp: + fp.write(data) + self._last_server_activity = time.time() super(GDBClient, self).outReceived(data) self._handle_error(data)