本文整理汇总了C#中Microsoft.SPOT.Debugger.Engine类的典型用法代码示例。如果您正苦于以下问题:C# Engine类的具体用法?C# Engine怎么用?C# Engine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Engine类属于Microsoft.SPOT.Debugger命名空间,在下文中一共展示了Engine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 );
}
示例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 );
}
}
示例3: EndPoint
internal EndPoint(Type type, uint id, Engine engine)
{
m_type = BinaryFormatter.LookupHash(type);
m_id = id;
m_seq = 0;
m_eng = engine;
}
示例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;
}
示例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();
}
}
示例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 );
}
示例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);
}
}
示例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();
}
示例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;
}
}
}
示例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;
}
示例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();
}
示例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 );
}
示例13: EndPoint
public EndPoint(Type type, uint id, object server, Type classToRemote, Engine engine)
: this(type, id, engine)
{
m_server = server;
m_serverClassToRemote = classToRemote;
}
示例14: RuntimeValue_Object
protected internal RuntimeValue_Object( Engine eng, WireProtocol.Commands.Debugging_Value[] array, int pos ) : base( eng, array, pos )
{
}
示例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;
}