8 if (len(sys.argv) < 3):
9 print "Usage: %s [binary] [log]" % (sys.argv[0])
17 log_file = open(sys.argv[2], 'r')
21 matchobj = re.compile(r'\[(0x[0-9a-f]+)\]$').search(line)
23 addrs.append(matchobj.group(1))
28 command = ['addr2line', '--demangle', '--functions', '--basename',
32 p = subprocess.Popen(command, shell=False, bufsize=0,
33 stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
34 (child_stdin, child_stdout) = (p.stdin, p.stdout)
39 for line in child_stdout:
41 if line.startswith("??"):
50 frame_count = len(frames);
53 print "-------- backtrace --------"
54 while count < frame_count:
55 print "[%d]: %s() [%s]" % (count/2, frames[count], frames[count + 1])
57 print "---------------------------"