winIDEA SDK
isys::CDataController2 Class Reference

Description

This class contains advanced methods, which are needed for complex projects, for example Eclipse debugger plug-in.

IMPORTANT: Resources allocated by calls to some methods of this class must be explicitly released. This is true also for managed languages like Java and C#. Improper allocation/releasing of resources may crash application!

#include <CDataController2.h>

Inheritance diagram for isys::CDataController2:
isys::CDataController isys::WrapperBase

Public Types

enum  ESymbolsType {
  estFunctions , estGlobalVariables ,
  estModules
}
 Types of symbols to be returned by the method getSymbols(). More...
 

Public Member Functions

 CDataController2 (std::shared_ptr< ConnectionMgr > connectionMgr)
 Instantiates object associated with the given connection.
 
iEclipse::SInfo getTargetInfo ()
 Obtains general info about the target, not provided with other methods. More...
 
CRegisterInfo getRegisterInfo (int registerIdx)
 Provides info about a register. More...
 
iEclipse::IDisassemblyBlockgetDisassembly (DWORD flags, const std::string &fileName, int lineNumber, int numLines)
 This method provides disassembly of the given source code block. More...
 
iEclipse::IDisassemblyBlockgetDisassembly (DWORD flags, BYTE memArea, ADDRESS_64 startAddress, ADDRESS_64 numMAUs)
 This method provides disassembly of the given source code block. More...
 
iEclipse::IStackFrameInfogetStackFrameInfo (bool isActiveFrameOnly, bool isAbsolutePath)
 Provides the current stack frames. More...
 
void release (iEclipse::IStackFrameInfo *ptr)
 Releases instance of iEclipse::IStackFrameInfo. More...
 
void release (iEclipse::IExpressionType *ptr)
 Releases instance of iEclipse::IExpressionType. More...
 
void release (iEclipse::IDisassemblyBlock *ptr)
 Releases instance of iEclipse::IDisassemblyBlock. More...
 
void release (iEclipse::IGlobals *ptr)
 Releases instance of iEclipse::IGlobals. More...
 
void release (iEclipse::IConfiguration *ptr)
 Releases instance of iEclipse::IConfiguration. More...
 
void release (iEclipse::ICPUSFR *ptr)
 Releases instance of iEclipse::ICPUSFR. More...
 
void setStackFrameContext (DWORD flags, DWORD context)
 Sets active stack frame. More...
 
iEclipse::IExpressionTypegetExpressionType (DWORD flags, const std::string &expression)
 Provides information about expression. More...
 
iEclipse::IGlobalsgetGlobals (DWORD flags, DWORD partition)
 Provides information about global items in a program. More...
 
iEclipse::IConfigurationgetConfiguration (DWORD flags)
 Returns program configuration, for example partitions. More...
 
iEclipse::ICPUSFRgetCPUSFRs (DWORD flags)
 Provides information about CPU's SFRs. More...
 
CValueType readSFR (DWORD dwHandle, const SType &type)
 Reads SFR. More...
 
CValueType writeSFR (DWORD flags, DWORD dwHandle, const CValueType &value)
 Writes value to SFR, then optionally reads it, to get the actual value. More...
 
isys::CDataCompositeSPtr evaluateComposite (IConnectDebug::EAccessFlags accessFlags, const std::string &expression, bool isGetValue, int maxArrayElements)
 Evaluates expression which may refer to composed data, for example arrays and structures. More...
 
CCPUInfo getCPUInfo ()
 Returns CPU info. More...
 
int getMemoryAreaBytesPerMAU (int memArea)
 Returns the number of bytes per addressable memory unit. More...
 
std::vector< BYTE > readMemory (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, ADDRESS_64 aNumMAUs, BYTE bytesPerMAU)
 This method reads memory block and returns data and access info. More...
 
std::vector< BYTE > writeMemory (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, ADDRESS_64 aNumMAUs, BYTE bytesPerMAU, std::vector< BYTE > &buff)
 Writes block of data to target memory, and returns access information. More...
 
void writeMemoryNAI (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, ADDRESS_64 aNumMAUs, BYTE bytesPerMAU, std::vector< BYTE > &buff)
 Writes block of data to target memory. More...
 
CValueType readRegister (IConnectDebug::EAccessFlags accessFlags, const std::string &registerName)
 Reads the specified general purpose register. More...
 
void writeRegister (IConnectDebug::EAccessFlags accessFlags, const std::string &registerName, const CValueType &registerInfo)
 Writes value to the specified core register. More...
 
CValueType readValue (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, const SType &type)
 Reads a value from the target system. More...
 
void writeValue (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, const CValueType &value)
 Writes a value to the target system. More...
 
void writeValue (IConnectDebug::EAccessFlags accessFlags, bool isNotRefreshWinIDEAGUIAfterWrite, BYTE memArea, ADDRESS_64 aAddress, const CValueType &value)
 Writes a value to the target system. More...
 
CValueType evaluate (IConnectDebug::EAccessFlags accessFlags, const std::string &expression)
 Calls evaluate(IConnectDebug::EAccessFlags, IConnectDebug::EEvaluate, const std::string &expression) with evaluateFlags = IConnectDebug::efDefaultMemAreaDisplay. More...
 
