Class Engine
- Namespace
- nanoFramework.Tools.Debugger
- Assembly
- nanoFramework.Tools.DebugLibrary.Net.dll
public class Engine : IDisposable, IControllerHostLocal, IControllerHost
- Inheritance
-
Engine
- Implements
- Inherited Members
- Extension Methods
Fields
StorageDeleteOperationProgressStep
This constant is to be used in progress report when performing delete operation.
public const int StorageDeleteOperationProgressStep = 10
Field Value
_pendingRequestsTimer
protected readonly Timer _pendingRequestsTimer
Field Value
_requestsStore
protected readonly WireProtocolRequestsStore _requestsStore
Field Value
Properties
AvailableBytes
public int AvailableBytes { get; }
Property Value
Capabilities
public CLRCapabilities Capabilities { get; }
Property Value
ConfigBlockRequiresErase
This indicates if the device requires that the configuration block to be erased before updating it.
public bool ConfigBlockRequiresErase { get; }
Property Value
ConnectionSource
public ConnectionSource ConnectionSource { get; set; }
Property Value
DefaultTimeout
Default timeout value for operations (in milliseconds).
public int DefaultTimeout { get; set; }
Property Value
FlashSectorMap
public List<Commands.Monitor_FlashSectorMap.FlashSectorData> FlashSectorMap { get; }
Property Value
HasNanoBooter
This indicates if the target device has nanoBooter.
public bool HasNanoBooter { get; }
Property Value
HasProprietaryBooter
This indicates if the device has a proprietary bootloader.
public bool HasProprietaryBooter { get; }
Property Value
IsCRC32EnabledForWireProtocol
This flag is true when connected nanoDevice implements CRC32 in Wire Protocol packets and headers
public bool IsCRC32EnabledForWireProtocol { get; }
Property Value
IsConnected
public bool IsConnected { get; }
Property Value
IsConnectedTonanoBooter
public bool IsConnectedTonanoBooter { get; }
Property Value
IsConnectedTonanoCLR
public bool IsConnectedTonanoCLR { get; }
Property Value
IsIFUCapable
This indicates if the target device is IFU capable.
public bool IsIFUCapable { get; }
Property Value
IsRunning
public bool IsRunning { get; }
Property Value
IsTargetBigEndian
public bool IsTargetBigEndian { get; }
Property Value
LastActivity
public DateTime LastActivity { get; }
Property Value
MemoryMap
public List<Commands.Monitor_MemoryMap.Range> MemoryMap { get; }
Property Value
NoStackTraceInExceptions
public bool NoStackTraceInExceptions { get; set; }
Property Value
Silent
Setting for debugger output to be silent.
public bool Silent { get; set; }
Property Value
StopDebuggerOnConnect
public bool StopDebuggerOnConnect { get; set; }
Property Value
TargetInfo
public TargetInfo TargetInfo { get; }
Property Value
ThrowOnCommunicationFailure
public bool ThrowOnCommunicationFailure { get; set; }
Property Value
WireProtocolPacketSize
Wire Protocol packet size. Default is 1024.
public uint WireProtocolPacketSize { get; }
Property Value
Methods
AddPacket(int, uint, byte[], uint)
public bool AddPacket(int updateHandle, uint packetIndex, byte[] packetData, uint packetValidation)
Parameters
Returns
AddStorageFile(string, byte[], int, int, IProgress<MessageWithProgress>, IProgress<string>)
Add a file to the device storage.
public StorageOperationErrorCode AddStorageFile(string fileName, byte[] fileContent, int operationExecutedLenght = 0, int operationTotalLength = 0, IProgress<MessageWithProgress> progress = null, IProgress<string> log = null)
Parameters
fileNamestringFile name.
fileContentbyte[]Content of the file.
operationExecutedLenghtintCount of bytes already executed in this operation.
operationTotalLengthintTotal length of the operation, in bytes.
progressIProgress<MessageWithProgress>An IProgress<T> object to track the progress of the deploy operation.
logIProgress<string>An IProgress<T> object to log the progress of the deploy operation.
Returns
- StorageOperationErrorCode
Operation result as a StorageOperationErrorCode.
AllocateArray(int, uint, int, int)
public RuntimeValue AllocateArray(int scratchPadLocation, uint td, int depth, int numOfElements)
Parameters
Returns
AllocateMemory(uint)
public (uint Address, bool Success) AllocateMemory(uint size)
Parameters
sizeuint
Returns
AllocateObject(int, uint)
public RuntimeValue AllocateObject(int scratchPadLocation, uint td)
Parameters
Returns
AllocateString(int, string)
public RuntimeValue AllocateString(int scratchPadLocation, string val)
Parameters
Returns
CanUpgradeToSsl()
public bool CanUpgradeToSsl()
Returns
Connect()
public bool Connect()
Returns
Connect(bool, bool)
public bool Connect(bool force, bool requestCapabilities = false)
Parameters
Returns
Connect(int, bool, bool)
public bool Connect(int millisecondsTimeout, bool force = false, bool requestCapabilities = false)
Parameters
Returns
CreateBinaryFormatter()
public BinaryFormatter CreateBinaryFormatter()
Returns
CreateThread(uint, int)
public uint CreateThread(uint methodIndex, int scratchPadLocation)
Parameters
Returns
CreateThread(uint, int, uint)
public uint CreateThread(uint methodIndex, int scratchPadLocation, uint pid)
Parameters
Returns
DeleteStorageFile(string, int, int, IProgress<MessageWithProgress>, IProgress<string>)
Delete a file from the device storage.
public StorageOperationErrorCode DeleteStorageFile(string fileName, int operationExecutedLenght = 0, int operationTotalLength = 0, IProgress<MessageWithProgress> progress = null, IProgress<string> log = null)
Parameters
fileNamestringName of file to delete.
operationExecutedLenghtintCount of bytes already executed in this operation.
operationTotalLengthintTotal length of the operation, in bytes.
progressIProgress<MessageWithProgress>An IProgress<T> object to track the progress of the deploy operation.
logIProgress<string>An IProgress<T> object to log the progress of the deploy operation.
Returns
- StorageOperationErrorCode
Operation result as a StorageOperationErrorCode.
Remarks
When computing the operation total length, use the constant StorageDeleteOperationProgressStep as the step weight and consider that this will be executed in a single step.
DeploymentExecute(List<byte[]>, bool, bool, IProgress<MessageWithProgress>, IProgress<string>)
Deploy a list of assemblies to the device and optionally reboot it.
public bool DeploymentExecute(List<byte[]> assemblies, bool rebootAfterDeploy = true, bool skipErase = false, IProgress<MessageWithProgress> progress = null, IProgress<string> log = null)
Parameters
assembliesList<byte[]>A collection of assemblies to deploy.
rebootAfterDeploybooltrue to reboot device after a successfull deployment.
skipErasebooltrue to skip erasing the storage block before writting to it.
progressIProgress<MessageWithProgress>An IProgress<T> object to track the progress of the deploy operation.
logIProgress<string>An IProgress<T> object to log the progress of the deploy operation.
Returns
Exceptions
- NotSupportedException
In case the connected device doesn't have support for incremental deployment.
DeploymentGetStatus()
public Commands.DebuggingDeploymentStatus.Reply DeploymentGetStatus()
Returns
DeploymentGetStatusWithResult()
public (uint Entrypoint, uint StorageStart, uint StorageLength, bool Success) DeploymentGetStatusWithResult()
Returns
- (uint NumOfArguments, uint NnumOfLocals, uint DepthOfEvalStack, bool Success)
Tuple with entrypoint, storageStart, storageLength and request success
Dispose()
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
EraseMemory(uint, uint)
public (AccessMemoryErrorCodes ErrorCode, bool Success) EraseMemory(uint address, uint length)
Parameters
Returns
ExecuteMemory(uint)
public bool ExecuteMemory(uint address)
Parameters
addressuint
Returns
~Engine()
protected ~Engine()
FlushProfilingStream()
public bool FlushProfilingStream()
Returns
GetAllNetworkConfigurations()
public List<DeviceConfiguration.NetworkConfigurationProperties> GetAllNetworkConfigurations()
Returns
GetAllWireless80211Configurations()
public List<DeviceConfiguration.Wireless80211ConfigurationProperties> GetAllWireless80211Configurations()
Returns
GetAllWirelessAPConfigurations()
public List<DeviceConfiguration.WirelessAPConfigurationProperties> GetAllWirelessAPConfigurations()
Returns
GetAllX509Certificates()
public List<DeviceConfiguration.X509CaRootBundleProperties> GetAllX509Certificates()
Returns
GetAllX509DeviceCertificates()
public List<DeviceConfiguration.X509DeviceCertificatesProperties> GetAllX509DeviceCertificates()
Returns
GetAppDomains()
public Commands.Debugging_TypeSys_AppDomains.Reply GetAppDomains()
Returns
GetArrayElement(uint, uint)
public RuntimeValue GetArrayElement(uint arrayReferenceId, uint index)
Parameters
Returns
GetAssemblies()
public Commands.Debugging_TypeSys_Assemblies.Reply GetAssemblies()
Returns
GetBreakpointStatus()
public Commands.Debugging_Execution_BreakpointDef GetBreakpointStatus()
Returns
GetConnectionSource()
public ConnectionSource GetConnectionSource()
Returns
GetDeploymentMap()
public List<Commands.Monitor_DeploymentMap.DeploymentData> GetDeploymentMap()
Returns
GetDeviceConfiguration(CancellationToken)
public DeviceConfiguration GetDeviceConfiguration(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken
Returns
GetExecutionBasePtr()
public uint GetExecutionBasePtr()
Returns
GetExecutionMode()
public Commands.DebuggingExecutionChangeConditions.State GetExecutionMode()
Returns
GetFieldName(uint)
public (string Td, uint Offset, uint Success) GetFieldName(uint fd)
Parameters
fduint
Returns
GetFlashSectorMap()
public List<Commands.Monitor_FlashSectorMap.FlashSectorData> GetFlashSectorMap()
Returns
GetMemoryMap()
public List<Commands.Monitor_MemoryMap.Range> GetMemoryMap()
Returns
GetMethodName(uint, bool)
public string GetMethodName(uint md, bool fIncludeType)
Parameters
Returns
GetMonitorOemInfo()
public ReleaseInfo GetMonitorOemInfo()
Returns
GetMonitorTargetInfo()
public TargetInfo GetMonitorTargetInfo()
Returns
GetNetworkConfiguratonProperties(uint)
public DeviceConfiguration.NetworkConfigurationProperties GetNetworkConfiguratonProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndexuint
Returns
GetPacketMaxLength(OverheadBase)
public int GetPacketMaxLength(Commands.OverheadBase cmd)
Parameters
cmdCommands.OverheadBase
Returns
GetScratchPadValue(int)
public RuntimeValue GetScratchPadValue(int index)
Parameters
indexint
Returns
GetStackFrameInfo(uint, uint)
public (uint NumOfArguments, uint NnumOfLocals, uint DepthOfEvalStack, bool Success) GetStackFrameInfo(uint pid, uint depth)
Parameters
Returns
- (uint NumOfArguments, uint NnumOfLocals, uint DepthOfEvalStack, bool Success)
Tuple with numOfArguments, numOfLocals, depthOfEvalStack and request success result.
GetStackFrameValue(uint, uint, StackValueKind, uint)
public RuntimeValue GetStackFrameValue(uint pid, uint depth, Engine.StackValueKind kind, uint index)
Parameters
piduintdepthuintkindEngine.StackValueKindindexuint
Returns
GetStackFrameValueAll(uint, uint, uint, StackValueKind)
public List<RuntimeValue> GetStackFrameValueAll(uint pid, uint depth, uint cValues, Engine.StackValueKind kind)
Parameters
piduintdepthuintcValuesuintkindEngine.StackValueKind
Returns
GetStackInfo(uint, uint)
public Commands.Debugging_Stack_Info.Reply GetStackInfo(uint pid, uint depth)
Parameters
Returns
GetStaticFieldValue(uint)
public RuntimeValue GetStaticFieldValue(uint fd)
Parameters
fduint
Returns
GetTargetInfo()
public CLRCapabilities.TargetInfoProperties GetTargetInfo()
Returns
GetThread(uint)
public RuntimeValue GetThread(uint pid)
Parameters
piduint
Returns
GetThreadException(uint)
public RuntimeValue GetThreadException(uint pid)
Parameters
piduint
Returns
GetThreadList()
public uint[] GetThreadList()
Returns
- uint[]
GetThreadStack(uint)
public Commands.Debugging_Thread_Stack.Reply GetThreadStack(uint pid)
Parameters
piduint
Returns
GetThreads()
public List<ThreadStatus> GetThreads()
Returns
GetTypeName(uint)
public string GetTypeName(uint td)
Parameters
tduint
Returns
GetVirtualMethod(uint, RuntimeValue)
public uint GetVirtualMethod(uint md, RuntimeValue obj)
Parameters
mduintobjRuntimeValue
Returns
GetWireless80211ConfiguratonProperties(uint)
public DeviceConfiguration.Wireless80211ConfigurationProperties GetWireless80211ConfiguratonProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndexuint
Returns
GetWirelessAPConfiguratonProperties(uint)
public DeviceConfiguration.WirelessAPConfigurationProperties GetWirelessAPConfiguratonProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndexuint
Returns
GetX509CertificatesProperties(uint)
public DeviceConfiguration.X509CaRootBundleProperties GetX509CertificatesProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndexuint
Returns
GetX509DeviceCertificatesProperties(uint)
public DeviceConfiguration.X509DeviceCertificatesProperties GetX509DeviceCertificatesProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndexuint
Returns
IncomingMessagesListener()
public void IncomingMessagesListener()
Info_SetJMC(bool, Kind, uint)
public bool Info_SetJMC(bool fJMC, ReflectionDefinition.Kind kind, uint index)
Parameters
fJMCboolkindReflectionDefinition.Kindindexuint
Returns
InjectButtons(uint, uint)
public void InjectButtons(uint pressed, uint released)
Parameters
InstallUpdate(int, byte[])
public bool InstallUpdate(int updateHandle, byte[] validationData)
Parameters
Returns
KillThread(uint)
public bool KillThread(uint pid)
Parameters
piduint
Returns
PauseExecution()
public bool PauseExecution()
Returns
PerformWriteMemoryCheck(uint, byte[])
public bool PerformWriteMemoryCheck(uint address, byte[] buf)
Parameters
Returns
PerformWriteMemoryCheck(uint, byte[], int, int)
public bool PerformWriteMemoryCheck(uint address, byte[] buf, int offset, int length)
Parameters
Returns
ProcessExited()
public void ProcessExited()
ProcessMessage(IncomingMessage, bool)
public bool ProcessMessage(IncomingMessage message, bool isReply)
Parameters
messageIncomingMessageisReplybool
Returns
ReadBuffer(int)
public byte[] ReadBuffer(int bytesToRead)
Parameters
bytesToReadint
Returns
- byte[]
ReadMemory(uint, uint)
public (byte[] Buffer, uint ErrorCode, bool Success) ReadMemory(uint address, uint length)
Parameters
Returns
RebootDevice(RebootOptions, IProgress<string>)
public bool RebootDevice(RebootOptions options = RebootOptions.NormalReboot, IProgress<string> log = null)
Parameters
optionsRebootOptionslogIProgress<string>
Returns
Reconnect(bool, int)
public bool Reconnect(bool fSoftReboot, int millisecondsTimeout = 5000)
Parameters
Returns
ReplyBadPacket(uint)
public void ReplyBadPacket(uint flags)
Parameters
flagsuint
ResizeScratchPad(int)
public bool ResizeScratchPad(int size)
Parameters
sizeint
Returns
ResolveAllAssemblies()
public List<Commands.DebuggingResolveAssembly> ResolveAllAssemblies()
Returns
ResolveAppDomain(uint)
public Commands.Debugging_Resolve_AppDomain.Reply ResolveAppDomain(uint appDomainID)
Parameters
appDomainIDuint
Returns
ResolveAssembly(uint)
public Commands.DebuggingResolveAssembly.Reply ResolveAssembly(uint idx)
Parameters
idxuint
Returns
ResolveField(uint)
public Commands.Debugging_Resolve_Field.Result ResolveField(uint fd)
Parameters
fduint
Returns
ResolveMethod(uint)
public Commands.Debugging_Resolve_Method.Result ResolveMethod(uint md)
Parameters
mduint
Returns
ResolveType(uint)
public Commands.Debugging_Resolve_Type.Result ResolveType(uint td)
Parameters
tduint
Returns
ResumeExecution()
public bool ResumeExecution()
Returns
ResumeProcessing()
public void ResumeProcessing()
ResumeThread(uint)
public bool ResumeThread(uint pid)
Parameters
piduint
Returns
SendBuffer(byte[])
public int SendBuffer(byte[] buffer)
Parameters
bufferbyte[]
Returns
SetBreakpoints(Debugging_Execution_BreakpointDef[])
public bool SetBreakpoints(Commands.Debugging_Execution_BreakpointDef[] breakpoints)
Parameters
breakpointsDebugging_Execution_BreakpointDef[]
Returns
SetCurrentAppDomain(uint)
public bool SetCurrentAppDomain(uint id)
Parameters
iduint
Returns
SetExecutionMode(State, State)
public bool SetExecutionMode(Commands.DebuggingExecutionChangeConditions.State flagsToSet, Commands.DebuggingExecutionChangeConditions.State flagsToReset)
Parameters
flagsToSetCommands.DebuggingExecutionChangeConditions.StateflagsToResetCommands.DebuggingExecutionChangeConditions.State
Returns
SetIPOfStackFrame(uint, uint, uint, uint)
public bool SetIPOfStackFrame(uint pid, uint depth, uint IP, uint depthOfEvalStack)
Parameters
Returns
SetProfilingMode(uint, uint)
public (uint Current, bool Success) SetProfilingMode(uint iSet, uint iReset)
Parameters
Returns
SetSecurityKey(byte[])
public bool SetSecurityKey(byte[] key)
Parameters
keybyte[]
Returns
SpuriousCharacters(byte[], int, int)
public void SpuriousCharacters(byte[] buf, int offset, int count)
Parameters
StartUpdate(string, ushort, ushort, uint, uint, uint, uint, uint, uint)
public int StartUpdate(string provider, ushort versionMajor, ushort versionMinor, uint updateId, uint updateType, uint updateSubType, uint updateSize, uint packetSize, uint installAddress)
Parameters
providerstringversionMajorushortversionMinorushortupdateIduintupdateTypeuintupdateSubTypeuintupdateSizeuintpacketSizeuintinstallAddressuint
Returns
- int
The update handle value. -1 if the start update request failed.
Stop(bool)
public void Stop(bool force = false)
Parameters
forcebool
StopProcessing()
public void StopProcessing()
SuspendThread(uint)
public bool SuspendThread(uint pid)
Parameters
piduint
Returns
UnlockDevice(byte[])
public bool UnlockDevice(byte[] blob)
Parameters
blobbyte[]
Returns
UnwindThread(uint, uint)
public bool UnwindThread(uint pid, uint depth)
Parameters
Returns
UpdateAuthCommand(int, uint, byte[])
public (byte[] Response, bool Success) UpdateAuthCommand(int updateHandle, uint authCommand, byte[] commandArgs)
Parameters
Returns
UpdateAuthenticate(int, byte[])
public bool UpdateAuthenticate(int updateHandle, byte[] authenticationData)
Parameters
Returns
UpdateDebugFlags()
public bool UpdateDebugFlags()
Returns
UpdateDeviceConfiguration(DeviceConfiguration)
Writes the full configuration to the device. This method should be used when the target device stores the configuration in a flash sector.
public Engine.UpdateDeviceResult UpdateDeviceConfiguration(DeviceConfiguration configuration)
Parameters
configurationDeviceConfigurationThe device configuration
Returns
UpdateDeviceConfiguration<T>(T, uint)
Writes a specific configuration block to the device. The configuration block is updated only with the changes for this configuration part.
public Engine.UpdateDeviceResult UpdateDeviceConfiguration<T>(T configuration, uint blockIndex)
Parameters
configurationTThe configuration block
blockIndexuintThe index of this configuration block
Returns
Type Parameters
T
WriteMemory(uint, byte[], int, int, int, int, int, IProgress<MessageWithProgress>, IProgress<string>)
public AccessMemoryErrorCodes WriteMemory(uint address, byte[] buffer, int programAligment = 0, int deploymentExecuted = 0, int deploymentLength = 0, int opearationExecutedLenght = 0, int operationTotalLength = 0, IProgress<MessageWithProgress> progress = null, IProgress<string> log = null)
Parameters
addressuintbufferbyte[]programAligmentintdeploymentExecutedintdeploymentLengthintopearationExecutedLenghtintoperationTotalLengthintprogressIProgress<MessageWithProgress>logIProgress<string>
Returns
WriteMemory(uint, byte[], int, int, int, int, int, int, int, IProgress<MessageWithProgress>, IProgress<string>)
public AccessMemoryErrorCodes WriteMemory(uint address, byte[] buffer, int offset, int length, int programAligment = 0, int deploymentExecuted = 0, int deploymentLength = 0, int operationExecutedLenght = 0, int operationTotalLength = 0, IProgress<MessageWithProgress> progress = null, IProgress<string> log = null)
Parameters
addressuintbufferbyte[]offsetintlengthintprogramAligmentintdeploymentExecutedintdeploymentLengthintoperationExecutedLenghtintoperationTotalLengthintprogressIProgress<MessageWithProgress>logIProgress<string>
Returns
Events
OnCommand
public event CommandEventHandler OnCommand
Event Type
OnMessage
public event MessageEventHandler OnMessage
Event Type
OnNoise
public event NoiseEventHandler OnNoise
Event Type
OnProcessExit
public event EventHandler OnProcessExit
Event Type
SpuriousCharactersReceived
public event EventHandler<StringEventArgs> SpuriousCharactersReceived