def add_arguments(self, parser): subparsers = parser.add_subparsers(help='Coverage report type', dest='command') lcov_parser = subparsers.add_parser( 'lcov', cmd=LineCoverage(), help='Generate a line coverage report') lcov_parser.add_argument('--html', action='store_true', help='Generate an HTML report in s2e-last') lcov_parser.add_argument( '--include-covered-files-only', action='store_true', help= 'The coverage report will exclude files that were never covered', default=True) bb_parser = subparsers.add_parser('basic_block', cmd=BasicBlockCoverage(), help='Generate a basic block report') bb_parser.add_argument('-d', '--disassembler', choices=('ida', 'r2', 'binaryninja'), default='ida', help='Disassembler backend to use') bb_parser.add_argument('-r', '--drcov', action='store_true', help='Generate drcov-compatible output') super(Command, self).add_arguments(parser)
def add_arguments(self, parser): subparsers = parser.add_subparsers(help='Coverage report type', dest='command') lcov_parser = subparsers.add_parser( 'lcov', cmd=LineCoverage(), help='Generate a line coverage report') lcov_parser.add_argument('--html', action='store_true', help='Generate an HTML report in s2e-last') lcov_parser.add_argument( '--include-covered-files-only', action='store_true', help= 'The coverage report will exclude files that were never covered', default=True) lcov_parser.add_argument( '--s2e-out-dir', action='append', help='S2E output directories to consider (default is s2e-last).', required=False) lcov_parser.add_argument( '--aggregate-outputs', type=int, help= 'Specifies n most recent s2e-out-* folders to aggregate for coverage.', required=False) lcov_parser.add_argument( '--lcov-out-dir', type=str, help='Where to store the LCOV report (by default into s2e-last)', required=False) bb_parser = subparsers.add_parser('basic_block', cmd=IDABasicBlockCoverage(), help='Generate a basic block report') bb_parser.add_argument('-d', '--disassembler', choices=('ida', 'r2', 'binaryninja'), default='ida', help='Disassembler backend to use') bb_parser.add_argument('-r', '--drcov', action='store_true', help='Generate drcov-compatible output') super(Command, self).add_arguments(parser)
def handle(self, *args, **options): command = options.pop('command', ()) if command == 'basic_block': # Select the disassembler backend disassembler = options.pop('disassembler', ()) if disassembler == 'ida': call_command(IDABasicBlockCoverage(), args, **options) elif disassembler == 'r2': call_command(R2BasicBlockCoverage(), args, **options) elif disassembler == 'binaryninja': call_command(BinaryNinjaBasicBlockCoverage(), args, **options) elif command == 'lcov': call_command(LineCoverage(), args, **options) else: raise CommandError('Invalid command %s' % command)
def handle(self, *args, **options): command = options.pop('command', ()) if command == 'basic_block': # Select the disassembler backend disassembler = options.pop('disassembler', ()) if disassembler == 'ida': from .code_coverage.ida_basic_block import IDABasicBlockCoverage return call_command(IDABasicBlockCoverage(), args, **options) elif disassembler == 'r2': from .code_coverage.r2_basic_block import R2BasicBlockCoverage return call_command(R2BasicBlockCoverage(), args, **options) elif command == 'lcov': return call_command(LineCoverage(), args, **options)
def add_arguments(self, parser): subparsers = parser.add_subparsers(help='Coverage report type', dest='command') lcov_parser = subparsers.add_parser( 'lcov', cmd=LineCoverage(), help='Generate a line coverage report') lcov_parser.add_argument('--html', action='store_true', help='Generate an HTML report in s2e-last') bb_parser = subparsers.add_parser('basic_block', cmd=BasicBlockCoverage(), help='Generate a basic block report') bb_parser.add_argument('-d', '--disassembler', choices=('ida', 'r2'), default='ida', help='Disassembler backend to use') super(Command, self).add_arguments(parser)