예제 #1
0
def main():
    """List CBMC property checking results."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    try:
        results = resultt.do_make_result(args.viewer_result, args.cbmc_result)
        print(results)
    except UserWarning as error:
        sys.exit(error)
예제 #2
0
def main():
    """List CBMC error traces."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    try:
        traces = tracet.do_make_trace(args.viewer_trace, args.cbmc_trace,
                                      args.srcdir, args.wkdir)
        print(traces)
    except UserWarning as error:
        sys.exit(error)
예제 #3
0
def main():
    """List CBMC coverage checking results."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    try:
        coverage = coveraget.do_make_coverage(args.viewer_coverage,
                                              args.srcdir, args.cbmc_coverage)
        print(coverage)
    except UserWarning as error:
        sys.exit(error)
def main():
    """List the loops in a goto binary."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    try:
        loops = loopt.do_make_loop(args.viewer_loop, args.cbmc_loop,
                                   args.srcdir, args.goto)
        print(loops)
    except UserWarning as error:
        sys.exit(error)
예제 #5
0
def main():
    """Properties checked by CBMC during property checking."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    try:
        properties = propertyt.do_make_property(args.viewer_property,
                                                args.cbmc_property,
                                                args.srcdir)
        print(properties)
    except UserWarning as error:
        sys.exit(error)
예제 #6
0
def main():
    """List the symbols used to build a goto binary."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    try:
        symbols = symbolt.do_make_symbol(args.viewer_symbol,
                                         args.viewer_source, args.tags_method,
                                         args.goto, args.wkdir, args.srcdir,
                                         args.files)
        print(symbols)
    except UserWarning as error:
        sys.exit(error)
def main():
    """List reachable functions in a goto binary."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    try:
        reachable = reachablet.do_make_reachable(args.viewer_reachable,
                                                 args.cbmc_reachable,
                                                 args.srcdir,
                                                 args.goto)
        print(reachable)
    except UserWarning as error:
        sys.exit(error)
def main():
    """List the source files used to build a goto binary."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    try:
        sources = sourcet.do_make_source(args.viewer_source, args.goto,
                                         args.source_method, args.srcdir,
                                         args.wkdir, args.exclude,
                                         args.extensions)
        print(sources)
    except UserWarning as error:
        sys.exit(error)
예제 #9
0
def viewer():
    """Construct the cbmc report."""

    args = create_parser().parse_args()
    args = optionst.defaults(args)

    global_progress("CBMC viewer")

    htmldir = os.path.join(args.reportdir, "html")
    jsondir = os.path.join(args.reportdir, "json")
    os.makedirs(htmldir, exist_ok=True)
    os.makedirs(jsondir, exist_ok=True)

    def dump(obj, name):
        with open(os.path.join(jsondir, name), 'w') as output:
            output.write(str(obj))

    progress("Scanning property checking results")
    results = resultt.do_make_result(args.viewer_result, args.result)
    dump(results, 'viewer-result.json')
    progress("Scanning property checking results", True)

    progress("Scanning error traces")
    traces = tracet.do_make_trace(args.viewer_trace, args.result,
                                  args.srcdir, args.wkdir)
    dump(traces, 'viewer-trace.json')
    progress("Scanning error traces", True)

    progress("Scanning coverage data")
    coverage = coveraget.do_make_coverage(args.viewer_coverage,
                                          args.srcdir,
                                          args.coverage)
    dump(coverage, 'viewer-coverage.json')
    progress("Scanning coverage data", True)

    progress("Scanning loop definitions")
    loops = loopt.do_make_loop(args.viewer_loop, None,
                               args.srcdir, args.goto)
    dump(loops, 'viewer-loop.json')
    progress("Scanning loop definitions", True)

    progress("Scanning properties")
    properties = propertyt.do_make_property(args.viewer_property,
                                            args.property,
                                            args.srcdir)
    dump(properties, 'viewer-property.json')
    progress("Scanning properties", True)

    progress("Computing reachable functions")
    reachable = reachablet.do_make_reachable(args.viewer_reachable,
                                             None,
                                             args.srcdir,
                                             args.goto)
    dump(reachable, 'viewer-reachable.json')
    progress("Computing reachable functions", True)

    # Make sources last, it may delete the goto binary
    progress("Scanning source tree")
    sources = sourcet.do_make_source(args.viewer_source,
                                     args.goto,
                                     args.source_method,
                                     args.srcdir, args.wkdir,
                                     args.exclude, args.extensions)
    dump(sources, 'viewer-source.json')
    progress("Scanning source tree", True)

    progress("Preparing symbol table")
    symbols = symbolt.do_make_symbol(args.viewer_symbol, args.viewer_source,
                                     args.tags_method,
                                     args.goto, args.wkdir,
                                     args.srcdir, None)
    dump(symbols, 'viewer-symbol.json')
    progress("Preparing symbol table", True)

    config = configt.Config(args.config)
    report.report(config, sources, symbols, results, coverage, traces,
                  properties, loops, htmldir, progress)

    global_progress("CBMC viewer", True)