CValueType evaluate (IConnectDebug::EAccessFlags accessFlags, IConnectDebug::EEvaluate evaluateFlags, const std::string &expression)
 Evaluates an expression. More...
 
std::string modify (IConnectDebug::EAccessFlags accessFlags, const std::string &expression, const CValueType &value, bool readBack=true)
 See modify(IConnectDebug::EAccessFlags, IConnectDebug::EEvaluate, const std::string &, const CValueType &, bool). More...
 
std::string modify (IConnectDebug::EAccessFlags accessFlags, const std::string &expression, const std::string &value, bool readBack=true)
 See modify(IConnectDebug::EAccessFlags, IConnectDebug::EEvaluate, const std::string &, const CValueType &, bool). More...
 
std::string modify (IConnectDebug::EAccessFlags accessFlags, IConnectDebug::EEvaluate evaluateFlags, const std::string &expression, const CValueType &value, bool readBack=true)
 Modifies expression to value. More...
 
std::string modify (IConnectDebug::EAccessFlags accessFlags, IConnectDebug::EEvaluate evaluateFlags, const std::string &expression, const std::string &value, bool readBack=true)
 Modifies expression to string value. More...
 
bool batchAccess (DWORD dwBatchAccessFlags, const struct SBatchAccessHeader *pBatchAccessHeader, const std::vector< SBatchAccessItem > &batchAccessItems, std::vector< SBatchAccessItemResult > &batchAccessItemResults)
 Performs multiple memory accesses, using deterministic delays. More...
 
void eraseFlash (int nDevice=-1)
 
void secureFlash (int nDevice=-1)
 Secures FLASH memory. More...
 
void unsecureFlash (int nDevice=-1)
 Unsecures FLASH memory. More...
 
void getSymbols (ESymbolsType symbolsType, iconnect::StrVector &symbolNames, int partition=PARTITION_DEFAULT)
 Gets list of all symbols of the specified type. More...
 
void getStackFrames (bool isActiveFrameOnly, bool isAbsPaths, isys::StackFrameVector &stackFrames)
 Gets list of current stack frames on a target. More...
 
void getVariables (int partition, VariableVector &variables)
 Returns list of global variables in a download file. More...
 
void getLabels (int partition, VariableVector &labels)
 Returns list of labels in a download file. More...
 
void getModules (int partition, ModuleVector &modules)
 Returns list of source code files which were used to generate a download file. More...
 
void getFunctions (int partition, FunctionVector &functions)
 Returns list of functions in a download file. More...
 
void getTypes (int partition, TypeVector &types)
 Returns list of types in a download file. More...
 
void getTypedefs (int partition, TypedefVector &typedefs)
 
void getPartitions (iconnect::StrVector &paths, iconnect::StrVector &fileNames)
 Returns a list of download files. More...
 
void getMacros (int partition, iconnect::StrVector &names, iconnect::StrVector &values)
 Returns a list of macros in the given partition. More...
 
CSystemMemoryAreas getSystemMemoryAreas ()
 This method returns information about memory areas available on a target. More...
 
EEndian getDefaultEndian ()
 Returns default CPU endian mode. More...
 
CStackUsage getStackUsage ()
 Returns information about maximum stack usage since seedStack() was called. More...
 
void seedStack ()
 Writes the given values to stack memory area. More...
 
void configureStackUsage (ADDRESS_64 start, ADDRESS_64 end, unsigned char value=0xcc)
 
void configureStackUsage (const std::string &start, const std::string &end, unsigned char value)
 
isys::CCodeStoreSPtr csCreate ()
 This method creates an empty code store object. More...
 
isys::CCodeStoreSPtr csGetDownloaded (BYTE memArea, const std::string &fileDownload, bool data)
 This method retrieves all downloaded code. More...
 
isys::CCodeStoreSPtr csReadMemory (BYTE memArea, const isys::CCodeStoreSPtr &rspSource)
 This method reads memory to the given rspSource object. More...
 
isys::CCodeStoreSPtr csVerifyDownloaded (BYTE memArea, const std::string &fileDownload, const std::string &fileReport, IConnectDebug2::ECodeCacheOp verifyAgainst=IConnectDebug2::ccSrcLoaded)
 This method verifies downloaded data with the given file. More...
 
isys::CCodeStoreSPtr csDif (const isys::CCodeStoreSPtr &rsp1, const isys::CCodeStoreSPtr &rsp2, bool flDifferent=true, bool flNotIn1=true, bool flNotIn2=true, bool flEqual=false)
 This method returns differences between two SPCodeStore instances. More...
 

Static Public Member Functions

static void setByte (BYTE *array, int idx, BYTE value)
 Sets array element at index idx to value. More...
 
static BYTE getByte (BYTE *array, int idx)
 Gets array element at index idx. More...
 
static std::vector< BYTE > byteArrayToVector (BYTE *array, size_t len)
 This method converts byte array to std::vector<BYTE>, which is supported by SWIG and provides better access than pure C arrays.
 
static void vectorToByteArray (std::vector< BYTE > &buff, BYTE *array, size_t size)
 This method converts std::vector<BYTE> to byte array.
 

