예제 #1
0
 public override void Setup()
 {
     base.Setup();
     runner = new DebugRunner(core);
     DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
     CLRModuleType.ClearTypes();
 }
예제 #2
0
 public override void Setup()
 {
     base.Setup();
     runnerConfig             = new ProtoScript.Config.RunConfiguration();
     runnerConfig.IsParrallel = false;
     fsr = new ProtoScript.Runners.DebugRunner(core);
 }
예제 #3
0
 public override void Setup()
 {
     // Specify some of the requirements of IDE.
     fsr = new DebugRunner(core);
     DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
     CLRModuleType.ClearTypes();
 }
예제 #4
0
 public override void Setup()
 {
     base.Setup();
     runnerConfig = new ProtoScript.Config.RunConfiguration();
     runnerConfig.IsParrallel = false;
     fsr = new ProtoScript.Runners.DebugRunner(core);
 }
예제 #5
0
        public void TestCyclicPointer01()
        {
            var core = thisTest.GetTestCore();
            DebugRunner fsr = new DebugRunner(core);
            // Execute and verify the main script in a debug session
            fsr.PreStart(
            @"
class Obj
{
    x : var;
    constructor Obj()
    {
        x = null;
    }
}

p = Obj.Obj();
p.x = p;        // Assign the member x to its own 'this' pointer. This creates a cycle
m = p.x;

            ");

            DebugRunner.VMState vms = fsr.StepOver();
            vms = fsr.StepOver();
            vms = fsr.StepOver();

            // Test the heap contains a cycle
            var runtimeCore = fsr.runtimeCore;
            Assert.IsTrue(runtimeCore.Heap.IsHeapCyclic());

        }
예제 #6
0
파일: Update.cs 프로젝트: tshcha/Dynamo
        public override void Setup()
        {
            base.Setup();

            fsr = new DebugRunner(core);
            DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
            DLLFFIHandler.Register(FFILanguage.CPlusPlus, new ProtoFFI.PInvokeModuleHelper());
            CLRModuleType.ClearTypes();
        }
예제 #7
0
 public override void Setup()
 {
     // Specify some of the requirements of IDE.
     runnerConfig = new ProtoScript.Config.RunConfiguration();
     runnerConfig.IsParrallel = false;
     fsr = new DebugRunner(core);
     DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
     CLRModuleType.ClearTypes();
 }
예제 #8
0
 public override void Setup()
 {
     base.Setup();
     runconfig = new ProtoScript.Config.RunConfiguration();
     runconfig.IsParrallel = false;
     runner = new DebugRunner(core);
     DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
     CLRModuleType.ClearTypes();
 }
예제 #9
0
        public override void Setup()
        {
            base.Setup();
            core.Options.kDynamicCycleThreshold = 5;

            fsr = new DebugRunner(core);

            DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
            CLRModuleType.ClearTypes();
        }
예제 #10
0
 public void Setup()
 {
     // Specify some of the requirements of IDE.
     ProtoCore.Options options = new ProtoCore.Options();
     options.ExecutionMode       = ProtoCore.ExecutionMode.Serial;
     options.SuppressBuildOutput = false;
     core = new ProtoCore.Core(options);
     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 ProtoScript.Runners.DebugRunner(core);
 }
예제 #11
0
파일: Debugger.cs 프로젝트: khoaho/Dynamo
 public void SetUp()
 {
     // Specify some of the requirements of IDE.
     ProtoCore.Options options = new ProtoCore.Options();
     options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
     options.SuppressBuildOutput = false;
     core = new ProtoCore.Core(options);
     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 ProtoScript.Runners.DebugRunner(core);
 }
예제 #12
0
 public void Setup()
 {
     var options = new ProtoCore.Options();
     options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
     options.SuppressBuildOutput = false;
     core_ = new ProtoCore.Core(options);
     core_.Executives.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Executive(core_));
     core_.Executives.Add(ProtoCore.Language.kImperative, new ProtoImperative.Executive(core_));
     runconfig_ = new ProtoScript.Config.RunConfiguration();
     runconfig_.IsParrallel = false;
     runner_ = new DebugRunner(core_);
     DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
     CLRModuleType.ClearTypes();
 }
