Exemple #1
0
        protected override string GenerateResponseFileCommands()
        {
            var args = new Dictionary <string, string>
            {
                ["KernelPkg"]   = KernelPkg,
                ["EnableDebug"] = DebugEnabled.ToString(),
                ["EnableStackCorruptionDetection"] = StackCorruptionDetectionEnabled.ToString(),
                ["StackCorruptionDetectionLevel"]  = StackCorruptionDetectionLevel,
                ["DebugMode"]                = DebugMode,
                ["TraceAssemblies"]          = TraceAssemblies,
                ["DebugCom"]                 = DebugCom.ToString(),
                ["TargetAssembly"]           = Path.GetFullPath(TargetAssembly),
                ["OutputFilename"]           = Path.GetFullPath(OutputFilename),
                ["EnableLogging"]            = EnableLogging.ToString(),
                ["EmitDebugSymbols"]         = EmitDebugSymbols.ToString(),
                ["IgnoreDebugStubAttribute"] = IgnoreDebugStubAttribute.ToString(),
            }.ToList();

            foreach (var reference in References)
            {
                args.Add(new KeyValuePair <string, string>("References", reference.ItemSpec));
            }

            foreach (var plugsReference in PlugsReferences)
            {
                args.Add(new KeyValuePair <string, string>("PlugsReferences", plugsReference.ItemSpec));
            }

            return(String.Join(Environment.NewLine, args.Select(a => $"{a.Key}:{a.Value}")));
        }
Exemple #2
0
        protected override string GenerateCommandLineCommands()
        {
            Dictionary <string, string> args = new Dictionary <string, string>
            {
                { "KernelPkg", KernelPkg },
                { "EnableDebug", DebugEnabled.ToString() },
                { "EnableStackCorruptionDetection", StackCorruptionDetectionEnabled.ToString() },
                { "StackCorruptionDetectionLevel", StackCorruptionDetectionLevel },
                { "DebugMode", DebugMode },
                { "TraceAssemblies", TraceAssemblies },
                { "DebugCom", DebugCom.ToString() },
                { "OutputFilename", Path.GetFullPath(OutputFilename) },
                { "EnableLogging", EnableLogging.ToString() },
                { "EmitDebugSymbols", EmitDebugSymbols.ToString() },
                { "IgnoreDebugStubAttribute", IgnoreDebugStubAttribute.ToString() }
            };

            List <string> refs =
                (from reference in References
                 where reference.MetadataNames.OfType <string>().Contains("FullPath")
                 select reference.GetMetadata("FullPath")
                 into xFile
                 select Convert.ToString(xFile)).ToList();

            string Arguments = args.Aggregate("", (current, arg) => current + "\"" + arg.Key + ":" + arg.Value + "\" ");

            Arguments = refs.Aggregate(Arguments, (current, Ref) => current + "\"References:" + Ref + "\" ");
            Arguments = AssemblySearchDirs.Split(';').Aggregate(Arguments, (current, Dir) => current + "\"AssemblySearchDirs:" + Dir + "\" ");

            // replace \" by \\"
            Arguments = Arguments.Replace("\\\"", "\\\\\"");

            Log.LogMessage(MessageImportance.High, $"Invoking IL2CPU.exe {Arguments}");

            return(Arguments);
        }