winIDEA SDK
|
This class provides information about symbols and source code - sizes and addresses in the memory.
Python example for method getSymbolAtAddress(): test_get_symbol_at_address.py
#include <CAddressController.h>
Public Member Functions | |
CAddressController (std::shared_ptr< ConnectionMgr > connectionMgr) | |
Instantiates object. More... | |
iconnect::AddressVector | getAddressOfSourceLine (const std::string &fileName, int line, bool isReportSize=false) |
Returns vector of addresses used by the given line of source code. More... | |
std::string | getAnySymbolAtAddress (uint32_t symbolTypes, uint8_t memArea, ADDRESS_64 address, isys::IConnectDebug::ESymbolFlags scope) |
Returns the name of the symbol at the specified address, or empty string if there is no symbol at the given address. More... | |
int | getCodeArea (bool bPhysical) |
Returns memory area, where the code is located. More... | |
CMemAddress | getExpressionAddress (const std::string &expression) |
Returns address of an expression. More... | |
CMemAddress | getFunctionAddress (const std::string &functionName) |
Returns address of a function. More... | |
void | getFunctionNames (const iconnect::AddressVector &addresses, iconnect::StrVector &names, iconnect::IntVector &types) |
Returns names of functions at given addresses. More... | |
CMemAddress | getLabelAddress (const std::string &labelName) |
Returns address of a label. More... | |
CLineLocation | getSourceLineAtAddress (ADDRESS_64 address) |
Returns the location of source line which generates code at the given address. More... | |
CLineLocation | getSourceLineAtAddress (ADDRESS_64 address, bool isExact, bool isAbsolutePath) |
Returns the location of source line which generates code at the given address. More... | |
CLineLocation | getSourceLocation (isys::CLineDescriptionSPtr tpLocation) |
Return line location which matches the given criteria. More... | |
std::string | getSymbolAtAddress (isys::IConnectDebug::ESymbolFlags symbolType, uint8_t memArea, ADDRESS_64 address, isys::IConnectDebug::ESymbolFlags scope=isys::IConnectDebug::sScopeExact) |
Returns the name of the symbol at the specified address, or empty string if there is no symbol at the given address. More... | |
CSymbolInfo | getSymbolInfo (uint32_t flags, const std::string &expression) |
Returns information about the symbol. More... | |
CMemAddress | getVariableAddress (const std::string &variableName) |
Returns address of a variable. More... | |
Static Public Member Functions | |
static std::string | getTestPointIdPrefix () |
Returns const prefix used in search for test point location, when matching type is set to E_MATCH_TEST_POINT_ID. More... | |
isys::CAddressController::CAddressController | ( | std::shared_ptr< ConnectionMgr > | connectionMgr | ) |
Instantiates object.
connectionMgr | class which maintains connection to winIDEA. Connection must be established before this call. |
Python example: test_get_code_area.py
iconnect::AddressVector isys::CAddressController::getAddressOfSourceLine | ( | const std::string & | fileName, |
int | line, | ||
bool | isReportSize = false |
||
) |
Returns vector of addresses used by the given line of source code.
If the line generates no assembly code (empty lines, for example), an empty vector is returned. To get info about memory area, use method getCodeArea(), because executable code is always located in the code memory area.
If source line compiles to a continuous block of code its start address and size are reported. Only when source line generates several blocks of object code (for example 'for' loop), more than one address item is returned.
fileName | name of the file, where the source line is located |
line | line number |
isReportSize | if set, for every object location both address and size are returned |
Python example: test_get_address_of_source_line.py
std::string isys::CAddressController::getAnySymbolAtAddress | ( | uint32_t | symbolTypes, |
uint8_t | memArea, | ||
ADDRESS_64 | address, | ||
isys::IConnectDebug::ESymbolFlags | scope | ||
) |
Returns the name of the symbol at the specified address, or empty string if there is no symbol at the given address.
symbolTypes | Specifies symbol classes to consider, must be one of the following IConnectDebug::ESymbolFlags: sVariables , sLabels , sFunctions , sLine , sConstants or ORed value of these constants |
memArea | memory area of the object |
address | address of the object |
scope | defines how exact the symbol search should be. Should be one of sScope* flags from IConnectDebug::ESymbolFlags . |
int isys::CAddressController::getCodeArea | ( | bool | bPhysical | ) |
Returns memory area, where the code is located.
bPhysical | used only for PowerPC, see MemoryAreas.cpp, CCPUInfoHelp::GetCodeArea(): return bPhysical ? maPPhysicalPowerPC : maVirtualPowerPC; |
Python example: test_get_code_area.py
CMemAddress isys::CAddressController::getExpressionAddress | ( | const std::string & | expression | ) |
Returns address of an expression.
Expression can be any item with address, for example function, variable, struct member, ...
expression | any expression with address, for example 'myStruct.x' |
Python example: test_get_expression_address.py
CMemAddress isys::CAddressController::getFunctionAddress | ( | const std::string & | functionName | ) |
Returns address of a function.
If function is located in a default download file, then its name is enough. If function is located in other download file than the default one, a fully qualified name should be specified in the following format:
"<moduleName>"#<funcName>,,<downloadFileName>
where:
moduleName
- name of the C source file, which contains the functionfuncName
- name of the functiondownloadFileName
- name of the download file, where the function is locatedModule name is optional. It is only needed when there is more than one file static function with the same name.
Example:
"main.c"#init,,executable.elf
functionName | name of the function |
Python example: test_get_function_address.py
void isys::CAddressController::getFunctionNames | ( | const iconnect::AddressVector & | addresses, |
iconnect::StrVector & | names, | ||
iconnect::IntVector & | types | ||
) |
Returns names of functions at given addresses.
If function can not be found for an address, empty string or hex address is returned.
addresses | input list of function addresses. Address may be located anywhere inside function. |
names | output list of function names. On output it has the same number of elements as 'addresses'. |
types | output list of symbol type at address. Can be IConnectDebug.sFunctions, IConnectDebug.sLabels, or IConnectDebug.sConstants if no function or label is found at the given address. |
Python example: test_get_function_names.py
CMemAddress isys::CAddressController::getLabelAddress | ( | const std::string & | labelName | ) |
Returns address of a label.
labelName | name of the label |
Python example: test_get_label_address.py
CLineLocation isys::CAddressController::getSourceLineAtAddress | ( | ADDRESS_64 | address | ) |
Returns the location of source line which generates code at the given address.
It is equivalent of getSourceLineAtAddress(address, false, false)
.
address | memory address, where the code generated by the returned source line is located |
Python example: test_get_source_line_at_address.py
CLineLocation isys::CAddressController::getSourceLineAtAddress | ( | ADDRESS_64 | address, |
bool | isExact, | ||
bool | isAbsolutePath | ||
) |
Returns the location of source line which generates code at the given address.
address | memory address, where the code generated by the returned source line is located |
isExact | if true, address must be the the first address occupied by the source line. If it is not, empty file name and line number set to 0 are returned. |
isAbsolutePath | if true, file name is returned with absolute path |
CLineLocation isys::CAddressController::getSourceLocation | ( | isys::CLineDescriptionSPtr | tpLocation | ) |
Return line location which matches the given criteria.
Use this method when you want to set a breakpoint on a specific line in source code, but line number of this line changes as source code is modified. For example, if you always want the script to set a breakpoint at source line
numItems = 1234;
in function f()
, then use this method to get line number and the source file. This information can then be used to set a breakpoint.
tpLocation | object with source line search criteria |
Python example: test_get_source_location.py
std::string isys::CAddressController::getSymbolAtAddress | ( | isys::IConnectDebug::ESymbolFlags | symbolType, |
uint8_t | memArea, | ||
ADDRESS_64 | address, | ||
isys::IConnectDebug::ESymbolFlags | scope = isys::IConnectDebug::sScopeExact |
||
) |
Returns the name of the symbol at the specified address, or empty string if there is no symbol at the given address.
symbolType | Specifies symbol classes to consider, must be one of the following IConnectDebug::ESymbolFlags: sVariables , sLabels , sFunctions , sLine , or sConstants . |
memArea | memory area of the object |
address | address of the object |
scope | defines how exact the symbol search should be. Should be one of sScope* flags from IConnectDebug::ESymbolFlags . |
Python example: test_get_symbol_at_address.py
CSymbolInfo isys::CAddressController::getSymbolInfo | ( | uint32_t | flags, |
const std::string & | expression | ||
) |
Returns information about the symbol.
It includes:
If you need only address of the symbol, then methods getFunctionAddress(), getVariableAddress(), and getLabelAddress() are more convenient.
flags |
| ||||||||||||
expression | name of the symbol, for example variable or function name |
Python example: test_create_config_item.py
|
static |
Returns const prefix used in search for test point location, when matching type is set to E_MATCH_TEST_POINT_ID.
Python example: test_get_test_point_id_prefix.py
CMemAddress isys::CAddressController::getVariableAddress | ( | const std::string & | variableName | ) |
Returns address of a variable.
Use this method to get address of a simple variable. For complex items, for example struct members, use method getExpressionAddress().
variableName | name of the variable |
Python example: test_get_variable_addresses.py