Static Public Attributes

static const int PARTITION_DEFAULT = -1
 The default download file is sued.
 
static const int PARTITION_CURRENT = -2
 The current download file is used.
 

Member Enumeration Documentation

◆ ESymbolsType

Types of symbols to be returned by the method getSymbols().

Enumerator
estFunctions 

get functions

estGlobalVariables 

get global variables

estModules 

get modules

Member Function Documentation

◆ batchAccess()

bool isys::CDataController::batchAccess ( DWORD  dwBatchAccessFlags,
const struct SBatchAccessHeader pBatchAccessHeader,
const std::vector< SBatchAccessItem > &  batchAccessItems,
std::vector< SBatchAccessItemResult > &  batchAccessItemResults 
)
inherited

Performs multiple memory accesses, using deterministic delays.

Parameters
dwBatchAccessFlagssee enum EFlags in SBatchAccessHeader, flags that start with prefix 'fl'
pBatchAccessHeadersee SBatchAccessHeader
batchAccessItemsitems defining the type and time of an individual access.
batchAccessItemResultsobjects that will receive the results of every individual access.
Returns
true if OK, false if the specified time restrictions could not be kept
Exceptions
IOExceptionif one of the accesses failed
FeatureNotImplementedExceptionif batch access is not implemented for your target

Example:

  const int NUM_ITEMS = 1;  // just one item to execute in every run
  const int NUM_RUNS  = 100;   // perform so many iterations

  SBatchAccessHeader  BAH = {0};
  SBatchAccessItem    aBAI[NUM_ITEMS];
  memset(aBAI, 0, sizeof aBAI);

  // define header
  BAH.m_dwFlags       = SBatchAccessHeader::flRealTime; // use real-time access
  BAH.m_dwFlags       |= SBatchAccessHeader::flWantTimeStamp;
  BAH.m_dwNumItems    = NUM_ITEMS;
  BAH.m_dwNumRuns     = NUM_RUNS;
  BAH.m_qwRunInterval = 500;                            // every 500 us

  // Define item(s), iCounter in this case. Call CAddressController::getSymbolInfo()
  // to get aSizeMAUs, byMemArea, and aAddress of iCounter.

  aBAI[0].m_byFlags   = SBatchAccessItem::flRead;       // it's a read
  aBAI[0].m_bySize    = (BYTE)aSizeMAUs;                // size or iCounter
  aBAI[0].m_byMemArea = byMemArea;                      // memory area of iCounter
  aBAI[0].m_aAddress  = aAddress;                       // address of iCounter

  SBatchAccessItemResult aBAIR[NUM_ITEMS * NUM_RUNS];   // make space for results

  bool hr = batchAccess(0, &BAH, aBAI, aBAIR);

Python example: test_batch_access.py

◆ configureStackUsage() [1/2]

void isys::CDataController::configureStackUsage ( ADDRESS_64  start,
ADDRESS_64  end,
unsigned char  value = 0xcc 
)
inherited
Deprecated:
use CConfigurationController::ide_app() to control stack configuration instead. Python example: test_configure_stack_usage.py

◆ configureStackUsage() [2/2]

void isys::CDataController::configureStackUsage ( const std::string &  start,
const std::string &  end,
unsigned char  value 
)
inherited
Deprecated:
use CConfigurationController::ide_app() to control stack configuration instead. See python example.

Configures winIDEA options used for measuring stack usage. This method changes values of options Debug.StackUsage.* in winIDEA. This method must be called before download, for settings to take effect. After download you should call seedStack() without parameters to seed the stack memory region.

Parameters
startstarting address. If both start and end are empty strings, then stack usage monitoring is disabled.
endend address - value at this address is not modified, so that size = end - start. If both start and end are empty strings, then stack usage monitoring is disabled.
valuevalue to write to the stack. Not that this value should not interfere with other values written to stack to get reliable stack usage with getStackUsage().

Python example: test_configure_stack_usage.py

◆ csCreate()

isys::CCodeStoreSPtr isys::CDataController::csCreate ( )
inherited

This method creates an empty code store object.

Returns

Python example: test_cs_read_memory.py

◆ csDif()

isys::CCodeStoreSPtr isys::CDataController::csDif ( const isys::CCodeStoreSPtr rsp1,
const isys::CCodeStoreSPtr rsp2,
bool  flDifferent = true,
bool  flNotIn1 = true,
bool  flNotIn2 = true,
bool  flEqual = false 
)
inherited

This method returns differences between two SPCodeStore instances.

Parameters
rsp1the first CCodeStore object
rsp2the second CCodeStore object
flDifferentreport locations present in both objects, but with different contents
flNotIn1report locations that are not in rsp1, but present int rsp2
flNotIn2report locations that are not in rsp2, but present int rsp1
flEqualreport locations with equal contents
Returns
  • CCodeStore object containing the differences between rsp1 and rsp2. Data values use ICodeCache::EDifType encoding

Python example: test_code_store_diff.py

◆ csGetDownloaded()

isys::CCodeStoreSPtr isys::CDataController::csGetDownloaded ( BYTE  memArea,
const std::string &  fileDownload,
bool  data 
)
inherited

