• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Debugger.Engine类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.SPOT.Debugger.Engine的典型用法代码示例。如果您正苦于以下问题:C# Engine类的具体用法?C# Engine怎么用?C# Engine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Engine类属于Microsoft.SPOT.Debugger命名空间,在下文中一共展示了Engine类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RuntimeValue_Primitive

        protected internal RuntimeValue_Primitive( Engine eng, WireProtocol.Commands.Debugging_Value handle ) : base( eng, handle )
        {
            Type t;

            switch((RuntimeDataType)handle.m_dt)
            {
            case RuntimeDataType.DATATYPE_BOOLEAN: t = typeof( bool  ); break;
            case RuntimeDataType.DATATYPE_I1     : t = typeof(sbyte  ); break;
            case RuntimeDataType.DATATYPE_U1     : t = typeof( byte  ); break;

            case RuntimeDataType.DATATYPE_CHAR   : t = typeof( char  ); break;
            case RuntimeDataType.DATATYPE_I2     : t = typeof( short ); break;
            case RuntimeDataType.DATATYPE_U2     : t = typeof(ushort ); break;

            case RuntimeDataType.DATATYPE_I4     : t = typeof( int   ); break;
            case RuntimeDataType.DATATYPE_U4     : t = typeof(uint   ); break;
            case RuntimeDataType.DATATYPE_R4     : t = typeof( float ); break;

            case RuntimeDataType.DATATYPE_I8     : t = typeof( long  ); break;
            case RuntimeDataType.DATATYPE_U8     : t = typeof(ulong  ); break;
            case RuntimeDataType.DATATYPE_R8     : t = typeof( double); break;

            default: throw new ArgumentException( String.Format( "Not a primitive: {0}", handle.m_dt ) );
            }

            m_value = System.Runtime.Serialization.FormatterServices.GetUninitializedObject( t );

            m_eng.CreateConverter().Deserialize( m_value, handle.m_builtinValue );
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:29,代码来源:RuntimeValue_Primitive.cs


示例2: RuntimeValue_Indirect

 protected internal RuntimeValue_Indirect( Engine eng, WireProtocol.Commands.Debugging_Value[] array, int pos ) : base( eng, array[pos] )
 {
     if(++pos < array.Length)
     {
         m_value = Convert( eng, array, pos );
     }
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:7,代码来源:RuntimeValue_Indirect.cs


示例3: EndPoint

 internal EndPoint(Type type, uint id, Engine engine)
 {
     m_type = BinaryFormatter.LookupHash(type);
     m_id = id;
     m_seq = 0;
     m_eng = engine;
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:7,代码来源:EndPoint.cs


示例4: AppDomainIdFromCall

		public static uint AppDomainIdFromCall (Engine engine, WireProtocol.Commands.Debugging_Thread_Stack.Reply.Call call)
		{
			uint appDomainId = CorDebugAppDomain.CAppDomainIdForNoAppDomainSupport;

			if (engine.Capabilities.AppDomains) {
				WireProtocol.Commands.Debugging_Thread_Stack.Reply.CallEx callEx = call as WireProtocol.Commands.Debugging_Thread_Stack.Reply.CallEx;

				appDomainId = callEx.m_appDomainID;
			}

			return appDomainId;
		}
开发者ID:Roddoric,项目名称:Monkey.Robotics,代码行数:12,代码来源:CorDebugFrame.cs


示例5: RuntimeValue_ByRef

 protected internal RuntimeValue_ByRef( Engine eng, WireProtocol.Commands.Debugging_Value[] array, int pos ) : base( eng, array, pos )
 {
     if(m_value == null && m_handle.m_arrayref_referenceID != 0)
     {
         m_value = m_eng.GetArrayElement( m_handle.m_arrayref_referenceID, m_handle.m_arrayref_index );
     }
  
     if(m_value == null)
     {
         throw new ArgumentException();
     }            
 }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:12,代码来源:RuntimeValue_ByRef.cs


示例6: RuntimeValue_String

        protected internal RuntimeValue_String( Engine eng, WireProtocol.Commands.Debugging_Value handle ) : base( eng, handle )
        {
            byte[] buf = handle.m_builtinValue;

            if(handle.m_bytesInString >= buf.Length)
            {
                if(m_eng.ReadMemory( m_handle.m_charsInString, m_handle.m_bytesInString, out buf ) == false)
                {
                    // Revert to the preview on failure
                    buf = handle.m_builtinValue;
                }
            }

            m_value = WireProtocol.Commands.GetZeroTerminatedString( buf, true );
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:15,代码来源:RuntimeValue_String.cs


示例7: OnRun

		protected override void OnRun (DebuggerStartInfo startInfo)
		{
			var mfStartInfo = startInfo as MicroFrameworkDebuggerStartInfo;
			if (mfStartInfo == null)//This should never happen...
				throw new InvalidOperationException ();
			var command = mfStartInfo.MFCommand;
			var portDefinition = ((MicroFrameworkExecutionTarget)command.Target).PortDefinition;
			using (var deployEngine = new Engine (portDefinition)) {
				deployEngine.Start ();

				string newCommand = "/CorDebug_DeployDeviceName:" + portDefinition.PersistName;

				var listOfAseemblies = new ArrayList ();

				//TODO: Check if this is robust enough will "be" and "le" really always be in output folder?
				OutputDirectory = command.OutputDirectory;
				string dir = command.OutputDirectory;
				if (deployEngine.IsTargetBigEndian)
					dir = Path.Combine (dir, "be");
				else
					dir = Path.Combine (dir, "le");

				string[] files = Directory.GetFiles (dir, "*.pe");
				foreach (var file in files) {
					newCommand = "/load:" + file + " " + newCommand;
					using (var fs = new FileStream (file, FileMode.Open)) {
						byte[] data = new byte[fs.Length];
						fs.Read (data, 0, data.Length);
						listOfAseemblies.Add (data);
					}
				}
				startInfo.Command = newCommand;
				deployEngine.Deployment_Execute (listOfAseemblies, false, (str) => OnDebuggerOutput (false, "Deploy: " + str + Environment.NewLine));
				deployEngine.RebootDevice (Engine.RebootOption.RebootClrWaitForDebugger);
			}
			VsPackage.MessageCentre.Session = this;
			try {
				CorDebugProcess process = CorDebugProcess.CreateProcess (new DebugPortSupplier ().FindPort ("USB"), startInfo.Command);
				process.StartDebugging (this, false);
				// StartDebugging() will either get a connected device into a debuggable state and start the dispatch thread, or throw.
			} catch (ProcessExitException) {
				VsPackage.MessageCentre.DeploymentMsg (DiagnosticStrings.InitializeProcessFailedProcessDied);
			} catch (Exception ex) {
				VsPackage.MessageCentre.DeploymentMsg (DiagnosticStrings.InitializeProcessFailed);
				VsPackage.MessageCentre.InternalErrorMsg (false, ex.Message);
			}
		}
开发者ID:Roddoric,项目名称:Monkey.Robotics,代码行数:47,代码来源:MicroFrameworkDebuggerSession.cs


示例8: ProfilerSession

        public ProfilerSession(_DBG.Engine engine)
        {
            if (engine == null)
            {
                throw new ArgumentNullException();
            }

            m_connected = true;
            m_engine = engine;
            m_engine.OnCommand += new _DBG.CommandEventHandler(OnDeviceCommand);
            m_incomingStream = new _DBG.BitStream(true);

            m_startTime = 0;
            m_lastKnownTime = 0;
            m_currentHeapDump = null;
            m_threadCallStacks = new Dictionary<uint, Stack<uint>>();

            m_liveObjectTable = new List<uint>();

            m_firstPacket = true;

            m_receiverThread = new Thread(WorkerThread);
            m_receiverThread.Start();
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:24,代码来源:Profiler.cs


示例9: buttonEraseDeployment_Click

        private void buttonEraseDeployment_Click( object sender, EventArgs e )
        {
            bool bWasStarted = EnsureDebuggerConnection();
            Cursor old = Cursor.Current;
            Cursor = Cursors.WaitCursor;
            buttonEraseDeployment.Text = "Erasing...";
            buttonEraseDeployment.Update();
            NewText( "Erasing Deployment Sector...\r\n" );

            try
            {
                _DBG.WireProtocol.Commands.Monitor_Ping.Reply ping = m_eng.GetConnectionSource();
                if(ping == null) 
                {
                    NewText("Unable to connect to device\r\n");
                    return;
                }
                
                bool fClrConnection = ping.m_source == _DBG.WireProtocol.Commands.Monitor_Ping.c_Ping_Source_TinyCLR;

                if (fClrConnection)
                {
                    m_eng.PauseExecution();
                }

                _DBG.WireProtocol.Commands.Monitor_FlashSectorMap.Reply status = m_eng.GetFlashSectorMap() as _DBG.WireProtocol.Commands.Monitor_FlashSectorMap.Reply;

                if (status == null)
                {
                    NewText( "Erase Deployment may Not be supported on this device build\r\n" );                
                }
                else
                {
                    const uint c_deployFlag = _DBG.WireProtocol.Commands.Monitor_FlashSectorMap.c_MEMORY_USAGE_DEPLOYMENT;
                    const uint c_usageMask  = _DBG.WireProtocol.Commands.Monitor_FlashSectorMap.c_MEMORY_USAGE_MASK;

                    foreach( _DBG.WireProtocol.Commands.Monitor_FlashSectorMap.FlashSectorData sector in status.m_map)
                    {
                        if (c_deployFlag == (c_usageMask & sector.m_flags))
                        {
                            NewText(string.Format("Erasing sector at 0x{0:x08}\r\n", sector.m_address));
                            m_eng.EraseMemory(sector.m_address, sector.m_size);
                        }
                    }

                    if (fClrConnection)
                    {
                        m_eng.RebootDevice(_DBG.Engine.RebootOption.RebootClrOnly);
                    }
                    NewText("Erase Deployment Successfull");
                }
            }
            catch( Exception ex )
            {
                NewText( "Exception: " + ex.Message + "\r\n" );
            }
            finally
            {
                buttonEraseDeployment.Text = "Erase Deployment";

                Cursor = old;
                if( !bWasStarted )
                {
                    m_eng.Stop();
                    m_eng = null;
                }
            }
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:68,代码来源:portBooterClient.cs


示例10: EnsureDebuggerConnection

        /// <summary>
        /// 
        /// </summary>
        /// <returns>Returns the previous conneciton state of the debugger engine</returns>
        private bool EnsureDebuggerConnection()
        {
            if( m_eng == null )
            {
                _DBG.PortDefinition pd = GetSelectedPortDefinition();

                m_eng = new _DBG.Engine( pd );

                m_eng.OnNoise += new _DBG.NoiseEventHandler( OnNoise );
                m_eng.OnMessage += new _DBG.MessageEventHandler( OnMessage );

                m_eng.Start();

                m_eng.TryToConnect(5, 100);

                return false;
            }

            // TryToConnect calls GetCLRCapabilities which prevents a bunch of asserts
            m_eng.TryToConnect(5, 100);

            return true;
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:27,代码来源:portBooterClient.cs


示例11: GetObject

        static internal object GetObject(Engine eng, EndPoint ep, Type classToRemote)
        {
            uint id = eng.RpcGetUniqueEndpointId();

            EndPoint epLocal = new EndPoint(typeof(EndPointProxy), id, eng);

            EndPointProxy prx = new EndPointProxy(eng, epLocal, ep, classToRemote);

            return prx.GetTransparentProxy();
        }
开发者ID:trfiladelfo,项目名称:MicroFrameworkSDK-Mono,代码行数:10,代码来源:Engine+-+Original.cs


示例12: Convert

        static internal RuntimeValue Convert( Engine eng, WireProtocol.Commands.Debugging_Value[] array )
        {
            if(array == null || array.Length == 0) return null;

            return Convert( eng, array, 0 );
        }
开发者ID:awakegod,项目名称:NETMF-LPC,代码行数:6,代码来源:Values.cs


示例13: EndPoint

 public EndPoint(Type type, uint id, object server, Type classToRemote, Engine engine)
     : this(type, id, engine)
 {
     m_server = server;
     m_serverClassToRemote = classToRemote;
 }
开发者ID:trfiladelfo,项目名称:MicroFrameworkSDK-Mono,代码行数:6,代码来源:Engine+-+Original.cs


示例14: RuntimeValue_Object

 protected internal RuntimeValue_Object( Engine eng, WireProtocol.Commands.Debugging_Value[] array, int pos ) : base( eng, array, pos )
 {
 }
开发者ID:awakegod,项目名称:NETMF-LPC,代码行数:3,代码来源:Values.cs


示例15: EndPointProxy

            internal EndPointProxy(Engine eng, EndPoint from, EndPoint to, Type type)
                : base(type)
            {
                from.Register();

                if (from.CheckDestination(to) == false)
                {
                    from.Deregister();

                    throw new ArgumentException("Cannot connect to device EndPoint");
                }

                m_eng = eng;
                m_from = from;
                m_to = to;
                m_type = type;
            }
开发者ID:trfiladelfo,项目名称:MicroFrameworkSDK-Mono,代码行数:17,代码来源:Engine+-+Original.cs


示例16: RuntimeValue_Array

 protected internal RuntimeValue_Array( Engine eng, WireProtocol.Commands.Debugging_Value handle ) : base( eng, handle )
 {
 }
开发者ID:awakegod,项目名称:NETMF-LPC,代码行数:3,代码来源:Values.cs


示例17: Request

            internal Request(Engine parent, WireProtocol.OutgoingMessage req, int retries, int timeout, CommandEventHandler callback)
            {
                if (retries < 0)
                {
                    throw new ArgumentException("Value cannot be negative", "retries");
                }

                if (timeout < 1 || timeout > 60 * 60 * 1000)
                {
                    throw new ArgumentException(String.Format("Value out of bounds: {0}", timeout), "timeout");
                }

                m_parent = parent;
                m_req = req;
                m_retries = retries;
                m_timeoutRetry = new TimeSpan(timeout * TimeSpan.TicksPerMillisecond);
                m_timeoutWait = new TimeSpan((retries == 0 ? 1 : 2 * retries) * timeout * TimeSpan.TicksPerMillisecond);
                m_callback = callback;

                if (callback == null)
                {
                    m_event = new ManualResetEvent(false);
                }
            }
开发者ID:trfiladelfo,项目名称:MicroFrameworkSDK-Mono,代码行数:24,代码来源:Engine+-+Original.cs


示例18: RuntimeValue_Reflection

        protected internal RuntimeValue_Reflection( Engine eng, WireProtocol.Commands.Debugging_Value handle ) : base( eng, handle )
        {
            m_rd = (ReflectionDefinition)System.Runtime.Serialization.FormatterServices.GetUninitializedObject( typeof(ReflectionDefinition) );

            m_eng.CreateConverter().Deserialize( m_rd, handle.m_builtinValue );
        }
开发者ID:awakegod,项目名称:NETMF-LPC,代码行数:6,代码来源:Values.cs


示例19: Connect

        internal bool Connect( int timeout_ms, bool tryConnect )
        {
            // to use user cancel event, so that cancel button is more responsive
            int retries = timeout_ms/100;
            int loops = 1;
            
            if (retries == 0) retries = 1;

            if (m_portTinyBooter != null && m_port.UniqueId != m_portTinyBooter.UniqueId)
            {
                retries /= 2;
                loops   =  2;
            }
            for (int i = 0; i < loops; i++)
            {
                _DBG.PortDefinition pd = i == 0 ? m_port : m_portTinyBooter;

                if (EventCancel.WaitOne(0, false)) throw new MFUserExitException();

                try
                {
                    if (m_eng == null)
                    {
                        m_eng = new _DBG.Engine(pd);

                        m_eng.OnNoise += new _DBG.NoiseEventHandler(OnNoiseHandler);
                        m_eng.OnMessage += new _DBG.MessageEventHandler(OnMessage);
                    }

                    if (!m_eng.IsConnected)
                    {
                        m_eng.Start();
                        if (tryConnect)
                        {
                            for (int j = retries; j > 0; j-=5)
                            {
                                if (m_eng.TryToConnect(5, 100, true, _DBG.ConnectionSource.Unknown))
                                {
                                    //UNLOCK DEVICE in secure way?
                                    m_eng.UnlockDevice(m_data);
                                    break;
                                }

                                if (EventCancel.WaitOne(0, false)) throw new MFUserExitException();
                            }
                            if (m_eng.IsConnected)
                            {
                                break;
                            }
                            else
                            {
                                Disconnect();
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                catch (MFUserExitException)
                {
                    Disconnect();
                    throw;
                }
                catch
                {
                    Disconnect();
                }
            }
            return (m_eng != null && (!tryConnect || m_eng.IsConnected));
        }
开发者ID:prabby,项目名称:miniclr,代码行数:72,代码来源:MFDevice.cs


示例20: buttonRebootAndStop_Click

        private void buttonRebootAndStop_Click( object sender, EventArgs e )
        {
            bool bWasStarted = EnsureDebuggerConnection( );

            m_eng.RebootDevice(_DBG.Engine.RebootOption.EnterBootloader);

            if(!bWasStarted)
            {
                m_eng.Stop();
                m_eng = null;
            }
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:12,代码来源:portBooterClient.cs



注:本文中的Microsoft.SPOT.Debugger.Engine类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WireProtocol.Converter类代码示例发布时间:2022-05-26
下一篇:
C# Cryptoki.Session类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap