internal async Task <bool> CheckForMicroBooterAsync(CancellationToken cancellationToken) { if (DebugEngine == null) { return(false); } try { m_evtMicroBooterStart.Set(); m_evtMicroBooterError.Reset(); // try to see if we are connected to MicroBooter for (int retry = 0; retry < 5; retry++) { if (cancellationToken.IsCancellationRequested) { return(false); } await DebugEngine.SendBufferAsync(UTF8Encoding.UTF8.GetBytes("xx\n"), TimeSpan.FromMilliseconds(5000), cancellationToken); if (m_evtMicroBooterError.WaitOne(100)) { return(true); } } } finally { m_evtMicroBooterStart.Reset(); } return(false); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public CLangDebuggeeModule(DebugEngine engine, MiAsyncRecord asyncRecord) : base(engine) { if (asyncRecord == null) { throw new ArgumentNullException(nameof(asyncRecord)); } Name = asyncRecord ["id"] [0].GetString(); RemotePath = asyncRecord ["target-name"] [0].GetString(); RemoteLoadAddress = 0; SymbolsPath = asyncRecord ["host-name"] [0].GetString(); // // The 'symbols-loaded' field is emitted only for backward compatibility and should not be relied on to convey any useful information. // if ((!string.IsNullOrEmpty(SymbolsPath)) && File.Exists(SymbolsPath)) { SymbolsLoaded = true; } }
public void SubDivide() { float subWidth = ((Bounds.Max - Bounds.Min) / 4).X; float subHeight = ((Bounds.Max - Bounds.Min) / 4).Y; subHeight = subWidth; //upper var nodeUFR = new OcTree(new Vector3(Center.X + subWidth, Center.Y - subWidth, Center.Z + subWidth), Size / 2); var nodeUFL = new OcTree(new Vector3(Center.X - subWidth, Center.Y - subWidth, Center.Z + subWidth), Size / 2); var nodeUBR = new OcTree(new Vector3(Center.X + subWidth, Center.Y - subWidth, Center.Z - subWidth), Size / 2); var nodeUBL = new OcTree(new Vector3(Center.X - subWidth, Center.Y - subWidth, Center.Z - subWidth), Size / 2); //lower var nodeLFR = new OcTree(new Vector3(Center.X + subWidth, Center.Y + subWidth, Center.Z + subWidth), Size / 2); var nodeLFL = new OcTree(new Vector3(Center.X - subWidth, Center.Y + subWidth, Center.Z + subWidth), Size / 2); var nodeLBR = new OcTree(new Vector3(Center.X + subWidth, Center.Y + subWidth, Center.Z - subWidth), Size / 2); var nodeLBL = new OcTree(new Vector3(Center.X - subWidth, Center.Y + subWidth, Center.Z - subWidth), Size / 2); //upper Nodes.Add(nodeUFR); Nodes.Add(nodeUFL); Nodes.Add(nodeUBR); Nodes.Add(nodeUBL); //lower Nodes.Add(nodeLFR); Nodes.Add(nodeLFL); Nodes.Add(nodeLBR); Nodes.Add(nodeLBL); foreach (var node in Nodes) { DebugEngine.AddBoundingBox(node.Bounds, Color.Yellow, 1000); } }
private void HandleClassPrepare(object sender, ClassPrepareEventArgs e) { if (e.SuspendPolicy == SuspendPolicy.All) { Interlocked.Increment(ref _suspended); } JavaDebugThread thread; lock (_threads) { this._threads.TryGetValue(e.Thread.GetUniqueId(), out thread); } try { ReadOnlyCollection <string> sourceFiles = e.Type.GetSourcePaths(e.Type.GetDefaultStratum()); DebugEngine.BindVirtualizedBreakpoints(this, thread, e.Type, sourceFiles); } catch (MissingInformationException) { // Can't bind debug information for classes that don't contain debug information } // The format of the message created by the .NET debugger is this: // 'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Windows.Forms\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Windows.Forms.dll' string message = string.Format("'{0}' ({1}): Loaded '{2}'\n", Process.GetName(enum_GETNAME_TYPE.GN_BASENAME), Java.Constants.JavaLanguageName, e.Type.GetName()); DebugEvent outputEvent = new DebugOutputStringEvent(message); SetEventProperties(outputEvent, e, true); Callback.Event(DebugEngine, Process, this, thread, outputEvent); ManualContinueFromEvent(e); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public CLangDebuggerCallback(DebugEngine engine) { m_debugEngine = engine; // // Register function handlers for specific events. // m_debuggerCallback = new Dictionary <Guid, CLangDebuggerEventDelegate> { { ComUtils.GuidOf(typeof(CLangDebuggerEvent.StartServer)), OnStartServer }, { ComUtils.GuidOf(typeof(CLangDebuggerEvent.TerminateServer)), OnTerminateServer }, { ComUtils.GuidOf(typeof(CLangDebuggerEvent.AttachClient)), OnAttachClient }, { ComUtils.GuidOf(typeof(CLangDebuggerEvent.DetachClient)), OnDetachClient }, { ComUtils.GuidOf(typeof(CLangDebuggerEvent.StopClient)), OnStopClient }, { ComUtils.GuidOf(typeof(CLangDebuggerEvent.ContinueClient)), OnContinueClient }, { ComUtils.GuidOf(typeof(CLangDebuggerEvent.TerminateClient)), OnTerminateClient } }; }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeCodeContext(DebugEngine engine, DebuggeeDocumentContext documentContext, DebuggeeAddress address) { m_engine = engine; m_documentContext = documentContext ?? throw new ArgumentNullException(nameof(documentContext)); m_address = address ?? throw new ArgumentNullException(nameof(address)); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeExpression(DebugEngine engine, DebuggeeStackFrame stackFrame, string expression, uint radix) { m_debugEngine = engine; m_stackFrame = stackFrame; m_expression = expression; m_radix = radix; }
private void HandleException(object sender, ExceptionEventArgs e) { if (e.SuspendPolicy == SuspendPolicy.All) { Interlocked.Increment(ref _suspended); } JavaDebugThread thread; lock (_threads) { this._threads.TryGetValue(e.Thread.GetUniqueId(), out thread); } bool stop; bool firstChance = e.CatchLocation != null; EXCEPTION_INFO exceptionInfo; if (DebugEngine.TryGetException(e.Exception.GetReferenceType().GetName(), out exceptionInfo)) { if (firstChance && (exceptionInfo.dwState & enum_EXCEPTION_STATE.EXCEPTION_STOP_FIRST_CHANCE) != 0) { stop = true; } else if (!firstChance && (exceptionInfo.dwState & enum_EXCEPTION_STATE.EXCEPTION_STOP_SECOND_CHANCE) != 0) { stop = true; } else { stop = !firstChance; } } else { stop = !firstChance; } JavaDebugExceptionEvent exceptionEvent = new JavaDebugExceptionEvent(GetAttributesForEvent(e), this, e.Thread, e.Exception, e.Location, e.CatchLocation); if (stop) { SetEventProperties(exceptionEvent, e, false); Callback.Event(DebugEngine, Process, this, thread, exceptionEvent); } else { string message = exceptionEvent.GetDescription() + Environment.NewLine; DebugEvent debugEvent = new DebugOutputStringEvent(message); SetEventProperties(debugEvent, e, true); Callback.Event(DebugEngine, Process, this, thread, debugEvent); ManualContinueFromEvent(e); } }
private ActionResult GetView(string itemUri, string templateUri, string path) { using (new PreviewServer()) { DebugEngine engine = new DebugEngine(); string output = engine.Execute(itemUri, templateUri); //now Engine and Template instances are created return(View(path)); } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeDocumentContext(DebugEngine engine, string fileName, TEXT_POSITION beginPosition, TEXT_POSITION endPosition) { m_engine = engine; m_fileName = PathUtils.ConvertPathCygwinToWindows(fileName); m_beginPosition = beginPosition; m_endPosition = endPosition; m_codeContext = null; }
public override void Update() { NormalPointLightMaterial material = ((NormalPointLightMaterial)Material); float _radius = material.Attenuation; Color _color = material.LightColor; float _speed = 1f; DebugEngine.AddBoundingSphere(new BoundingSphere(material.Position, _radius), _color); if (InputEngine.IsKeyHeld(Keys.Up)) { material.Position += new Vector3(0, 0, -_speed); } if (InputEngine.IsKeyHeld(Keys.Down)) { material.Position += new Vector3(0, 0, _speed); } if (InputEngine.IsKeyHeld(Keys.Left)) { material.Position += new Vector3(-_speed, 0, 0); } if (InputEngine.IsKeyHeld(Keys.Right)) { material.Position += new Vector3(_speed, 0, 0); } if (InputEngine.IsKeyHeld(Keys.PageUp)) { material.Position += new Vector3(0, _speed, 0); } if (InputEngine.IsKeyHeld(Keys.PageDown)) { material.Position += new Vector3(0, -_speed, 0); } if (InputEngine.IsKeyHeld(Keys.Add)) { material.Attenuation += _speed * 2; } if (InputEngine.IsKeyHeld(Keys.Subtract)) { material.Attenuation -= _speed * 2; } base.Update(); }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 768; graphics.GraphicsProfile = GraphicsProfile.HiDef; graphics.ApplyChanges(); input = new InputEngine(this); debug = new DebugEngine(); shapeDrawer = new ImmediateShapeDrawer(); IsMouseVisible = true; Content.RootDirectory = "Content"; }
public GameRoot() { _graphics = new GraphicsDeviceManager(this); _graphics.PreferredBackBufferWidth = 1280; _graphics.PreferredBackBufferHeight = 768; _graphics.GraphicsProfile = GraphicsProfile.HiDef; _graphics.ApplyChanges(); _debug = new DebugEngine(); _input = new InputEngine(this); IsFixedTimeStep = true; IsMouseVisible = false; Window.Title = "3D Graphics CA - Demo"; Content.RootDirectory = "Content"; }
public OcTree(Vector3 position, float size) { Center = position; Size = size; Objects = new List <GameObject3D>(); Nodes = new List <OcTree>(); var minV2 = Vector3.Subtract(Center, new Vector3(size / 2, size / 2, size / 2)); var maxV2 = Vector3.Add(Center, new Vector3(size / 2, size / 2, size / 2)); Bounds = new BoundingBox( new Vector3(minV2.X, minV2.Y, minV2.Z), new Vector3(maxV2.X, maxV2.Y, maxV2.Z)); DebugEngine.AddBoundingSphere(new BoundingSphere(Center, 0.5f), Color.Black, 1000); }
public QuadTree(float size, Vector2 position, int maxObjects) { Size = size; Position = position; MaxObjects = maxObjects; Objects = new List <GameObject3D>(); Nodes = new List <QuadTree>(); float halfSize = size / 2; Vector3 min = new Vector3(position.X - halfSize, position.Y - halfSize, 0); Vector3 max = new Vector3(position.X + halfSize, position.Y + halfSize, 0); Bounds = new BoundingBox(min, max); DebugEngine.AddBoundingBox(Bounds, Color.Red, 1000); DebugEngine.AddBoundingSphere(new BoundingSphere(new Vector3(position, 0), 1), Color.Black, 1000); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeCodeContext(DebugEngine engine, DebuggeeDocumentContext documentContext, DebuggeeAddress address) { if (documentContext == null) { throw new ArgumentNullException("documentContext"); } if (address == null) { throw new ArgumentNullException("address"); } m_engine = engine; m_documentContext = documentContext; m_address = address; }
/// <summary> /// Attempts to communicate with the connected .Net Micro Framework device /// </summary> /// <returns></returns> public async Task <PingConnectionType> PingAsync() { var reply = await DebugEngine.GetConnectionSourceAsync(); if (reply != null) { switch (reply.m_source) { case Commands.Monitor_Ping.c_Ping_Source_TinyCLR: return(PingConnectionType.TinyCLR); case Commands.Monitor_Ping.c_Ping_Source_TinyBooter: return(PingConnectionType.TinyBooter); } } return(PingConnectionType.NoConnection); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebugEngineCallback(DebugEngine engine, IDebugEventCallback2 ad7EventCallback) { Engine = engine; m_ad7EventCallback = ad7EventCallback; m_cLangEventCallback = new CLangDebuggerCallback(engine); m_javaLangEventCallback = new JavaLangDebuggerCallback(engine); // // Register function handlers for specific events. // m_debuggerCallback = new Dictionary <Guid, DebuggerEventDelegate> (); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.BreakpointHit)), OnBreakpoint); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.BreakpointBound)), OnBreakpointBound); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.BreakpointError)), OnBreakpointError); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.Error)), OnError); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.Exception)), OnException); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.LoadComplete)), OnLoadComplete); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.ModuleLoad)), OnModuleLoad); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.OutputString)), OnOutputString); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.ProcessCreate)), OnProgramCreate); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.ProgramDestroy)), OnProgramDestroy); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.StepComplete)), OnStepComplete); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.SymbolSearch)), OnSymbolSearch); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.ThreadCreate)), OnThreadCreate); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(DebugEngineEvent.ThreadDestroy)), OnThreadDestroy); }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = 1920; graphics.PreferredBackBufferHeight = 1080; graphics.GraphicsProfile = GraphicsProfile.HiDef; graphics.ApplyChanges(); FourK_RT = new RenderTarget2D(GraphicsDevice, 3820, 2160, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8); input = new InputEngine(this); debug = new DebugEngine(); shapeDrawer = new ImmediateShapeDrawer(); Window.AllowUserResizing = true; IsMouseVisible = true; Content.RootDirectory = "Content"; }
private void Dispose(bool disposing) { if (!disposed) { if (disposing) { try { // release managed components Disconnect(); DebugEngine?.Dispose(); } catch { } } disposed = true; } }
public Octree(float size, Vector3 position, int maxObjects) { Size = size; Position = position; MaxObjects = maxObjects; Objects = new List <GameObject3D>(); Nodes = new List <Octree>(); //TODO: create bounds of given size at given position float halfSize = size / 2; Vector3 min = new Vector3(position.X - halfSize, position.Y - halfSize, position.Z - halfSize); Vector3 max = new Vector3(position.X + halfSize, position.Y + halfSize, position.Z + halfSize); Bounds = new BoundingBox(min, max); DebugEngine.AddBoundingBox(Bounds, Color.LimeGreen, 1000); DebugEngine.AddBoundingSphere(new BoundingSphere(new Vector3(position.X, position.Y, position.Z), 1), Color.Black, 1000); }
//private int m_interruptOperationCounter = 0; //private ManualResetEvent m_interruptOperationCompleted = null; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public JavaLangDebugger(DebugEngine debugEngine, DebuggeeProgram debugProgram) { Engine = debugEngine; m_javaLangCallback = new JavaLangDebuggerCallback(debugEngine); JavaProgram = new JavaLangDebuggeeProgram(this, debugProgram); m_jdbSetup = new JdbSetup(debugProgram.DebugProcess.NativeProcess); Engine.Broadcast(new DebugEngineEvent.DebuggerConnectionEvent(DebugEngineEvent.DebuggerConnectionEvent.EventType.LogStatus, string.Format("Configuring JDB for {0}:{1}...", m_jdbSetup.Host, m_jdbSetup.Port)), null, null); JdbClient = new JdbClient(m_jdbSetup); JdbClient.OnAsyncStdout = OnClientAsyncOutput; JdbClient.OnAsyncStderr = OnClientAsyncOutput; JdbClient.Start(); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeStackFrame(DebugEngine engine, DebuggeeThread thread, string frameName) { m_debugEngine = engine; m_thread = thread; m_codeContext = null; m_documentContext = null; m_property = new DebuggeeProperty(engine, this, frameName, string.Empty); m_stackRegisters = new ConcurrentDictionary <string, DebuggeeProperty> (); m_stackArguments = new ConcurrentDictionary <string, DebuggeeProperty> (); m_stackLocals = new ConcurrentDictionary <string, DebuggeeProperty> (); m_customExpressions = new ConcurrentDictionary <string, DebuggeeProperty> (); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeModule(DebugEngine engine) { m_debugEngine = engine; m_userCode = true; Name = string.Empty; Version = string.Empty; Size = 0; RemotePath = string.Empty; RemoteLoadAddress = 0; SymbolsPath = string.Empty; SymbolsLoaded = false; }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public JavaLangDebuggerCallback(DebugEngine engine) { m_debugEngine = engine; // // Register function handlers for specific events. // m_debuggerCallback = new Dictionary <Guid, JavaLangDebuggerEventDelegate> (); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(JavaLangDebuggerEvent.AttachClient)), OnAttachClient); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(JavaLangDebuggerEvent.DetachClient)), OnDetachClient); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(JavaLangDebuggerEvent.StopClient)), OnStopClient); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(JavaLangDebuggerEvent.ContinueClient)), OnContinueClient); m_debuggerCallback.Add(ComUtils.GuidOf(typeof(JavaLangDebuggerEvent.TerminateClient)), OnTerminateClient); }
public override void Update() { if (DoMove) { if (!HasReachedDestination()) { MoveTowardsDestination((float)GameUtilities.Time.ElapsedGameTime.TotalSeconds); } else { if (Looping) { AddWaypoint(Destination); } if (Waypoints.Count > 0) { NextWaypoint(); } else if (Complete != null) { Complete(ID); } } } if (System.Diagnostics.Debugger.IsAttached) { DebugEngine.AddBoundingSphere(new BoundingSphere(Destination, 1.0f), Color.Black); foreach (var p in Waypoints) { DebugEngine.AddBoundingSphere(new BoundingSphere(p, 1.0f), Color.LawnGreen); } } base.Update(); }
public NanoDevice() { Device = new T(); if (Device is NanoUsbDevice) { Transport = TransportType.Usb; } SuicideTimer = new Timer((state) => { Task.Factory.StartNew(() => { // set kill flag KillFlag = true; DebugEngine.Dispose(); Dispose(false); }); }, null, Timeout.Infinite, Timeout.Infinite); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebuggeeProperty(DebugEngine engine, DebuggeeStackFrame stackFrame, string expression, string value) { m_debugEngine = engine; m_stackFrame = stackFrame; if (string.IsNullOrEmpty(expression)) { throw new ArgumentNullException(nameof(expression)); } m_expression = expression; m_value = value; m_parent = null; m_children = new List <DebuggeeProperty> (); // // Compound parental expressions to evaluate this property's full identifier. // StringBuilder expressionBuilder = new StringBuilder(2048); DebuggeeProperty parent = m_parent; while (parent != null) { expressionBuilder.Append(parent.m_expression + "."); parent = parent.m_parent; } expressionBuilder.Append(m_expression); m_fullExpression = expressionBuilder.ToString(); }
/// <summary> /// Attempts to communicate with the connected nanoFramework device /// </summary> /// <returns></returns> public PingConnectionType Ping() { if (DebugEngine == null) { throw new DeviceNotConnectedException(); } var reply = DebugEngine.GetConnectionSource(); if (reply != null) { switch (reply.m_source) { case Commands.Monitor_Ping.c_Ping_Source_NanoCLR: return(PingConnectionType.nanoCLR); case Commands.Monitor_Ping.c_Ping_Source_NanoBooter: return(PingConnectionType.nanoBooter); } } return(PingConnectionType.NoConnection); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public DebugBreakpointManager(DebugEngine engine) { Engine = engine; m_pendingBreakpoints = new List <DebuggeeBreakpointPending> (); }
public DebugDomain(DebugEngine debugEngine, ICorDebugAppDomain iCorDebugAppDomain) { _debugEngine = debugEngine; this._domain = iCorDebugAppDomain; }
public DebugProcess(DebugEngine debugEngine, int pid) { // TODO: Complete member initialization _debugEngine = debugEngine; _pid = (uint)pid; }