if __name__ == '__main__': args = parse() cpath = UF.get_svcomp_testpath(args.path) if not os.path.isdir(cpath): print(UP.cpath_not_found_err_msg(cpath)) exit(1) sempath = os.path.join(cpath, 'semantics') if not os.path.isdir(sempath): print(UP.semantics_not_found_err_msg(cpath)) exit(1) cfapp = CApplication(sempath, args.cfile) cfile = cfapp.getcfile() if not cfile.hasfunctionbyname(args.cfunction): print(UP.cfunction_not_found_err_sg(cpath, args.cfile, args.cfunction)) exit(1) cfunction = cfile.getfunctionbyname(args.cfunction) if args.open: print(RP.function_code_open_tostring(cfunction)) else: print(RP.function_code_tostring(cfunction)) print(RP.function_proofobligation_stats_tostring(cfunction))
from advance.app.CApplication import CApplication def parse(): parser = argparse.ArgumentParser() parser.add_argument('path',help='directory that holds the analysis results') parser.add_argument('cfile',help='relative filename of the c source file') args = parser.parse_args() return args if __name__ == '__main__': args = parse() sempath = os.path.join(args.path,'semantics') capp = CApplication(sempath,args.cfile) cfile = capp.getcfile() print(UP.reportheader('Global definitions and declarations for ' + args.cfile)) print('-' * 80) print('Global type definitions') print('-' * 80) gtypes = cfile.getgtypes() for gt in sorted(gtypes,key=lambda(t):t.gettypeinfo().getname()): tinfo = gt.gettypeinfo() print(str(tinfo.gettype()) + ': ' + tinfo.getname() + ' (' + gt.getlocation().getfile() + ')') print('-' * 80) print('Global struct definitions') print('-' * 80)