예제 #13
0
 public void Setup()
 {
     // Specify some of the requirements of IDE.
     var options = new ProtoCore.Options();
     options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
     options.SuppressBuildOutput = false;
     core = new ProtoCore.Core(options);
     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());
     CLRModuleType.ClearTypes();
 }
예제 #14
0
        public void Setup()
        {
            var options = new ProtoCore.Options();

            options.ExecutionMode       = ProtoCore.ExecutionMode.Serial;
            options.SuppressBuildOutput = false;

            core = new ProtoCore.Core(options);
            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());
            DLLFFIHandler.Register(FFILanguage.CPlusPlus, new ProtoFFI.PInvokeModuleHelper());
            CLRModuleType.ClearTypes();
        }
예제 #15
0
파일: BasicTests.cs 프로젝트: ksobon/Dynamo
        public void Setup()
        {
            // Specify some of the requirements of IDE.
            var options = new ProtoCore.Options();
            options.ExecutionMode = ProtoCore.ExecutionMode.Serial;

            core = new ProtoCore.Core(options);
            core.Compilers.Add(ProtoCore.Language.Associative, new ProtoAssociative.Compiler(core));
            core.Compilers.Add(ProtoCore.Language.Imperative, new ProtoImperative.Compiler(core));

            fsr = new DebugRunner(core);

            DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
            CLRModuleType.ClearTypes();
        }
예제 #16
0
 public override void TearDown()
 {
     base.TearDown();
     fsr = null;
 }
예제 #17
0
        internal static ProtoCore.Core DebugRunnerStepOver(string code)
        {
            //Internal setup

            ProtoCore.Core core;
            DebugRunner fsr;
            ProtoScript.Config.RunConfiguration runnerConfig;
            string testPath = @"..\..\..\Scripts\Debugger\";

             // Specify some of the requirements of IDE.
            var options = new ProtoCore.Options();
            options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
            options.SuppressBuildOutput = false;

            core = new ProtoCore.Core(options);
            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());
            CLRModuleType.ClearTypes();

            //Run

            fsr.PreStart(code, runnerConfig);
            DebugRunner.VMState vms = null;

            while (!fsr.isEnded)
                vms = fsr.StepOver();

            return core;
        }
예제 #18
0
 public override void TearDown()
 {
     base.TearDown();
     fsr = null;
 }
예제 #19
0
 public override void Setup()
 {
     base.Setup();
     fsr = new ProtoScript.Runners.DebugRunner(core);
 }
예제 #20
0
        internal static void DebugRunnerStepIn(string includePath, string code, /*string logFile*/Dictionary<int, List<string>> map, 
            bool watchNestedMode = false, string defectID = "")
        {
            //Internal setup
            ProtoCore.Core core;
            DebugRunner fsr;
            
            // Specify some of the requirements of IDE.
            var options = new ProtoCore.Options();
            options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
            options.SuppressBuildOutput = false;
            options.GCTempVarsOnDebug = 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);


            core.Compilers.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Compiler(core));
            core.Compilers.Add(ProtoCore.Language.kImperative, new ProtoImperative.Compiler(core));

            fsr = new DebugRunner(core);

            DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
            
            //Run
            fsr.PreStart(code);


            RuntimeCore runtimeCore = fsr.runtimeCore;

            //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, runtimeCore.DebugProps.CurrentSymbolName, core, runtimeCore, map, watchNestedMode, defectID: defectID);
                        }
                        // if previous breakpoint was at a CALLR
                        else if (opCode == ProtoCore.DSASM.OpCode.CALLR)
                        {
                            if (runtimeCore.DebugProps.IsPopmCall)
                            {
                                int ci = (int)currentVms.mirror.MirrorTarget.rmem.GetAtRelative(ProtoCore.DSASM.StackFrame.kFrameIndexClass).opdata;
                                VerifyWatch_Run(InjectionExecutive.callrLineNo, runtimeCore.DebugProps.CurrentSymbolName, core, runtimeCore, map, watchNestedMode, ci, defectID);
                            }
                        }
                    }
                }
                //isPrevBreakAtPop = false;
            }
            runtimeCore.Cleanup();
        }