This method retrieves all downloaded code.

Parameters
memAreaspecifies the memory space for which the downloaded code should be retrieved
fileDownloadif empty, all downloaded code is retrieved, otherwise only for the specified file
datatrue to retrieve the data. Otherwise only address information is retrieved.
Returns
  • CCodeStore object containing the downloaded code

Python example: test_code_store.py

◆ csReadMemory()

isys::CCodeStoreSPtr isys::CDataController::csReadMemory ( BYTE  memArea,
const isys::CCodeStoreSPtr rspSource 
)
inherited

This method reads memory to the given rspSource object.

Parameters
memAreaspecifies the memory space from which to read
rspSourcea CCodeStore object filled with items (address and size), which should be read
Returns

Python example: test_cs_read_memory.py

◆ csVerifyDownloaded()

isys::CCodeStoreSPtr isys::CDataController::csVerifyDownloaded ( BYTE  memArea,
const std::string &  fileDownload,
const std::string &  fileReport,
IConnectDebug2::ECodeCacheOp  verifyAgainst = IConnectDebug2::ccSrcLoaded 
)
inherited

This method verifies downloaded data with the given file.

Parameters
memAreaspecifies the memory space for which the verify should be performed
fileDownloadif empty, all downloaded code is verified, otherwise only for the specified file
fileReportfile path to which the report should be written. If empty no report is generated
verifyAgainstcan be one of IConnectDebug2::ccSrcLoaded, IConnectDebug2::ccSrcInFiles, or IConnectDebug2::ccSrcFiltered.
Returns
  • CCodeStore object containing the differences between loaded and read-back code. All data values are ICodeCache::EDifType::dtDif

Python example: test_cs_verify_downloaded.py

◆ eraseFlash()

void isys::CDataController::eraseFlash ( int  nDevice = -1)
inherited
Deprecated:
use isys::CStorageDeviceController::erase() instead.

Erases FLASH memory.

Parameters
nDeviceif -1 all FLASH devices are processed, otherwise only the specified device

◆ evaluate() [1/2]

CValueType isys::CDataController::evaluate ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  expression 
)
inherited

Calls evaluate(IConnectDebug::EAccessFlags, IConnectDebug::EEvaluate, const std::string &expression) with evaluateFlags = IConnectDebug::efDefaultMemAreaDisplay.

Python example with online value graph: chart_sample.py
Python module for plotting of watch expressions: variables_chart.py
Python example with web server providing results of this method: webserver.py

Python example: test_data_evaluate.py

◆ evaluate() [2/2]

CValueType isys::CDataController::evaluate ( IConnectDebug::EAccessFlags  accessFlags,
IConnectDebug::EEvaluate  evaluateFlags,
const std::string &  expression 
)
inherited

Evaluates an expression.

Works only for simple types. See also Qualified Variable Names.

Parameters
accessFlagsIConnectDebug::EAccessFlags determine what kind of memory access is permitted if required to resolve the expression
evaluateFlagsdefine result format
expressionany C syntax expression. CPU registers (including SFRs) can be used in expression with prefix '@', for example '@R0'.
Exceptions
IOExceptionif complex type is given or in case of an error

◆ evaluateComposite()

isys::CDataCompositeSPtr isys::CDataController2::evaluateComposite ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  expression,
bool  isGetValue,
int  maxArrayElements 
)

Evaluates expression which may refer to composed data, for example arrays and structures.

Let's have:

MyStruct a[10]

Returned object will contain information about array (type of elements and size), and 10 elements, each of them containing also elements of MyStruct.

Parameters
accessFlagssee IConnectDebug::EAccessFlags, usually we specify IConnectDebug::fMonitor or IConnectDebug::fRealTime.
expressionC expression or name of variable to be evaluated.
isGetValueif true, values of all elements are evaluated - call CDataComposite::getValue() to get the value. If false, only structure of composite is returned - types and children of elements. Call to CDataElement::getValue() will throw an exception in this case.
maxArrayElementsmax number of array elements to show. Since arrays may be very large, setting of this parameter can enable getting of structures with large arrays.
Returns
object containing information about the given expression and its children.

Python example: test_evaluate_composite.py

◆ getByte()

static BYTE isys::CDataController::getByte ( BYTE *  array,
int  idx 
)
staticinherited

Gets array element at index idx.

This is general method, which can be used to read arrays, which are returned by isystem.connect function parameters or are elements of isystem.connect structures, for example SBatchAccessItem.

Python example: test_batch_access.py

◆ getConfiguration()

iEclipse::IConfiguration * isys::CDataController2::getConfiguration ( DWORD  flags)

Returns program configuration, for example partitions.

The returned resource must be released with call to method release() after usage.

Parameters
flagsreserved, should be 0.

Python example: test_get_configuration.py

◆ getCPUInfo()

CCPUInfo isys::CDataController::getCPUInfo ( )
inherited

Returns CPU info.

See definition of this struct in CCPUInfo.h for enum constants which describe CPU type.

Python example: test_cpu_info.py

◆ getCPUSFRs()

iEclipse::ICPUSFR * isys::CDataController2::getCPUSFRs ( DWORD  flags)

Provides information about CPU's SFRs.

