From cd2a2e23bb4441e9a579e00778a6771f0f3f0d85 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Wed, 17 Apr 2019 00:26:30 +0800 Subject: [PATCH] Fix addr2line for new format --- tools/addr2line.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/addr2line.py b/tools/addr2line.py index a7a1e79..f02b415 100644 --- a/tools/addr2line.py +++ b/tools/addr2line.py @@ -10,11 +10,11 @@ arch = sys.argv[2] mode = sys.argv[3] print('--------------------------------------') for line in lines: - match = re.search('(#[0-9]+ )(0x[0-9A-F]+)( fp 0x[0-9A-F]+)', line) + match = re.search('#([0-9]+) PC: (0x[0-9A-F]+) FP: (0x[0-9A-F]+)', line) if match: addr = match.group(2) process = subprocess.run([addrline, '-e', 'target/{0}/{1}/rcore'.format(arch, mode), '-f', '-C', addr], capture_output=True) res = process.stdout.decode('utf-8') - print('{0}{1}{3} {2}'.format(match.group(1), match.group(2), res.strip(), match.group(3))) + print('#{0} PC: {1} FP: {3} {2}'.format(match.group(1), match.group(2), res.strip(), match.group(3))) else: print(line, end='')