<commit_before>######################################################################
##
## Copyright (C) 2008,  <NAME>
##
## Filename:      helpers.py
## Author:        <NAME> <<EMAIL>>
## Description:   Helpers for the C++ translator
##
## $Id:$
##
######################################################################
import os, sys

from Cibyl.BinaryTranslation.translator import config

def doJasmin(filename):
    ret = os.system(config.jasmin + " -d " + config.outDirectory + " " + filename)
    if ret != 0:
        sys.exit(ret)

def doJavac(filename):
    ret = os.system(config.javac + " -d " + config.outDirectory +
                    " -classpath " + config.outDirectory + " " + filename )
    if ret != 0:
        sys.exit(ret)


def doTranslation(filename, syscallDirectories):
    dbs = ""
    defines = " "
    conf = "config:"

    if config.traceStart != 0:
        conf = conf + "trace_start=0x%x," % (config.traceStart)
    if config.traceEnd != 0:
        conf = conf + "trace_end=0x%x," % (config.traceEnd)
    if config.memoryDebug:
        conf = conf + "trace_stores=1,"
    if config.doOptimizeIndirectCalls:
        conf = conf + "prune_call_table=1,"

    for d in config.defines:
        defines = defines + d + " "

    for d in syscallDirectories:
        dbs = dbs + d + "/cibyl-syscalls.db "

    print conf
    ret = os.system(config.xcibyl_translator + " " + conf + " " + defines + config.outDirectory
                    + " " + config.infile + " " + dbs)
    if ret != 0:
        sys.exit(ret)<commit_msg>Don't printout<commit_after>######################################################################
##
## Copyright (C) 2008,  <NAME>
##
## Filename:      helpers.py
## Author:        <NAME> <<EMAIL>>
## Description:   Helpers for the C++ translator
##
## $Id:$
##
######################################################################
import os, sys

from Cibyl.BinaryTranslation.translator import config

def doJasmin(filename):
    ret = os.system(config.jasmin + " -d " + config.outDirectory + " " + filename)
    if ret != 0:
        sys.exit(ret)

def doJavac(filename):
    ret = os.system(config.javac + " -d " + config.outDirectory +
                    " -classpath " + config.outDirectory + " " + filename )
    if ret != 0:
        sys.exit(ret)


def doTranslation(filename, syscallDirectories):
    dbs = ""
    defines = " "
    conf = "config:"

    if config.traceStart != 0:
        conf = conf + "trace_start=0x%x," % (config.traceStart)
    if config.traceEnd != 0:
        conf = conf + "trace_end=0x%x," % (config.traceEnd)
    if config.memoryDebug:
        conf = conf + "trace_stores=1,"
    if config.doOptimizeIndirectCalls:
        conf = conf + "prune_call_table=1,"

    for d in config.defines:
        defines = defines + d + " "

    for d in syscallDirectories:
        dbs = dbs + d + "/cibyl-syscalls.db "

    ret = os.system(config.xcibyl_translator + " " + conf + " " + defines + config.outDirectory
                    + " " + config.infile + " " + dbs)
    if ret != 0:
        sys.exit(ret)
{'fraction_non_alphanumeric': 0.2239921976592978, 'fraction_numerical': 0.008452535760728219, 'mean_word_length': 2.707228915662651, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1206730', 'n_tokens_mistral': 1013, 'n_tokens_neox': 954, 'n_words': 212}