Exemplo n.º 1
0
    //
    // Given the runtime generated icall table, and a set of assemblies, generate
    // a smaller linked icall table mapping tokens to C function names
    //
    int GenIcallTable(String[] args)
    {
        var icall_table_filename = args [1];
        var fileNames            = args.Skip(2).ToArray();

#if NETFRAMEWORK
        throw new NotSupportedException($"icall table generation is not supported for netstandard2.0");
#else
        var generator = new IcallTableGenerator();
        generator.OutputPath = Path.GetTempFileName();
        generator.GenIcallTable(icall_table_filename, fileNames);
        Console.WriteLine(File.ReadAllText(generator.OutputPath));
#endif

        return(0);
    }
Exemplo n.º 2
0
    //
    // Given the runtime generated icall table, and a set of assemblies, generate
    // a smaller linked icall table mapping tokens to C function names
    //
    int GenIcallTable(String[] args)
    {
        var icall_table_filename = args [2];
        var fileNames            = args.Skip(3).ToArray();

#if NETFRAMEWORK
        throw new NotSupportedException($"icall table generation is not supported for netstandard2.0");
#else
        Console.WriteLine($"Generating to {args[1]}");

        var generator = new IcallTableGenerator();
        generator.OutputPath = args[2];
        generator.GenIcallTable(icall_table_filename, fileNames);
#endif

        return(0);
    }
Exemplo n.º 3
0
    private void ExecuteInternal()
    {
        var pinvoke = new PInvokeTableGenerator(Log);
        var icall   = new IcallTableGenerator(Log);

        IEnumerable <string> cookies = Enumerable.Concat(
            pinvoke.GenPInvokeTable(PInvokeModules, Assemblies !, PInvokeOutputPath !),
            icall.GenIcallTable(RuntimeIcallTableFile, Assemblies !, IcallOutputPath)
            );

        var m2n = new InterpToNativeGenerator(Log);

        m2n.Generate(cookies, InterpToNativeOutputPath !);

        FileWrites = IcallOutputPath != null
            ? new string[] { PInvokeOutputPath, IcallOutputPath, InterpToNativeOutputPath }
            : new string[] { PInvokeOutputPath, InterpToNativeOutputPath };
    }