The returned resource must be released with call to method release() after usage.

Parameters
flagsone of values defined in iEclipse::IConnectEclipse::EGetCPUSFR.

Python example: test_get_cpusfrs.py

◆ getDefaultEndian()

EEndian isys::CDataController::getDefaultEndian ( )
inherited

Returns default CPU endian mode.

Python example: test_get_default_endian.py

◆ getDisassembly() [1/2]

iEclipse::IDisassemblyBlock * isys::CDataController2::getDisassembly ( DWORD  flags,
BYTE  memArea,
ADDRESS_64  startAddress,
ADDRESS_64  numMAUs 
)

This method provides disassembly of the given source code block.

The returned resource must be released with call to method release() after usage.

Parameters
flagssee iEclipse::IConnectEclipse::EDisassemblyFlags for possible values
memAreamemory area of the code block
startAddressstarting address of the code block
numMAUsnumber of memory allocation units to get disassembly for

◆ getDisassembly() [2/2]

iEclipse::IDisassemblyBlock * isys::CDataController2::getDisassembly ( DWORD  flags,
const std::string &  fileName,
int  lineNumber,
int  numLines 
)

This method provides disassembly of the given source code block.

The returned resource must be released with call to method release() after usage.

Parameters
flagssee iEclipse::IConnectEclipse::EDisassemblyFlags for possible values
fileNamename of the source code file
lineNumberstarting line number of the code block
numLinesnumber of source code lines to get disassembly for

Python example: test_get_disassembly.py

◆ getExpressionType()

iEclipse::IExpressionType * isys::CDataController2::getExpressionType ( DWORD  flags,
const std::string &  expression 
)

Provides information about expression.

This method can be used to get information about complex variables, for example members of a structure, elements of array, ... The returned resource must be released with call to method release() after usage.

Parameters
flagsreserved, should be 0
expressionC expression, for example myStruct.counter, or p->a[0]

Python example: test_get_expression_type.py

◆ getFunctions()

void isys::CDataController::getFunctions ( int  partition,
FunctionVector functions 
)
inherited

Returns list of functions in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
functionsvector to receive result

Python example: test_get_functions.py

◆ getGlobals()

iEclipse::IGlobals * isys::CDataController2::getGlobals ( DWORD  flags,
DWORD  partition 
)

Provides information about global items in a program.

The returned object contains only information requested by flags. The returned resource must be released with call to method release() after usage.

Parameters
flagssee iEclipse::IConnectEclipse::EGetGlobalsFlags for possible values
partitionpartition index

Python example: test_get_globals.py

◆ getLabels()

void isys::CDataController::getLabels ( int  partition,
VariableVector labels 
)
inherited

Returns list of labels in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
labelsvector to receive result

Python example: test_get_labels.py

◆ getMacros()

void isys::CDataController::getMacros ( int  partition,
iconnect::StrVector names,
iconnect::StrVector values 
)
inherited

Returns a list of macros in the given partition.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
namesvector, which will contain names of macros on return.
valuesvector, which will contain values of macros on return.

Python example: test_get_macros.py

◆ getMemoryAreaBytesPerMAU()

int isys::CDataController::getMemoryAreaBytesPerMAU ( int  memArea)
inherited

Returns the number of bytes per addressable memory unit.

Parameters
memAreamemory area for which to return the number

Python example: test_get_memory_area_bytes_per_mau.py

◆ getModules()

void isys::CDataController::getModules ( int  partition,
ModuleVector modules 
)
inherited

Returns list of source code files which were used to generate a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
modulesvector to receive result

Python example: test_get_modules.py

◆ getPartitions()

void isys::CDataController::getPartitions ( iconnect::StrVector paths,
iconnect::StrVector fileNames 
)
inherited

Returns a list of download files.

Parameters
pathsvector to receive paths of download files
fileNamesvector to receive names of download files

Python example: test_get_partitions.py

◆ getRegisterInfo()

CRegisterInfo isys::CDataController2::getRegisterInfo ( int  registerIdx)

Provides info about a register.

Only main registers can be accessed by this method. Use GetCPUSFR() and SFRValue() to access SFRs.

Parameters
registerIdxregister index. Call getTargetInfo() to get the number of registers on the target. Index should be in range [0 .. SInfo.m_dwNumRegisters - 1]

Python example: test_get_register_info.py

◆ getStackFrameInfo()

iEclipse::IStackFrameInfo * isys::CDataController2::getStackFrameInfo ( bool  isActiveFrameOnly,
bool  isAbsolutePath 
)

Provides the current stack frames.

The returned resource must be released with call to method release() after usage.

Parameters
isActiveFrameOnlyif true, only the active stack frame is is retrieved. This way the method call is much faster.
isAbsolutePathif true, absolute paths are returned

Python example: test_get_stack_frame_info.py

◆ getStackFrames()

void isys::CDataController::getStackFrames ( bool  isActiveFrameOnly,
bool  isAbsPaths,
isys::StackFrameVector stackFrames 
)
inherited

Gets list of current stack frames on a target.

The stack frame information depends on compiler debug info and may not be always available.

