mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #12419 from ARMmbed/fix-gh12290
Fix #12290: crash_log_parser on py3pull/12431/head
commit
7634f3684a
|
@ -33,7 +33,7 @@ _PTN = re.compile("([0-9a-f]*) ([Tt]) ([^\t\n]*)(?:\t(.*):([0-9]*))?")
|
||||||
class ElfHelper(object):
|
class ElfHelper(object):
|
||||||
def __init__(self, elf_file, map_file):
|
def __init__(self, elf_file, map_file):
|
||||||
|
|
||||||
op = check_output([_NM_EXEC, _OPT, elf_file.name])
|
op = check_output([_NM_EXEC, _OPT, elf_file.name]).decode('utf-8')
|
||||||
self.maplines = map_file.readlines()
|
self.maplines = map_file.readlines()
|
||||||
self.matches = _PTN.findall(op)
|
self.matches = _PTN.findall(op)
|
||||||
self.addrs = [int(x[0], 16) for x in self.matches]
|
self.addrs = [int(x[0], 16) for x in self.matches]
|
||||||
|
@ -115,7 +115,7 @@ def parse_line_for_register(line):
|
||||||
def main(crash_log, elfhelper):
|
def main(crash_log, elfhelper):
|
||||||
mmfar_val = 0
|
mmfar_val = 0
|
||||||
bfar_val = 0
|
bfar_val = 0
|
||||||
lines = iter(crash_log.read().splitlines())
|
lines = iter(crash_log.read().decode('utf-8').splitlines())
|
||||||
|
|
||||||
for eachline in lines:
|
for eachline in lines:
|
||||||
if "++ MbedOS Fault Handler ++" in eachline:
|
if "++ MbedOS Fault Handler ++" in eachline:
|
||||||
|
|
Loading…
Reference in New Issue