8 if (len(sys.argv) < 3):
9 print "Usage: %s [connman binary] [connman 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', '-e', binary]
31 p = subprocess.Popen(command, shell=False, bufsize=0,
32 stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
33 (child_stdin, child_stdout) = (p.stdin, p.stdout)
38 for line in child_stdout:
40 if line.startswith("??"): continue
48 frame_count = len(frames);
51 print "-------- ConnMan backtrace --------"
52 while count < frame_count:
53 print "[%d]: %s() [%s]" % (count/2, frames[count], frames[count + 1])
55 print "-----------------------------------"