From b059157b7478eece7a1a4ae826806148554fd4c7 Mon Sep 17 00:00:00 2001 From: Joseph Tang Date: Mon, 13 Jul 2020 18:02:34 +0800 Subject: [PATCH] parse first 256 bytes of log dump as raw data --- components/espcoredump/espcoredump.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/espcoredump/espcoredump.py b/components/espcoredump/espcoredump.py index 4c62dff2a5..cbd81ee1a0 100755 --- a/components/espcoredump/espcoredump.py +++ b/components/espcoredump/espcoredump.py @@ -634,7 +634,7 @@ class ESPCoreDumpLoader(object): task_regs = self._get_registers_from_stack(data, stack_end > stack_top) except Exception as e: print(e) - return None + return None, None prstatus = XtensaPrStatus() prstatus.pr_cursig = 0 # TODO: set sig only for current/failed task prstatus.pr_pid = i # TODO: use pid assigned by OS @@ -1014,7 +1014,7 @@ def info_corefile(args): logging.error("Failed to create corefile!") loader.cleanup() return - + print("prog %s" % (args.prog)) exe_elf = ESPCoreDumpElfFile(args.prog) core_elf = ESPCoreDumpElfFile(core_fname) merged_segs = [] @@ -1100,7 +1100,12 @@ def info_corefile(args): if log_saved: print("\n====================== CORE DUMP LOG CONTENTS ========================") - print(log_saved) + raw_data = ':'.join(x.encode('hex') for x in log_saved[0:256]) + str_data = log_saved[256:] + print('Raw Data:') + print(raw_data) + print('\nString Data:') + print(str_data) print("\n===================== ESP32 CORE DUMP END =====================") print("===============================================================")