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
fileName
stringFile name.
fileContent
byte[]Content of the file.
operationExecutedLenght
intCount of bytes already executed in this operation.
operationTotalLength
intTotal length of the operation, in bytes.
progress
IProgress<MessageWithProgress>An IProgress<T> object to track the progress of the deploy operation.
log
IProgress<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
size
uint
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
fileName
stringName of file to delete.
operationExecutedLenght
intCount of bytes already executed in this operation.
operationTotalLength
intTotal length of the operation, in bytes.
progress
IProgress<MessageWithProgress>An IProgress<T> object to track the progress of the deploy operation.
log
IProgress<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
assemblies
List<byte[]>A collection of assemblies to deploy.
rebootAfterDeploy
booltrue to reboot device after a successfull deployment.
skipErase
booltrue to skip erasing the storage block before writting to it.
progress
IProgress<MessageWithProgress>An IProgress<T> object to track the progress of the deploy operation.
log
IProgress<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
disposing
bool
EraseMemory(uint, uint)
public (AccessMemoryErrorCodes ErrorCode, bool Success) EraseMemory(uint address, uint length)
Parameters
Returns
ExecuteMemory(uint)
public bool ExecuteMemory(uint address)
Parameters
address
uint
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
cancellationToken
CancellationToken
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
fd
uint
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
configurationBlockIndex
uint
Returns
GetPacketMaxLength(OverheadBase)
public int GetPacketMaxLength(Commands.OverheadBase cmd)
Parameters
cmd
Commands.OverheadBase
Returns
GetScratchPadValue(int)
public RuntimeValue GetScratchPadValue(int index)
Parameters
index
int
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
pid
uintdepth
uintkind
Engine.StackValueKindindex
uint
Returns
GetStackFrameValueAll(uint, uint, uint, StackValueKind)
public List<RuntimeValue> GetStackFrameValueAll(uint pid, uint depth, uint cValues, Engine.StackValueKind kind)
Parameters
pid
uintdepth
uintcValues
uintkind
Engine.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
fd
uint
Returns
GetTargetInfo()
public CLRCapabilities.TargetInfoProperties GetTargetInfo()
Returns
GetThread(uint)
public RuntimeValue GetThread(uint pid)
Parameters
pid
uint
Returns
GetThreadException(uint)
public RuntimeValue GetThreadException(uint pid)
Parameters
pid
uint
Returns
GetThreadList()
public uint[] GetThreadList()
Returns
- uint[]
GetThreadStack(uint)
public Commands.Debugging_Thread_Stack.Reply GetThreadStack(uint pid)
Parameters
pid
uint
Returns
GetThreads()
public List<ThreadStatus> GetThreads()
Returns
GetTypeName(uint)
public string GetTypeName(uint td)
Parameters
td
uint
Returns
GetVirtualMethod(uint, RuntimeValue)
public uint GetVirtualMethod(uint md, RuntimeValue obj)
Parameters
md
uintobj
RuntimeValue
Returns
GetWireless80211ConfiguratonProperties(uint)
public DeviceConfiguration.Wireless80211ConfigurationProperties GetWireless80211ConfiguratonProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndex
uint
Returns
GetWirelessAPConfiguratonProperties(uint)
public DeviceConfiguration.WirelessAPConfigurationProperties GetWirelessAPConfiguratonProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndex
uint
Returns
GetX509CertificatesProperties(uint)
public DeviceConfiguration.X509CaRootBundleProperties GetX509CertificatesProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndex
uint
Returns
GetX509DeviceCertificatesProperties(uint)
public DeviceConfiguration.X509DeviceCertificatesProperties GetX509DeviceCertificatesProperties(uint configurationBlockIndex)
Parameters
configurationBlockIndex
uint
Returns
IncomingMessagesListener()
public void IncomingMessagesListener()
Info_SetJMC(bool, Kind, uint)
public bool Info_SetJMC(bool fJMC, ReflectionDefinition.Kind kind, uint index)
Parameters
fJMC
boolkind
ReflectionDefinition.Kindindex
uint
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
pid
uint
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
message
IncomingMessageisReply
bool
Returns
ReadBuffer(int)
public byte[] ReadBuffer(int bytesToRead)
Parameters
bytesToRead
int
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
options
RebootOptionslog
IProgress<string>
Returns
Reconnect(bool, int)
public bool Reconnect(bool fSoftReboot, int millisecondsTimeout = 5000)
Parameters
Returns
ReplyBadPacket(uint)
public void ReplyBadPacket(uint flags)
Parameters
flags
uint
ResizeScratchPad(int)
public bool ResizeScratchPad(int size)
Parameters
size
int
Returns
ResolveAllAssemblies()
public List<Commands.DebuggingResolveAssembly> ResolveAllAssemblies()
Returns
ResolveAppDomain(uint)
public Commands.Debugging_Resolve_AppDomain.Reply ResolveAppDomain(uint appDomainID)
Parameters
appDomainID
uint
Returns
ResolveAssembly(uint)
public Commands.DebuggingResolveAssembly.Reply ResolveAssembly(uint idx)
Parameters
idx
uint
Returns
ResolveField(uint)
public Commands.Debugging_Resolve_Field.Result ResolveField(uint fd)
Parameters
fd
uint
Returns
ResolveMethod(uint)
public Commands.Debugging_Resolve_Method.Result ResolveMethod(uint md)
Parameters
md
uint
Returns
ResolveType(uint)
public Commands.Debugging_Resolve_Type.Result ResolveType(uint td)
Parameters
td
uint
Returns
ResumeExecution()
public bool ResumeExecution()
Returns
ResumeProcessing()
public void ResumeProcessing()
ResumeThread(uint)
public bool ResumeThread(uint pid)
Parameters
pid
uint
Returns
SendBuffer(byte[])
public int SendBuffer(byte[] buffer)
Parameters
buffer
byte[]
Returns
SetBreakpoints(Debugging_Execution_BreakpointDef[])
public bool SetBreakpoints(Commands.Debugging_Execution_BreakpointDef[] breakpoints)
Parameters
breakpoints
Debugging_Execution_BreakpointDef[]
Returns
SetCurrentAppDomain(uint)
public bool SetCurrentAppDomain(uint id)
Parameters
id
uint
Returns
SetExecutionMode(State, State)
public bool SetExecutionMode(Commands.DebuggingExecutionChangeConditions.State flagsToSet, Commands.DebuggingExecutionChangeConditions.State flagsToReset)
Parameters
flagsToSet
Commands.DebuggingExecutionChangeConditions.StateflagsToReset
Commands.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
key
byte[]
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
provider
stringversionMajor
ushortversionMinor
ushortupdateId
uintupdateType
uintupdateSubType
uintupdateSize
uintpacketSize
uintinstallAddress
uint
Returns
- int
The update handle value. -1 if the start update request failed.
Stop(bool)
public void Stop(bool force = false)
Parameters
force
bool
StopProcessing()
public void StopProcessing()
SuspendThread(uint)
public bool SuspendThread(uint pid)
Parameters
pid
uint
Returns
UnlockDevice(byte[])
public bool UnlockDevice(byte[] blob)
Parameters
blob
byte[]
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
configuration
DeviceConfigurationThe 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
configuration
TThe configuration block
blockIndex
uintThe 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
address
uintbuffer
byte[]programAligment
intdeploymentExecuted
intdeploymentLength
intopearationExecutedLenght
intoperationTotalLength
intprogress
IProgress<MessageWithProgress>log
IProgress<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
address
uintbuffer
byte[]offset
intlength
intprogramAligment
intdeploymentExecuted
intdeploymentLength
intoperationExecutedLenght
intoperationTotalLength
intprogress
IProgress<MessageWithProgress>log
IProgress<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