本文整理汇总了C#中ProtoCore.Core.Cleanup方法的典型用法代码示例。如果您正苦于以下问题:C# Core.Cleanup方法的具体用法?C# Core.Cleanup怎么用?C# Core.Cleanup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProtoCore.Core
的用法示例。
在下文中一共展示了Core.Cleanup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DebugRunnerStepIn
internal static void DebugRunnerStepIn(string includePath, string code, /*string logFile*/Dictionary<int, List<string>> map, bool watchNestedMode = false)
{
//Internal setup
ProtoCore.Core core;
DebugRunner fsr;
ProtoScript.Config.RunConfiguration runnerConfig;
// Specify some of the requirements of IDE.
var options = new ProtoCore.Options();
options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
options.SuppressBuildOutput = false;
// Cyclic dependency threshold is lowered from the default (2000)
// as this causes the test framework to be painfully slow
options.kDynamicCycleThreshold = 5;
// Pass the absolute path so that imported filepaths can be resolved
// in "FileUtils.GetDSFullPathName()"
if (!String.IsNullOrEmpty(includePath))
{
includePath = Path.GetDirectoryName(includePath);
options.IncludeDirectories.Add(includePath);
}
core = new ProtoCore.Core(options);
// Use the InjectionExecutive to overload POP and POPM
// as we still need the symbol names and line nos. in debug mode for comparisons
core.ExecutiveProvider = new InjectionExecutiveProvider();
core.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core));
core.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core));
runnerConfig = new ProtoScript.Config.RunConfiguration();
runnerConfig.IsParrallel = false;
fsr = new DebugRunner(core);
DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
//Run
fsr.PreStart(code, runnerConfig);
//StreamReader log = new StreamReader(logFile);
//bool isPrevBreakAtPop = false;
int lineAtPrevBreak = -1;
string symbolName = null;
DebugRunner.VMState vms = null;
while (!fsr.isEnded)
{
vms = fsr.LastState;
OpCode opCode = OpCode.NONE;
DebugInfo debug = null;
if (vms != null)
{
// check if previous break is a POP
// if so, get the line no. and LHS
opCode = fsr.CurrentInstruction.opCode;
debug = fsr.CurrentInstruction.debug;
if (opCode == ProtoCore.DSASM.OpCode.POP)
{
//isPrevBreakAtPop = true;
lineAtPrevBreak = vms.ExecutionCursor.StartInclusive.LineNo;
}
}
DebugRunner.VMState currentVms = fsr.Step();
//if (isPrevBreakAtPop)
if (debug != null)
{
// Do not do the verification for imported DS files, for which the FilePath is non null
if (debug.Location.StartInclusive.SourceLocation.FilePath == null)
{
if (opCode == ProtoCore.DSASM.OpCode.POP)
{
VerifyWatch_Run(lineAtPrevBreak, core.DebugProps.CurrentSymbolName, core, map, watchNestedMode);
}
// if previous breakpoint was at a CALLR
else if (opCode == ProtoCore.DSASM.OpCode.CALLR)
{
if (core.DebugProps.IsPopmCall)
{
int ci = (int)currentVms.mirror.MirrorTarget.rmem.GetAtRelative(ProtoCore.DSASM.StackFrame.kFrameIndexClass).opdata;
VerifyWatch_Run(InjectionExecutive.callrLineNo, core.DebugProps.CurrentSymbolName, core, map, watchNestedMode, ci);
}
}
}
}
//isPrevBreakAtPop = false;
}
core.Cleanup();
}