Parameters
isActiveFrameOnlyif true, only the active frame is returned. This can be much faster than retrieving all frames.
isAbsPathsif true, absolute paths are returned
stackFramesvector to receive stack frame objects

Python example: test_get_stack_frames.py

◆ getStackUsage()

CStackUsage isys::CDataController::getStackUsage ( )
inherited

Returns information about maximum stack usage since seedStack() was called.

Python example: test_seed_get_stack_usage.py

◆ getSymbols()

void isys::CDataController::getSymbols ( ESymbolsType  symbolsType,
iconnect::StrVector symbolNames,
int  partition = PARTITION_DEFAULT 
)
inherited

Gets list of all symbols of the specified type.

Symbols must be downloaded in winIDEA before this function is called.

Parameters
symbolsTypetype of symbols to retrieve
symbolNamesafter return this vector contains names of all symbols of the specified type from download file.
partitionindex of download file to get symbols from

Python example: test_get_symbols.py

◆ getSystemMemoryAreas()

CSystemMemoryAreas isys::CDataController::getSystemMemoryAreas ( )
inherited

This method returns information about memory areas available on a target.

Python example: test_get_system_memory_areas.py

◆ getTargetInfo()

iEclipse::SInfo isys::CDataController2::getTargetInfo ( )

Obtains general info about the target, not provided with other methods.

Python example: test_get_target_info.py

◆ getTypedefs()

void isys::CDataController::getTypedefs ( int  partition,
TypedefVector typedefs 
)
inherited
Deprecated:
Use getTypes() instead.

Returns list of typedefs in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
typedefsvector to receive result

Python example: test_get_typedefs.py

◆ getTypes()

void isys::CDataController::getTypes ( int  partition,
TypeVector types 
)
inherited

Returns list of types in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
typesvector to receive result

Python example: test_get_types.py

◆ getVariables()

void isys::CDataController::getVariables ( int  partition,
VariableVector variables 
)
inherited

Returns list of global variables in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
variablesvector to receive result

Python example: test_get_variables.py

◆ modify() [1/4]

std::string isys::CDataController::modify ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  expression,
const CValueType value,
bool  readBack = true 
)
inherited

◆ modify() [2/4]

std::string isys::CDataController::modify ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  expression,
const std::string &  value,
bool  readBack = true 
)
inherited

◆ modify() [3/4]

std::string isys::CDataController::modify ( IConnectDebug::EAccessFlags  accessFlags,
IConnectDebug::EEvaluate  evaluateFlags,
const std::string &  expression,
const CValueType value,
bool  readBack = true 
)
inherited

Modifies expression to value.

The expression must evaluate to a lvalue. See also Qualified Variable Names.

Parameters
accessFlagsdetermines what kind of memory access is permitted if required to resolve the expression,
evaluateFlagsdefine result format.
expressionany C syntax expression that evaluates to a lvalue
valuecontains the value to write to expression
readBackset to false to skip reading back the value
Returns
result of evaluation as string or error description in case of error. For example for expression 'a = 10' return value is '10'.
Exceptions
IOExceptionin case of an error

Python example: test_data_modify.py

◆ modify() [4/4]

std::string isys::CDataController::modify ( IConnectDebug::EAccessFlags  accessFlags,
IConnectDebug::EEvaluate  evaluateFlags,
const std::string &  expression,
const std::string &  value,
bool  readBack = true 
)
inherited

Modifies expression to string value.

The expression must evaluate to a lvalue. See also Qualified Variable Names.

Parameters
accessFlagsdetermines what kind of memory access is permitted if required to resolve the expression,
evaluateFlagsdefine result format.
expressionany C syntax expression that evaluates to a lvalue
valuecontains the value to write to expression
readBackset to false to skip reading back the value
Exceptions
IOExceptionin case of an error

Python example: test_data_modify.py

◆ readMemory()

std::vector< BYTE > isys::CDataController::readMemory ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
ADDRESS_64  aNumMAUs,
BYTE  bytesPerMAU 
)
inherited

This method reads memory block and returns data and access info.

Returned vector contains data in the first (aNumMAUs * bytesPerMAU) bytes, and access info in aNumMAUs bytes at offset (aNumMAUs * bytesPerMAU).

Access info bytes tell us, whether read for MAU succeeded or not. Each byte is set to ACCESS_OK or ACCESS_FAIL. These two constants are defined in globdefs.h.

Contents of the returned vector:

[(target memory data, size = aNumMAUs * bytesPerMAU) (access info, size = aNumMAUs)]
Parameters
accessFlagsuse IConnectDebug::EAccessFlags
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location
aNumMAUsnumber of MAUs (memory addressable units) to read.
bytesPerMAUNumber of BYTE type locations required to fit one MAU (memory addressable unit). The number of bytes required for every MAU is:
MAU Size in bitsBytes Required per MAU
1 - 8 1
9 - 16 2
17 - 32 4
Almost all microprocessors supported by our tools have 1 byte of data stored at one address, so this value is usually set to 1. winIDEA will check this parameter and return ICONNECT_E_SIZE in case of mismatch.
Exceptions
IOExceptionin case of an error

Python example: test_read_write_memory.py

◆ readRegister()

CValueType isys::CDataController::readRegister ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  registerName 
)
inherited

