Merge branch 'contrib/github_pr_9385' into 'master'

Tools: Avoid the crash of IDF Monitor when it is run without an ELF file

Closes IDFGH-7859

See merge request espressif/esp-idf!19141
This commit is contained in:
Roland Dobai 2022-07-20 16:46:12 +08:00
commit 39a0925836

View File

@ -234,7 +234,8 @@ class SerialMonitor(Monitor):
def __exit__(self, exc_type, exc_val, exc_tb) -> None: # type: ignore
""" Use 'with self' to temporarily disable monitoring behaviour """
self.console_reader.start()
self.serial_reader.gdb_exit = self.gdb_helper.gdb_exit # write gdb_exit flag
if self.elf_exists:
self.serial_reader.gdb_exit = self.gdb_helper.gdb_exit # write gdb_exit flag
self.serial_reader.start()
def _pre_start(self) -> None: