コード例 #1
0
ファイル: cluehunter.py プロジェクト: yangke/cluehunter
 def _analysis(self):
     parser=LogParser()
     parser.setRedundantLevel(self.args.level)
     l=parser.parse(self.args.trace)
     if self.args.c_project_dir is not None:
         macro_inspector=MacroInspector(self.args.c_project_dir)
         tracker=Tracker(l,macro_inspector)
     else:
         tracker=Tracker(l)
     for line in l:
         print str(l.index(line))+"#"+str(line)
     traceIndex=(len(l)+self.args.index)%len(l)
     vs=self.build_tiantvars_list()
     tracker.setStartJobs(traceIndex, vs)
     
     TG=tracker.track()
     output=file(self.args.output_path+"/"+self.args.name+".dot", 'w')
     print TG.serialize2dot()
     output.write(TG.serialize2dot())
     output.close()
     subprocess.call("dot -Tsvg "+self.args.output_path+"/"+self.args.name+".dot -o "+self.args.output_path+"/"+self.args.name+".svg", shell = True)
コード例 #2
0
ファイル: TraceTrackTest.py プロジェクト: wyylucky/cluehunter
 def parse_list(self):
     parser=LogParser()
     #parser.setRedundantLevel(RedundancyFixer.REMOVE_INLINE_REDUNDANT)
     parser.setRedundantLevel(RedundancyFixer.REMOVE_INTERPROCEDURAL_REDUNDANT)
     l=parser.parse(self.logfile_path)
     return l