Reads the specified general purpose register.

For SFRs please use method evaluate().

Parameters
accessFlagssee IConnectDebug::EAccessFlags for available flags, except fCacheCode
registerNamename of the register to read
Exceptions
IOExceptionin case of an error

Python example: test_read_write_register.py

◆ readSFR()

CValueType isys::CDataController2::readSFR ( DWORD  dwHandle,
const SType type 
)

Reads SFR.

IMPORTANT: Always check for error on return value: retVal.isError() to avoid misinterpretation of results!

Parameters
dwHandlehandle of the SFR
typedefines SFR type. Required to return valid CValueType object on output.
Returns
SFR value. The type info of return value is set to input parameter 'type'. If the call succeeds, but register value is not valid, CValueType.isError() returns true, and CValueType.getResult() returns error description.

Python example: test_read_write_sfr.py

◆ readValue()

CValueType isys::CDataController::readValue ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
const SType type 
)
inherited

Reads a value from the target system.

This function resembles readMemory() but additionally it formats the value according to the type specified (including endian conversions).

Example:

debug = ic.CDebugFacade(cmgr)

varType = ic.SType()
varType.m_byBitSize = 32
varType.m_byType = ic.SType.tSigned

memArea = 0
addr = 1073768999

value = debug.readValue(ic.IConnectDebug.fMonitor, memArea, addr, varType)

print "Result = ", value.getInt()
Parameters
accessFlagsuse IConnectDebug::EAccessFlags, except fCore, and fSFR
memAreamemory area, definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location of the first access.
typevariable containing the type info of value to be read
Exceptions
IOExceptionin case of an error

Python example: test_read_write_value.py

◆ release() [1/6]

void isys::CDataController2::release ( iEclipse::IConfiguration ptr)

Releases instance of iEclipse::IConfiguration.

Python example: test_get_configuration.py

◆ release() [2/6]

void isys::CDataController2::release ( iEclipse::ICPUSFR ptr)

Releases instance of iEclipse::ICPUSFR.

Python example: test_get_cpusfrs.py

◆ release() [3/6]

void isys::CDataController2::release ( iEclipse::IDisassemblyBlock ptr)

Releases instance of iEclipse::IDisassemblyBlock.

Python example: test_get_disassembly.py

◆ release() [4/6]

void isys::CDataController2::release ( iEclipse::IExpressionType ptr)

Releases instance of iEclipse::IExpressionType.

Python example: test_get_expression_type.py

◆ release() [5/6]

void isys::CDataController2::release ( iEclipse::IGlobals ptr)

Releases instance of iEclipse::IGlobals.

Python example: test_get_globals.py

◆ release() [6/6]

void isys::CDataController2::release ( iEclipse::IStackFrameInfo ptr)

Releases instance of iEclipse::IStackFrameInfo.

Python example: test_get_stack_frame_info.py

◆ secureFlash()

void isys::CDataController::secureFlash ( int  nDevice = -1)
inherited

Secures FLASH memory.

Parameters
nDeviceif -1 all FLASH devices are processed, otherwise only the specified device

Python example: service_functions.py

◆ seedStack()

void isys::CDataController::seedStack ( )
inherited

Writes the given values to stack memory area.

Memory locations and value are defined with options Debug.StackUsage.* in winIDEA, which can be configured with Debug | Configure Session... | Applications dialog or method configureStackUsage() in this class.

Python example: test_seed_get_stack_usage.py

◆ setByte()

static void isys::CDataController::setByte ( BYTE *  array,
int  idx,
BYTE  value 
)
staticinherited

Sets array element at index idx to value.

This is general method, which can be used to set arrays, which are required as isystem.connect function parameters or are elements of isystem.connect structures, for example SBatchAccessItem.

Python example: test_batch_access.py

◆ setStackFrameContext()

void isys::CDataController2::setStackFrameContext ( DWORD  flags,
DWORD  context 
)

Sets active stack frame.

Variables of the selected stack frame are available for evaluator (see methods CDataController::evaluate() and CDataController::modify()).

Parameters
flagsreserved, should be 0
contextindex of the stack frame to be selected

Python example: test_set_stack_frame_context.py

◆ unsecureFlash()

void isys::CDataController::unsecureFlash ( int  nDevice = -1)
inherited

Unsecures FLASH memory.

Parameters
nDeviceif -1 all FLASH devices are processed, otherwise only the specified device

Python example: service_functions.py

◆ writeMemory()

std::vector< BYTE > isys::CDataController::writeMemory ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
ADDRESS_64  aNumMAUs,
BYTE  bytesPerMAU,
std::vector< BYTE > &  buff 
)
inherited

Writes block of data to target memory, and returns access information.

Parameters
accessFlagsuse IConnectDebug::EAccessFlags
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location
aNumMAUsnumber of MAUs (memory addressable units) to write.
bytesPerMAUNumber of BYTE type locations required to fit one MAU (memory addressable unit). The number of bytes required for every MAU is:
MAU Size in bitsBytes Required per MAU
1 - 8 1
9 - 16 2
17 - 32 4
Almost all microprocessors supported by our tools have 1 byte of data stored at one address, so this value is usually set to 1. winIDEA will check this parameter and return ICONNECT_E_SIZE in case of mismatch.
buffvector, which contains data to be written to memory on the target. Languages other than C++ should instantiate class VectorBYTE for this parameter. Examples:
Python:
    buff = isystem.connect.VectorBYTE([0, 0, 0, 0xff])
