1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-22 08:06:17 +04:00

Fix addr2line for new format

This commit is contained in:
Jiajie Chen 2019-04-17 00:26:30 +08:00
parent 594cc3e16f
commit cd2a2e23bb

View File

@ -10,11 +10,11 @@ arch = sys.argv[2]
mode = sys.argv[3] mode = sys.argv[3]
print('--------------------------------------') print('--------------------------------------')
for line in lines: 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: if match:
addr = match.group(2) addr = match.group(2)
process = subprocess.run([addrline, '-e', 'target/{0}/{1}/rcore'.format(arch, mode), '-f', '-C', addr], capture_output=True) process = subprocess.run([addrline, '-e', 'target/{0}/{1}/rcore'.format(arch, mode), '-f', '-C', addr], capture_output=True)
res = process.stdout.decode('utf-8') 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: else:
print(line, end='') print(line, end='')