From 5fd03186af1d65f1b16f01125597ac475e80b095 Mon Sep 17 00:00:00 2001 From: Xu Xingliang Date: Fri, 7 Jun 2024 18:53:21 +0800 Subject: [PATCH] tools/minidumpserver: fix 32bit crash log parsing Need to distinguish between 32bit and 64bit registers, format the gdb reply message using struct.pack with correct format. ' --- tools/minidumpserver.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/minidumpserver.py b/tools/minidumpserver.py index 469e8a36c8..04e7636222 100755 --- a/tools/minidumpserver.py +++ b/tools/minidumpserver.py @@ -335,6 +335,7 @@ class DumpLogFile: self.registers = [] self.__memories = list() self.reg_table = dict() + self.reg_len = 32 def _init_register(self): # registers list should be able to hold the max index @@ -353,8 +354,7 @@ class DumpLogFile: if reg_name in self.reg_table: reg_index = self.reg_table[reg_name] self.registers[reg_index] = int(reg_val, 16) - else: - raise Exception("Unknown register name: ", reg_name) + self.reg_len = max(self.reg_len, len(reg_val) * 4) return True @@ -386,8 +386,9 @@ class DumpLogFile: data = b"" start = addr_start + reg_fmt = " unknown value @@ -523,12 +524,11 @@ class GDBStub: self.put_gdb_packet(pkt) def handle_register_single_read_packet(self, pkt): - reg_fmt = "