Java:
    VectorBYTE buff = new VectorBYTE();
    buff.add((short)0);
    buff.add((short)0);
    buff.add((short)0);
    buff.add((short)255);
Exceptions
IOExceptionin case of an error
Returns
accessInfo contains write status, one byte per MAU for each MAU. Byte at index 0 contains access info for MAU at address aAddress, byte at index 1 contains access info for MAU at address aAddress + 1, ... See ACCESS_OK and ACCESS_FAIL in globdefs.h for possible values of access info bytes.

Python example: test_read_write_memory.py

◆ writeMemoryNAI()

void isys::CDataController::writeMemoryNAI ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
ADDRESS_64  aNumMAUs,
BYTE  bytesPerMAU,
std::vector< BYTE > &  buff 
)
inherited

Writes block of data to target memory.

This method is faster than writeMemory(), because no access information is returned.

Parameters
accessFlagsuse IConnectDebug::EAccessFlags
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location
aNumMAUsnumber of MAUs (memory addressable units) to write.
bytesPerMAUNumber of BYTE type locations required to fit one MAU (memory addressable unit). The number of bytes required for every MAU is:
MAU Size in bitsBytes Required per MAU
1 - 8 1
9 - 16 2
17 - 32 4
Almost all microprocessors supported by our tools have 1 byte of data stored at one address, so this value is usually set to 1. winIDEA will check this parameter and return ICONNECT_E_SIZE in case of mismatch.
buffvector, which contains data to be written to memory on the target. Languages other than C++ should instantiate class VectorBYTE for this parameter. Examples:
Python:
    buff = isystem.connect.VectorBYTE([0, 0, 0, 0xff])
Java:
    VectorBYTE buff = new VectorBYTE();
    buff.add((short)0);
    buff.add((short)0);
    buff.add((short)0);
    buff.add((short)255);
Exceptions
IOExceptionin case of an error
See also
writeMemory()

Python example: see test_read_write_memory.py

◆ writeRegister()

void isys::CDataController::writeRegister ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  registerName,
const CValueType registerInfo 
)
inherited

Writes value to the specified core register.

Example:

# bit size is 32, value is 1234567
r1Value = isystem.connect.CValueType(32, 1234567)
debug.writeRegister(IConnectDebug.fMonitor, 'R1', r1Value)

Longer way, if we use specific data types:

# first we should define value type
valueType = isystem.connect.SType()
valueType.m_byType = isystem.connect.SType.tSigned
valueType.m_byBitSize = 32

# create 'Value' with type and value
r0Value = isystem.connect.CValueType(valueType, 5678)

debug.writeRegister(0, "R0", r0Value)
Parameters
accessFlagssee IConnectDebug::EAccessFlags for available flags, except fCacheCode
registerNamename of the register to write to
registerInfoa value to be written to the register
Exceptions
IOExceptionin case of an error

Note: This method can modify only core registers. To modify SFRs please use the modify() method.

Python example : test_read_write_register.py

◆ writeSFR()

CValueType isys::CDataController2::writeSFR ( DWORD  flags,
DWORD  dwHandle,
const CValueType value 
)

Writes value to SFR, then optionally reads it, to get the actual value.

The type part of CValueType is not used.

Parameters
flagsflags of type ESFRValue. Values may be ORed together. Bit IConnectEclipse::svWrite is set by this method, so flags == 0 will perform write.
dwHandlehandle of the SFR
valuevalue to be written to SFR
Returns
read SFR value, if IConnectEclipse::svWriteThenRead is set, otherwise the input value is returned. Type in return value is always the same as type of input value.

Python example: test_read_write_sfr.py

◆ writeValue() [1/2]

void isys::CDataController::writeValue ( IConnectDebug::EAccessFlags  accessFlags,
bool  isNotRefreshWinIDEAGUIAfterWrite,
BYTE  memArea,
ADDRESS_64  aAddress,
const CValueType value 
)
inherited

Writes a value to the target system.

This function resembles writeMemory() but additionally it formats the value according to the type specified (including endian conversions).

Parameters
accessFlagsuse IConnectDebug::EAccessFlags, except fCore, fSFR, and fCacheXXX.
isNotRefreshWinIDEAGUIAfterWriteif true, winIDEA windows are not refreshed after write operation - this speeds up operation.
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location of the first access
valuevariable containing the value to write
Exceptions
IOExceptionin case of an error

Python example: test_read_write_value.py

◆ writeValue() [2/2]

void isys::CDataController::writeValue ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
const CValueType value 
)
inherited

Writes a value to the target system.

This function resembles writeMemory() but additionally it formats the value according to the type specified (including endian conversions).

Parameters
accessFlagsuse IConnectDebug::EAccessFlags, except fCore, fSFR, and fCacheXXX.
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location of the first access
valuevariable containing the value to write
Exceptions
IOExceptionin case of an error

Python example: test_read_write_value.py