Squash commits for public release
This commit is contained in:
16
utils/qprof/AddrResolver.py
Normal file
16
utils/qprof/AddrResolver.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
|
||||
class AddrResolver:
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
self.cache = {}
|
||||
|
||||
def get(self, addr):
|
||||
if addr not in self.cache:
|
||||
s = subprocess.check_output(
|
||||
"i686-elf-addr2line --demangle -fsp -e " + self.path + " " + hex(addr), shell=True)
|
||||
s = s.decode("ascii")
|
||||
self.cache[addr] = s.split(" ")[0]
|
||||
return self.cache[addr]
|
||||
Reference in New Issue
Block a user