From 716a2871c5f968e8738612813033af44abd42834 Mon Sep 17 00:00:00 2001 From: Soumen Ghosh <soumeng@codeaurora.org> Date: Mon, 28 Aug 2017 17:10:04 +0530 Subject: [PATCH] lrdpv2: scandump_reader string matching fail if register valus is 0 scandumpwrapper dumping the register as 0 instaed of 0x0, Due that scandump_reader string matching is failing Change-Id: I1f86a224fb28a2f946328041472013a294ab1521 --- linux-ramdump-parser-v2/scandump_reader.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/linux-ramdump-parser-v2/scandump_reader.py b/linux-ramdump-parser-v2/scandump_reader.py index 487af15..36e7a2c 100644 --- a/linux-ramdump-parser-v2/scandump_reader.py +++ b/linux-ramdump-parser-v2/scandump_reader.py @@ -149,16 +149,18 @@ class Scandump_v2(): alt_pc_1 = None alt_pc_2 = None pc_val = "" - + match_flag = False if os.path.exists(output): fd = open(output, "r") for line in fd: + match_flag = False matchObj = re.match('^REGISTER.SET ([xse].*[0-9]+)\s(0x[0-9a-f]{0,})', line, re.M | re.I) if matchObj: regVal = matchObj.group(2) if regVal == "0x": regVal = "0x0000000000000000" self.regs[(matchObj.group(1)).lower()] = int(regVal, 16) + match_flag = True else: matchObj = re.match('^REGISTER.SET (PC)\s(0x[0-9a-f]{0,})', line, re.M | re.I) if matchObj: @@ -177,6 +179,13 @@ class Scandump_v2(): alt_pc_2 = matchObj_altpc.group(2) if alt_pc_2 == "0x": alt_pc_2 = "0x0000000000000000" + matchObj = re.match('^REGISTER.SET ([xse].*[0-9]+)\s([0-9a-f])', line, re.M | re.I) + if matchObj and match_flag == False: + regVal = matchObj.group(2) + if regVal == "0": + regVal = "0x0000000000000000" + self.regs[(matchObj.group(1)).lower()] = int(regVal, 16) + result_32 = self.alt_pc_selection(pc_val) if result_32: -- GitLab