minidumpserver.py:Print the line number of logfile when the format is wrong
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
8c56354dc8
commit
ffb391f6aa
|
@ -247,11 +247,15 @@ class dump_log_file:
|
||||||
start = 0
|
start = 0
|
||||||
if self.fd is None:
|
if self.fd is None:
|
||||||
self.open()
|
self.open()
|
||||||
|
|
||||||
|
linenumber = 0
|
||||||
|
try:
|
||||||
while 1:
|
while 1:
|
||||||
line = self.fd.readline()
|
line = self.fd.readline()
|
||||||
if line == "":
|
if line == "":
|
||||||
break
|
break
|
||||||
|
|
||||||
|
linenumber += 1
|
||||||
tmp = re.search("up_dump_register:", line)
|
tmp = re.search("up_dump_register:", line)
|
||||||
if tmp is not None:
|
if tmp is not None:
|
||||||
# find arch
|
# find arch
|
||||||
|
@ -320,6 +324,9 @@ class dump_log_file:
|
||||||
"<I", int("0x" + tmp.group().replace(" ", ""), 16)
|
"<I", int("0x" + tmp.group().replace(" ", ""), 16)
|
||||||
)
|
)
|
||||||
line = line[tmp.span()[1] :]
|
line = line[tmp.span()[1] :]
|
||||||
|
except Exception as e:
|
||||||
|
logger.error("parse log file error: %s linenumber %d" % (e, linenumber))
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
if len(data):
|
if len(data):
|
||||||
memory = {"start": start, "end": start + len(data), "data": data}
|
memory = {"start": start, "end": start + len(data), "data": data}
|
||||||
|
|
Loading…
Reference in New Issue