예제 #21
0
 public override void Setup()
 {
     base.Setup();
     fsr = new ProtoScript.Runners.DebugRunner(core);
 }
예제 #22
0
파일: Debugger.cs 프로젝트: RobertiF/Dynamo
using System;
예제 #23
0
        internal  static ProtoCore.Core DebugRunnerRunOnly(string code, out RuntimeCore runtimeCore)
        {
            ProtoCore.Core core;
            DebugRunner fsr;

            // Specify some of the requirements of IDE.
            var options = new ProtoCore.Options();
            options.ExecutionMode = ProtoCore.ExecutionMode.Serial;
            options.SuppressBuildOutput = false;
            options.GCTempVarsOnDebug = false;

            string testPath = @"..\..\..\test\Engine\ProtoTest\ImportFiles\";
            options.IncludeDirectories.Add(testPath);

            core = new ProtoCore.Core(options);
            core.Compilers.Add(ProtoCore.Language.kAssociative, new ProtoAssociative.Compiler(core));
            core.Compilers.Add(ProtoCore.Language.kImperative, new ProtoImperative.Compiler(core));

            fsr = new DebugRunner(core);

            DLLFFIHandler.Register(FFILanguage.CSharp, new CSModuleHelper());
            CLRModuleType.ClearTypes();

            //Run

            fsr.PreStart(code);
            DebugRunner.VMState vms = null;

            vms = fsr.Run();
            runtimeCore = fsr.runtimeCore;
            return core;
        }
예제 #24
0
        private void CleanUpRunners()
        {
            Logger.LogInfo("DetachFromDebugger", "Detach");

            // Clear up all watch related data members.
            this.workerParams.CurrentVmState = null;
            this.currentWatchedMirror = null;
            this.currentWatchedStackValue = null;

            if (null != scriptRunner)
                scriptRunner = null;

            if (null != debugRunner)
            {
                debugRunner.Shutdown();
                debugRunner = null;
            }

            if (null != internalWorker)
            {
                // @TODO(Ben): Perhaps cancellation is needed?
                internalWorker = null;
            }

            //Fix DG-1464973 Sprint25: rev 3444 : Multiple import issue - dispose core after execution
            //Core Cleanup should happen only after execution has finished,
            //DebugRunner is ShutDown.
            if (null != this.core)
            {
                this.core.Cleanup();
                this.core = null;
            }

            workerParams.ResetStates();
            SetExecutionState(ExecutionStateChangedEventArgs.States.None);
        }
예제 #25
0
        private bool SetupDebugRunner(string scriptPath)
        {
            if (string.IsNullOrEmpty(scriptPath))
                return false; // No script to execute.
            if (File.Exists(scriptPath) == false)
                return false; // File does not exist.

            Logger.LogInfo("SetupDebugRunner", "Init");
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            SetupCommonRunner(true);

            RunConfiguration runnerConfig = new RunConfiguration();
            runnerConfig.IsParrallel = false;

            #if DEBUG
            var verboseFlag = this.core.Options.Verbose;
            var prevAsmOutput = this.core.AsmOutput;

            this.core.Options.Verbose = true;

            this.ByteCodeStream = new MemoryStream();
            this.core.AsmOutput = new StreamWriter(this.ByteCodeStream);
            #endif

            debugRunner = new DebugRunner(this.core);
            bool startSucceeded = debugRunner.LoadAndPreStart(scriptPath, runnerConfig);

            #if DEBUG
            this.core.Options.Verbose = verboseFlag;
            this.core.AsmOutput.Close();
            this.core.AsmOutput = prevAsmOutput == null ? Console.Out : prevAsmOutput;
            #endif

            Logger.LogPerf("SetupDebugRunner", sw.ElapsedMilliseconds + " ms");
            return startSucceeded;
        }