Parcourir la source

Merge branch 'bugfix/add-resolution-suggestion-for-coredump_v4.4' into 'release/v4.4'

idf_monitor.py: Remove line finalization when coredump is in progress to avoid coredump failure (v4.4)

See merge request espressif/esp-idf!17364
Jiang Jiang Jian il y a 3 ans
Parent
commit
92a67e0fff
3 fichiers modifiés avec 11 ajouts et 14 suppressions
  1. 5 1
      tools/idf_monitor.py
  2. 2 13
      tools/idf_monitor_base/constants.py
  3. 4 0
      tools/idf_monitor_base/coredump.py

+ 5 - 1
tools/idf_monitor.py

@@ -210,10 +210,14 @@ class Monitor:
             # generates an event which will result in the finishing of
             # generates an event which will result in the finishing of
             # the last line. This is fix for handling lines sent
             # the last line. This is fix for handling lines sent
             # without EOL.
             # without EOL.
+            # finalizing the line when coredump is in progress causes decoding issues
+            # the espcoredump loader uses empty line as a sign for end-of-coredump
+            # line is finalized only for non coredump data
         elif event_tag == TAG_SERIAL_FLUSH:
         elif event_tag == TAG_SERIAL_FLUSH:
             self.serial_handler.handle_serial_input(data, self.console_parser, self.coredump,
             self.serial_handler.handle_serial_input(data, self.console_parser, self.coredump,
                                                     self.gdb_helper, self._line_matcher,
                                                     self.gdb_helper, self._line_matcher,
-                                                    self.check_gdb_stub_and_run, finalize_line=True)
+                                                    self.check_gdb_stub_and_run,
+                                                    finalize_line=not self.coredump.in_progress)
         else:
         else:
             raise RuntimeError('Bad event data %r' % ((event_tag, data),))
             raise RuntimeError('Bad event data %r' % ((event_tag, data),))
 
 

+ 2 - 13
tools/idf_monitor_base/constants.py

@@ -1,16 +1,5 @@
-# Copyright 2015-2021 Espressif Systems (Shanghai) CO LTD
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
+# SPDX-License-Identifier: Apache-2.0
 
 
 import os
 import os
 import re
 import re

+ 4 - 0
tools/idf_monitor_base/coredump.py

@@ -38,6 +38,10 @@ class CoreDump:
         self.websocket_client = websocket_client
         self.websocket_client = websocket_client
         self.elf_file = elf_file
         self.elf_file = elf_file
 
 
+    @property
+    def in_progress(self) -> bool:
+        return bool(self._coredump_buffer)
+
     def _process_coredump(self):  # type: () -> None
     def _process_coredump(self):  # type: () -> None
         if self._decode_coredumps != COREDUMP_DECODE_INFO:
         if self._decode_coredumps != COREDUMP_DECODE_INFO:
             raise NotImplementedError('process_coredump: %s not implemented' % self._decode_coredumps)
             raise NotImplementedError('process_coredump: %s not implemented' % self._decode_coredumps)