public VMItem(XmlAttributeCollection MachineAttrs) { string home = Environment.GetFolderPath(Environment.SpecialFolder.Personal); uuid = MachineAttrs["uuid"].Value.Replace("{", "").Replace("}", ""); //find machine specific xml file string MachineSource = MachineAttrs["src"].Value; if (!File.Exists(MachineSource)) { MachineSource = Path.Combine(Path.Combine(home, ".VirtualBox"), MachineSource); } //find the OS type of the machine XmlDocument MachineDoc = new XmlDocument(); MachineDoc.Load(MachineSource); XmlNodeList MachineInfo = MachineDoc.GetElementsByTagName("Machine"); name = MachineInfo[0].Attributes["name"].Value; try { string icon = IconMap.LookUp(MachineInfo[0].Attributes["OSType"].Value); ico_file = string.Format("os_{0}.png@{1}", icon, GetType().Assembly.FullName); } catch //something went bad trying to assign an icon { Log <VMItem> .Warn("Could not determine machine type for VM: {0}", name); ico_file = string.Format("VirtualBox_64px.png@{0}", GetType().Assembly.FullName); } this.state = CurrentState; Log <VMItem> .Info("VM: {0} indexed [State: {1} Uuid: {2}]", name, state, uuid); }
public VMState StepOut() { VMState vms = null; DebuggerStateCheckBeforeRun(); if (core.DebugProps.DebugStackFrameContains(ProtoCore.DebugProperties.StackFrameFlagOptions.FepRun)) { core.DebugProps.RunMode = ProtoCore.Runmode.StepOut; core.DebugProps.AllbreakPoints = allbreakPoints; core.DebugProps.StepOutReturnPC = (int)core.Rmem.GetAtRelative(StackFrame.kFrameIndexReturnAddress).opdata; List <Instruction> instructions = new List <Instruction>(); foreach (Breakpoint bp in RegisteredBreakpoints) { instructions.Add(BreakpointToInstruction(bp)); } vms = RunVM(instructions); } else { vms = Run(); } return(vms); }
//complicated constructor if you want to supply everything public VMThread(string o1, string o2, VMState ns, ref VMItem v) { this.op1 = o1; this.op2 = o2; this.NewState = ns; this.vm = v; }
public VMDynItm(string n, string d, string i, VMState m) { name = n; desc = d; icon = i; mode = m; }
public override void DragMove(Coordinate distance) { if (_state == VMState.None) return; _state = VMState.Moving; // Move the origin point by the delta value _origin.Move(distance); }
protected override void Reload(VMState state) { if (state != null) { SelectedBookItem = EDOUtils.FindOrFirst(books, state.State1); } }
public VMState StepOver() { DebuggerStateCheckBeforeRun(); // check if the current instruction is a function call instruction // if it is, set a breakpoint at the next instruction and call Run // if not, call Step VMState vms = null; core.DebugProps.AllbreakPoints = allbreakPoints; Instruction instr = GetCurrentInstruction(); if (instr.opCode == OpCode.CALL || instr.opCode == OpCode.CALLR) { core.DebugProps.RunMode = ProtoCore.Runmode.StepNext; List <Instruction> instructions = new List <Instruction>(); foreach (Breakpoint bp in RegisteredBreakpoints) { instructions.Add(BreakpointToInstruction(bp)); } vms = RunVM(instructions); } else { vms = Step(); } return(vms); }
/// <summary> /// Viewの切り替え時に実行されます。 /// </summary> public void Reload() { //It is called when DataContext is changed. //Restore the state here Reload(state); state = null; }
public VMDetails(string VMID, string resourceGroup, VMState VMState, string size, string region) { PartitionKey = resourceGroup; RowKey = VMID; Region = region; Size = Size; State = VMState; }
public override void ToolSelected(bool preventHistory) { _state = VMState.None; _originals = MainTool.Points.ToDictionary(x => x, x => x.Coordinate); DocumentGridSpacingChanged(Document.Map.GridSpacing); ResetOrigin(null); Mediator.Subscribe(EditorMediator.DocumentGridSpacingChanged, this); }
public static T FindOrFirst <T>(Collection <T> collection, VMState state) where T : class, IStringIDProvider { if (state == null) { return(GetFirst(collection)); } return(FindOrFirst <T>(collection, state.State1)); }
public async Task <IEnumerable <VMDetails> > GetAllVMsInStateAsync(VMState state) { CloudTable table = tableClient.GetTableReference(tableName); var query = new TableQuery <VMDetails>().Where (TableQuery.GenerateFilterConditionForInt(nameof(VMDetails.VMStateValue), QueryComparisons.Equal, Convert.ToInt32(state))); return(await GetAllFromTableAsync(table, query)); }
public void Execute() { State &= ~VMState.BREAK; while (!State.HasFlag(VMState.HALT) && !State.HasFlag(VMState.FAULT) && !State.HasFlag(VMState.BREAK)) { StepInto(); } }
void IInteroperable.FromStackItem(StackItem stackItem) { Struct @struct = (Struct)stackItem; BlockIndex = (uint)@struct[0].GetInteger(); _rawTransaction = @struct[1]; Transaction = _rawTransaction.GetSpan().AsSerializable <Transaction>(); State = (VMState)(byte)@struct[2].GetInteger(); }
/// <summary> /// Setup to run with the default options /// </summary> /// <summary> /// Perform one execution step on the VM /// </summary> /// <returns></returns> /// public VMState Step() { DebuggerStateCheckBeforeRun(); core.DebugProps.RunMode = ProtoCore.Runmode.StepIn; core.DebugProps.AllbreakPoints = allbreakPoints; lastState = RunVM(allbreakPoints); return(lastState); }
protected override Action GetCompleteAction(VMState state) { return(() => { foreach (SamplingVM sampling in Samplings) { sampling.GenerateCollector(); } }); }
public override void DragStart(List <VMPoint> clickedPoints) { if (!clickedPoints.Contains(_origin)) { return; } _state = VMState.Down; Editor.Instance.CaptureAltPresses = true; }
public override VMState SaveState() { VMState state = new VMState(); if (SelectedControlConstructScheme != null) { state.State1 = SelectedControlConstructScheme.Id; } return(state); }
public override VMState SaveState() { VMState state = new VMState(); if (SelectedBook != null) { state.State1 = SelectedBook.Id; } return(state); }
public override void DragMove(Coordinate distance) { if (_state == VMState.None) { return; } _state = VMState.Moving; // Move the origin point by the delta value _origin.Move(distance); }
public override void DragEnd() { if (_state == VMState.Moving) { if (AutomaticallyMerge()) CheckMergedVertices(); else MainTool.SetDirty(true, true); } _state = VMState.None; Editor.Instance.CaptureAltPresses = false; }
public void StepOut() { State &= ~VMState.BREAK; int c = InvocationStack.Count; while (!State.HasFlag(VMState.HALT) && !State.HasFlag(VMState.FAULT) && !State.HasFlag(VMState.BREAK) && InvocationStack.Count >= c) { StepInto(); } }
protected override void Reload(VMState state) { if (state != null) { SelectedDataFile = EDOUtils.Find(dataFiles, state.State1); } if (SelectedDataFile == null) { SelectedDataFile = EDOUtils.GetFirst(dataFiles); } }
protected override void Reload(VMState state) { if (state != null) { SelectedVariableItem = EDOUtils.Find(variables, state.State1); } if (SelectedVariableItem == null || !Variables.Contains(SelectedVariable)) { SelectedVariableItem = EDOUtils.GetFirst <VariableVM>(variables); } }
protected override void Reload(VMState state) { if (state != null) { SelectedItem = EDOUtils.Find(fundingInfos, state.State1); } if (SelectedItem == null) { SelectedItem = fundingInfos.FirstOrNull(); } }
protected override void Reload(VMState state) { if (state != null) { SelectedControlConstructScheme = EDOUtils.Find(ControlConstructSchemes, state.State1); } if (SelectedControlConstructScheme == null) { SelectedControlConstructScheme = ControlConstructSchemes.FirstOrNull(); } }
public override void DragMove(Coordinate distance) { _state = VMState.Moving; // Move each selected point by the delta value foreach (var p in MainTool.GetSelectedPoints()) { p.Move(distance); } //MainTool.SetDirty(false, false); }
internal VM(Instruction[] program, Body body, object[] parameters) { _instructions = program; Ip = 0; State = VMState.Next; Stack = new Stack(); Locals = new LocalStorage(); VMBody = body; Parameters = parameters; }
protected override void Reload(VMState state) { if (state != null) { selectedSamplingItem = EDOUtils.Find(Samplings, state.State1); } if (selectedSamplingItem == null) { selectedSamplingItem = Samplings.FirstOrNull(); } }
protected override void Reload(VMState state) { if (state != null) { SelectedCodeScheme = EDOUtils.Find(codeSchemes, state.State1); } if (SelectedCodeScheme == null) { SelectedCodeScheme = EDOUtils.GetFirst(codeSchemes); } }
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) { core.NotifyExecutionEvent(ProtoCore.ExecutionStateEventArgs.State.kExecutionResume); } Execute(core.DebugProps.DebugEntryPC, breakPoints); isEnded = true; // the script has ended smoothly, } catch (ProtoCore.Exceptions.DebugHalting) { if (core.CurrentExecutive == null) //This was before the VM was properly started { return(null); } currentInstr = GetCurrentInstruction(); // set the current instruction to the current breakpoint instruction core.NotifyExecutionEvent(ProtoCore.ExecutionStateEventArgs.State.kExecutionBreak); executionsuspended = true; } catch (ProtoCore.Exceptions.EndOfScript) { isEnded = true; } finally { ExecutionMirror execMirror = new ProtoCore.DSASM.Mirror.ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core); 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); }
public void Execute(Action <ExecutionEngine> onStep = null) { State &= ~VMState.BREAK; while (!State.HasFlag(VMState.HALT) && !State.HasFlag(VMState.FAULT) && !State.HasFlag(VMState.BREAK)) { if (onStep != null) { onStep(this); } StepInto(); } }
public override void ToolSelected(bool preventHistory) { _state = VMState.None; _originals = MainTool.Points.ToDictionary(x => x, x => x.Coordinate); ResetOrigin(null); }
public override void MouseClick(ViewportBase viewport, ViewportEvent e) { _state = VMState.None; }
public override void ToolDeselected(bool preventHistory) { _state = VMState.None; Mediator.UnsubscribeAll(this); }
public override void ToolSelected(bool preventHistory) { _state = VMState.None; UpdateSplitEnabled(); Mediator.Subscribe(HotkeysMediator.VMSplitFace, this); }
public override void DragStart(List<VMPoint> clickedPoints) { _state = VMState.Down; Editor.Instance.CaptureAltPresses = true; }
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; }
public void Shutdown() { if (lastState != null) lastState.Invalidate(); try { //core.heap.Free(); } catch (Exception) { } //Drop the VM state objects so they can be GCed runtimeCore.NotifyExecutionEvent(ProtoCore.ExecutionStateEventArgs.State.kExecutionEnd); lastState = null; core = null; }
/// <summary> /// Setup to run with the default options /// </summary> /// <summary> /// Perform one execution step on the VM /// </summary> /// <returns></returns> /// public VMState Step() { DebuggerStateCheckBeforeRun(); runtimeCore.DebugProps.RunMode = ProtoCore.Runmode.StepIn; runtimeCore.DebugProps.AllbreakPoints = allbreakPoints; lastState = RunVM(allbreakPoints); return lastState; }
public override void DragStart(List<VMPoint> clickedPoints) { if (!clickedPoints.Contains(_origin)) return; _state = VMState.Down; Editor.Instance.CaptureAltPresses = true; }
public override void ToolDeselected() { _state = VMState.None; _originals = null; Mediator.UnsubscribeAll(this); }
public override void DragEnd() { _state = VMState.None; Editor.Instance.CaptureAltPresses = false; }
public override void ToolSelected() { _state = VMState.None; _originals = MainTool.Points.ToDictionary(x => x, x => x.Coordinate); DocumentGridSpacingChanged(Document.Map.GridSpacing); ResetOrigin(null); Mediator.Subscribe(EditorMediator.DocumentGridSpacingChanged, this); }