예제 #1
0
import argparse
import os
import sys
import string
import rcs_utils
import dynaa_utils

if __name__ == '__main__':
    parser = argparse.ArgumentParser(
            description = 'Check the soundness of the specified AA')
    parser.add_argument('bc', help = 'the bitcode of the program')
    parser.add_argument('log', help = 'the point-to log (.pts)')
    parser.add_argument('aa',
                        help = 'the checked alias analysis: ' + \
                                str(dynaa_utils.get_aa_choices()),
                        metavar = 'aa',
                        choices = dynaa_utils.get_aa_choices())
    parser.add_argument('--check-all',
                        help = 'check all pointers',
                        action = 'store_true',
                        default = False)
    parser.add_argument('--disable-print-value',
                        help = 'disable printing values. only print value IDs',
                        action = 'store_true',
                        default = False)
    # Due to the behavior of LLVM's alias analysis chaining, the baseline AA
    # must be an ImmutablePass.
    parser.add_argument('--baseline',
                        help = 'baseline AA which is assumed to be ' + \
                                'correct: ' + str(dynaa_utils.get_aa_choices()),
예제 #2
0
#!/usr/bin/env python

import argparse
import os
import sys
import string
import rcs_utils
import dynaa_utils

if __name__ == '__main__':
    parser = argparse.ArgumentParser(
            description = 'Check the call graph generated based on the ' \
                    'specified AA')
    parser.add_argument('bc', help = 'the bitcode of the program')
    parser.add_argument('log', help = 'the point-to log')
    parser.add_argument('aa',
            help = 'the underlying alias analysis: ' + \
                    str(dynaa_utils.get_aa_choices()),
            metavar = 'aa',
            choices = dynaa_utils.get_aa_choices())
    args = parser.parse_args()

    cmd = dynaa_utils.load_all_plugins('opt')
    cmd = dynaa_utils.load_aa(cmd, args.aa)
    cmd = string.join((cmd, '-fpcg'))
    cmd = string.join((cmd, '-check-cg'))
    cmd = string.join((cmd, '-log-file', args.log))
    cmd = string.join((cmd, '-disable-output', '<', args.bc))
    
    rcs_utils.invoke(cmd)
예제 #3
0
import argparse
import dynaa_utils
import rcs_utils
import sys
import time
import string

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Insert alias checker")
    parser.add_argument("prog", help="the program name (e.g. mysqld)")

    # online alias checker args
    parser.add_argument(
        "aa",
        help="the checked alias analysis: " + str(dynaa_utils.get_aa_choices()),
        metavar="aa",
        choices=dynaa_utils.get_aa_choices(),
    )
    parser.add_argument(
        "--baseline",
        help="baseline AA which is assumed to be " + "correct: " + str(dynaa_utils.get_aa_choices()),
        metavar="baseline_aa",
        default="no-aa",
        choices=["no-aa", "basicaa", "tbaa"],
    )
    parser.add_argument("--disable-inline", help="do not inline the alias checks", action="store_true", default=False)
    parser.add_argument(
        "--disable-opt", help="do not run standard compiler optimization", action="store_true", default=False
    )
    parser.add_argument(