From cbdd39b6c9c3ce9abe88e9da74d4879441ab001d Mon Sep 17 00:00:00 2001 From: anjiahao Date: Thu, 21 Apr 2022 10:37:37 +0800 Subject: [PATCH] tools:fix parsememdump.py match error Signed-off-by: anjiahao --- tools/parsememdump.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/tools/parsememdump.py b/tools/parsememdump.py index daf5bc9ae1..7707e98060 100755 --- a/tools/parsememdump.py +++ b/tools/parsememdump.py @@ -45,19 +45,10 @@ class dump_line: return self.size = int(tmp.group(0)[1:]) - tmp = re.search(r"\b0x[0-9a-fA-F]+\b", line_str[tmp.span()[1] :]) - self.addr = tmp.group(0) - line_str = line_str[tmp.span()[1] :] - while 1: - tmp = re.search(r"\b0x[0-9a-fA-F]+\b", line_str[tmp.span()[1] :]) - if tmp is None: - break - self.mem.append(tmp.group(0)) - line_str = line_str[tmp.span()[1] :] - - if self.mem.__len__() == 0: - self.err = 1 - return + tmp = re.findall("0x([0-9a-fA-F]+)", line_str[tmp.span()[1] :]) + self.addr = tmp[0] + for str in tmp[1:]: + self.mem.append(str) class log_output: