winIDEA SDK
test_get_symbol_at_address.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2# (c) TASKING Germany GmbH, 2023
3
4import isystem.connect as ic
5
6
7winidea_id = ''
8
9
10def test_getSymbolAtAddress():
11 connMgr = ic.ConnectionMgr()
12 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
13
14 # for STM32 use
15 ADDRESS = 0x200019AC
16 # for TC399xe use
17 # ADDRESS = 0xD0001020
18
19 addrCtrl = ic.CAddressController(connMgr)
20 # 0 = main memory area (the only application)
21 varName = addrCtrl.getSymbolAtAddress(ic.IConnectDebug.sVariables, 0, ADDRESS)
22 print(f"At address '{hex(ADDRESS)}' is variable '{varName}'.")
23
24 execCtrl = ic.CExecutionController(connMgr)
25 status = execCtrl.getCPUStatus()
26 symbol = addrCtrl.getSymbolAtAddress(ic.IConnectDebug.sFunctions,
27 status.getExecutionArea(),
28 status.getExecutionPoint(),
29 ic.IConnectDebug.sScopeWide)
30 print(f'Function at execution point: {symbol}')
31
32
33if __name__ == "__main__":
34 test_getSymbolAtAddress()