本文整理汇总了C#中ProtoCore.CodeModel.CodePoint类的典型用法代码示例。如果您正苦于以下问题:C# ProtoCore.CodeModel.CodePoint类的具体用法?C# ProtoCore.CodeModel.CodePoint怎么用?C# ProtoCore.CodeModel.CodePoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProtoCore.CodeModel.CodePoint类属于命名空间,在下文中一共展示了ProtoCore.CodeModel.CodePoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Defect_1467570_Crash_In_Debug_Mode
public void Defect_1467570_Crash_In_Debug_Mode()
{
string src = @"
class Test
{
IntArray : int[];
constructor FirstApproach(intArray : int[])
{
IntArray = intArray;
}
def Transform(adjust : int)
{
return = Test.FirstApproach(this.IntArray + adjust);
}
}
myTest = Test.FirstApproach({ 1, 2 });
myNeTwst = myTest.Transform(1);
";
fsr.PreStart(src, runnerConfig);
DebugRunner.VMState vms = fsr.Step(); // myTest = Test.FirstApproach({ 1, 2 });
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 15,
CharNo = 5
};
示例2: T001_SampleTest
public void T001_SampleTest()
{
//string errorString = "1463735 - Sprint 20 : rev 2147 : breakpoint cannot be set on property ' setter' and 'getter' methods ";
string src = string.Format("{0}{1}", testCasePath, "T001_SampleTest.ds");
fsr.LoadAndPreStart(src, runnerConfig);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
CharNo = 8,
LineNo = 17,
SourceLocation = new ProtoCore.CodeModel.CodeFile
{
FilePath = Path.GetFullPath(src)
}
};
fsr.ToggleBreakpoint(cp);
// First step should land on line "p = Point.Point();".
ProtoScript.Runners.DebugRunner.VMState vms = fsr.StepOver();
Assert.AreEqual(14, vms.ExecutionCursor.StartInclusive.LineNo);
// These are not used for now, so I'm commenting them out.
// Object[] exp = { 1, 2, 3, new object[] { 4, 5 }, 6.0, 7, new object[] { 8.0, 9 } };
// Object[] exp2 = new Object[] { exp, 10 };
Obj stackValue = null;
try
{
stackValue = vms.mirror.GetDebugValue("y");
}
catch (ProtoCore.DSASM.Mirror.UninitializedVariableException exception)
{
// Variable "y" isn't valid as of now.
Assert.AreEqual("y", exception.Name);
}
vms = fsr.Run(); // Run to breakpoint on property setter "p.x = 20;".
Assert.AreEqual(17, vms.ExecutionCursor.StartInclusive.LineNo);
Assert.AreEqual(5, vms.ExecutionCursor.StartInclusive.CharNo);
Assert.AreEqual(17, vms.ExecutionCursor.EndExclusive.LineNo);
Assert.AreEqual(14, vms.ExecutionCursor.EndExclusive.CharNo);
stackValue = vms.mirror.GetDebugValue("y");
Assert.AreEqual("10", stackValue.Payload.ToString());
}
示例3: ToggleBreakPoint005
public void ToggleBreakPoint005()
{
string src = @"
a = 10; // single value
b = a * 2;
a = { 1, 4, -2 }; // arbitrary collection
a = 1..10; // range expression... assume 1 as increment
a = 1..10..2; // range expression with defined increment
a = 1..10..~2; // range expression with 'appropriate' increment
a = 1..10..#3; // range expression with specified number of cases
a = 10; // back to single values;
b = 2;
c = a * b; // define an expression;
a = 10..12;
b = 2..4;
c = a<2> * b<1>; // cartesian replication
";
// Tracked by http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-3991
string defectID = "MAGN-3991 Defects with Toggle breakpoint";
fsr.PreStart(src);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 18,
CharNo = 5
};
fsr.ToggleBreakpoint(cp);
DebugRunner.VMState vms = fsr.Run();
Obj o2 = vms.mirror.GetDebugValue("b");
Assert.IsTrue((Int64)o2.Payload == 2, defectID);
fsr.Run();
Assert.IsTrue(vms.isEnded, defectID);
}
示例4: ToggleBreakPoint_Associative_004
public void ToggleBreakPoint_Associative_004()
{
string src = @"
a : int = 0;
b : int = 0;
[Associative]
{
a = 10;
b = a * 2;
a = 15;
}
";
fsr.PreStart(src);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 8,
CharNo = 8
};
fsr.ToggleBreakpoint(cp);
fsr.Step();
DebugRunner.VMState vms = fsr.Run();
Obj o2 = vms.mirror.GetDebugValue("a");
Assert.IsTrue((Int64)o2.Payload == 10);
vms = fsr.Run();
vms = fsr.Run();
Assert.IsTrue(vms.isEnded);
}
示例5: ToggleBreakPoint001
public void ToggleBreakPoint001()
{
string src = @"
def foo : int(i : int, j : int)
{
return = i + j;
}
a = 0;
a = 1 + 2 + foo(3, 4) + 5 + foo(5, 6);
";
// Tracked by http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-3991
string defectID = "MAGN-3991 Defects with Toggle breakpoint";
fsr.PreStart(src);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 7,
CharNo = 44
};
fsr.ToggleBreakpoint(cp);
cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 7,
CharNo = 60
};
fsr.ToggleBreakpoint(cp);
DebugRunner.VMState vms = fsr.Run();
Obj o = vms.mirror.GetDebugValue("a");
vms = fsr.Run();
Obj o2 = vms.mirror.GetDebugValue("a");
Assert.IsTrue((Int64)o.Payload == 0, defectID);
Assert.IsTrue((Int64)o2.Payload == 26, defectID);
}
示例6: breakPoint_Cursor_1471
public void breakPoint_Cursor_1471()
{
string src = @"
class Point
{
}
p = 0..10..#5;
def foo()
{
return = 5;
}
isPass5 = foo() == 5 ? true : false; // verification
startPts = Point.Point();
isPass6 = foo() == 5 ? true : false ; // verification
endPts = foo() >= 1 ? Point.Point() : Point.Point();
isPass7 = foo() == 5 ? true : false ; // verification";
fsr.PreStart(src);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 13,
CharNo = 10
};
fsr.ToggleBreakpoint(cp);
fsr.Run();
DebugRunner.VMState vms = fsr.Run();
Assert.IsTrue(vms.isEnded);
}
示例7: T27_Modifier_Stack_Update
public void T27_Modifier_Stack_Update()
{
string src = string.Format("{0}{1}", testPath, "T27_Modifier_Stack_Update.ds");
fsr.LoadAndPreStart(src);
ProtoCore.CodeModel.CodePoint cp1 = new ProtoCore.CodeModel.CodePoint
{
CharNo = 8,
LineNo = 9,
SourceLocation = new ProtoCore.CodeModel.CodeFile
{
FilePath = Path.GetFullPath(src)
}
};
ProtoCore.CodeModel.CodePoint cp2 = new ProtoCore.CodeModel.CodePoint
{
CharNo = 2,
LineNo = 10,
SourceLocation = new ProtoCore.CodeModel.CodeFile
{
FilePath = Path.GetFullPath(src)
}
};
ProtoCore.CodeModel.CodePoint cp3 = new ProtoCore.CodeModel.CodePoint
{
CharNo = 2,
LineNo = 11,
SourceLocation = new ProtoCore.CodeModel.CodeFile
{
FilePath = Path.GetFullPath(src)
}
};
fsr.ToggleBreakpoint(cp1);
ProtoScript.Runners.DebugRunner.VMState vms = fsr.Run();
thisTest.DebugModeVerification(vms.mirror, "a", 4);
fsr.ToggleBreakpoint(cp2);
fsr.Run();
thisTest.DebugModeVerification(vms.mirror, "a", 5);
fsr.ToggleBreakpoint(cp3);
fsr.Run();
Object n1 = null;
thisTest.DebugModeVerification(vms.mirror, "a", n1);
fsr.Run();
}
示例8: ToggleBreakPoint002
public void ToggleBreakPoint002()
{
string src = @"
def foo : int(i : int, j : int)
{
return = i + j;
}
a = 0;
a = 1 + 2 + foo(3, 4) + 5 + foo(5, 6);
";
fsr.PreStart(src);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 7,
CharNo = 44
};
fsr.ToggleBreakpoint(cp);
cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 7,
CharNo = 60
};
fsr.ToggleBreakpoint(cp);
fsr.ToggleBreakpoint(cp);
DebugRunner.VMState vms = fsr.Run();
Obj o = vms.mirror.GetDebugValue("a");
vms = fsr.Run();
Obj o2 = vms.mirror.GetDebugValue("a");
Assert.IsTrue((Int64)o.Payload == 0);
Assert.IsTrue((Int64)o2.Payload == 26);
Assert.IsTrue(vms.isEnded);
}
示例9: AddEntry
public void AddEntry(ProtoCore.DSASM.SymbolNode sn, int line, int col, string file)
{
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint()
{
LineNo = line,
CharNo = col,
SourceLocation = new ProtoCore.CodeModel.CodeFile()
{
FilePath = file
}
};
Table[sn] = cp;
}
示例10: TV88_Defect_1463489_3
public void TV88_Defect_1463489_3()
{
// Tracked by http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-1510
string src = string.Format("{0}{1}", testPath, "TV88_Defect_1463489_3.ds");
fsr.LoadAndPreStart(src);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
CharNo = 8,
LineNo = 35,
SourceLocation = new ProtoCore.CodeModel.CodeFile
{
FilePath = Path.GetFullPath(src)
}
};
fsr.ToggleBreakpoint(cp);
ProtoScript.Runners.DebugRunner.VMState vms = fsr.Run();
Assert.AreEqual((bool)vms.mirror.GetDebugValue("y1").Payload, true);
Assert.AreEqual((bool)vms.mirror.GetDebugValue("y3").Payload, true);
Assert.AreEqual((bool)vms.mirror.GetDebugValue("y2").Payload, false);
Assert.AreEqual((bool)vms.mirror.GetDebugValue("y4").Payload, false);
fsr.Run();
Assert.AreEqual((bool)vms.mirror.GetDebugValue("y1").Payload, false);
Assert.AreEqual((bool)vms.mirror.GetDebugValue("y3").Payload, false);
Assert.AreEqual((bool)vms.mirror.GetDebugValue("y2").Payload, true);
Assert.AreEqual((bool)vms.mirror.GetDebugValue("y4").Payload, true);
}
示例11: Defect_1467570_Crash_In_Debug_Mode
public void Defect_1467570_Crash_In_Debug_Mode()
{
string src = @"
class Test
{
IntArray : int[];
constructor FirstApproach(intArray : int[])
{
IntArray = intArray;
}
def Transform(adjust : int)
{
return = Test.FirstApproach(this.IntArray + adjust);
}
}
myTest = Test.FirstApproach({ 1, 2 });
myNeTwst = myTest.Transform(1);
";
// Tracked by http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-3989
string defectID = "MAGN-3989 Inspection of 'this' pointer has issues in expression interpreter";
fsr.PreStart(src);
DebugRunner.VMState vms = fsr.Step(); // myTest = Test.FirstApproach({ 1, 2 });
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 15,
CharNo = 5
};
fsr.ToggleBreakpoint(cp);
fsr.Run(); // line containing "this"
ExpressionInterpreterRunner watchRunner = new ExpressionInterpreterRunner(core, fsr.runtimeCore);
ExecutionMirror mirror = watchRunner.Execute(@"this");
Obj objExecVal = mirror.GetWatchValue();
Assert.AreNotEqual(null, objExecVal);
Assert.AreNotEqual(null, objExecVal.Payload, defectID);
Assert.AreEqual(mirror.GetType(objExecVal), "Test");
vms = fsr.StepOver();
watchRunner = new ExpressionInterpreterRunner(core, fsr.runtimeCore);
mirror = watchRunner.Execute(@"this");
objExecVal = mirror.GetWatchValue();
Assert.AreNotEqual(null, objExecVal);
Assert.AreEqual(-1, (Int64)objExecVal.Payload, defectID);
Assert.AreEqual(mirror.GetType(objExecVal), "null");
}
示例12: Defect_711_debug_GC_array_itemmodified
public void Defect_711_debug_GC_array_itemmodified()
{
string src = @"
import(""ProtoGeometry.dll"");
WCS = CoordinateSystem.Identity();
class SphereCone
{
shape;
constructor(x, y, z, size)
{
Origin = Point.ByCoordinates(x, y, z);
shape = {
Sphere.ByCenterPointRadius(Origin, size * 0.25),
Cone.ByCenterLineRadius(Line.ByStartPointDirectionLength(Origin, CoordinateSystem.WCS.ZAxis, -size), size * 0.01, size * 0.5)
};
}
}
xs = -12..12..12; // xs = {-12, 0, 12}
sizes = 2..2..#Count(xs); //
shapes = SphereCone(xs, 10, 0, sizes);
xs = -12..12..6;
[Imperative]
{
for(index in 0..4)
{
sizes[index] = index + 1;
}
}
shapes[2] = Sphere.ByCenterPointRadius(WCS.Origin, 1);
";
fsr.PreStart(src, runnerConfig);
DebugRunner.VMState vms = fsr.Step(); // myTest = Test.FirstApproach({ 1, 2 });
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 29,
CharNo = 5
};
fsr.ToggleBreakpoint(cp);
fsr.Run(); // closing brace of Transform()
ExpressionInterpreterRunner watchRunner = new ExpressionInterpreterRunner(core);
ExecutionMirror mirror = watchRunner.Execute(@"shapes");
Obj objExecVal = mirror.GetWatchValue();
Assert.AreNotEqual(null, objExecVal);
Assert.AreNotEqual(null, objExecVal.Payload);
List<Obj> lo = vms.mirror.GetArrayElements(objExecVal);
string type1 = vms.mirror.GetType(lo[0]);
string type2 = vms.mirror.GetType(lo[1]);
string type3 = vms.mirror.GetType(lo[2]);
string type4 = vms.mirror.GetType(lo[3]);
string type5 = vms.mirror.GetType(lo[4]);
Assert.IsTrue(type1 == "SphereCone");
Assert.IsTrue(type2 == "SphereCone");
Assert.IsTrue(type3 == "Sphere");
Assert.IsTrue(type4 == "SphereCone");
Assert.IsTrue(type5 == "SphereCone");
}
示例13: ToggleBreakPoint005
public void ToggleBreakPoint005()
{
string src = @"
a = 10; // single value
b = a * 2;
a = { 1, 4, -2 }; // arbitrary collection
a = 1..10; // range expression... assume 1 as increment
a = 1..10..2; // range expression with defined increment
a = 1..10..~2; // range expression with 'appropriate' increment
a = 1..10..#3; // range expression with specified number of cases
a = 10; // back to single values;
b = 2;
c = a * b; // define an expression;
a = 10..12;
b = 2..4;
c = a<2> * b<1>; // cartesian replication
";
fsr.PreStart(src, runnerConfig);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 9,
CharNo = 5
};
fsr.ToggleBreakpoint(cp);
fsr.Run();
DebugRunner.VMState vms = fsr.Run();
Obj o2 = vms.mirror.GetDebugValue("b");
Assert.IsTrue((Int64)o2.Payload == 2);
Assert.IsTrue(vms.isEnded);
}
示例14: ToggleBreakPoint006
public void ToggleBreakPoint006()
{
string src = @"
a=1;
";
fsr.PreStart(src);
ProtoCore.CodeModel.CodePoint cp = new ProtoCore.CodeModel.CodePoint
{
LineNo = 1,
CharNo = 2
};
fsr.ToggleBreakpoint(cp);
DebugRunner.VMState vms = fsr.Run();
Obj o2 = vms.mirror.GetDebugValue("a");
Assert.IsTrue((Int64)o2.Payload == 1);
Assert.IsTrue(vms.isEnded);
}
示例15: RunVM
private VMState RunVM(List<Instruction> breakPoints)
{
//Get the next available location and set a break point
//Unset the break point at the current location
Instruction currentInstr = null; // will be instantialized when a proper breakpoint is reached
VMState vms = null;
try
{
if (executionsuspended)
runtimeCore.NotifyExecutionEvent(ProtoCore.ExecutionStateEventArgs.State.kExecutionResume);
Execute(runtimeCore.DebugProps.DebugEntryPC, breakPoints);
isEnded = true; // the script has ended smoothly,
}
catch (ProtoCore.Exceptions.DebugHalting)
{
if (runtimeCore.CurrentExecutive == null) //This was before the VM was properly started
return null;
currentInstr = GetCurrentInstruction(); // set the current instruction to the current breakpoint instruction
runtimeCore.NotifyExecutionEvent(ProtoCore.ExecutionStateEventArgs.State.kExecutionBreak);
executionsuspended = true;
}
catch (ProtoCore.Exceptions.EndOfScript)
{
isEnded = true;
}
finally
{
ExecutionMirror execMirror = new ProtoCore.DSASM.Mirror.ExecutionMirror(runtimeCore.CurrentExecutive.CurrentDSASMExec, runtimeCore);
vms = new VMState(execMirror, core);
vms.isEnded = isEnded;
ProtoCore.CodeModel.CodePoint start = new ProtoCore.CodeModel.CodePoint();
ProtoCore.CodeModel.CodePoint end = new ProtoCore.CodeModel.CodePoint();
if (currentInstr != null) // equal to null means that the whole script has ended, reset the cursor
{
start = InstructionToBeginCodePoint(currentInstr);
end = InstructionToEndCodePoint(currentInstr);
}
CurrentInstruction = currentInstr;
vms.ExecutionCursor = new ProtoCore.CodeModel.CodeRange { StartInclusive = start, EndExclusive = end };
}
return vms;
}