winIDEA SDK
test_get_source_line_at_address.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_getSourceLineAtAddress():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 # for STM32 use
16 ADDRESS = 0x08001F84 # main()
17 # for TC399xe use
18 # ADDRESS = 0xA0080ED8
19
20 addCtrl = ic.CAddressController(connMgr)
21 srcPosData = addCtrl.getSourceLineAtAddress(ADDRESS)
22 print(f"Assignment location: '{srcPosData.getFileName()}::{srcPosData.getLineNumber()}'.")
23 print(f"Source file and line number can also be printed with `.toString()` function:")
24 print(srcPosData.toString())
25
26
27if __name__ == "__main__":
28 test_getSourceLineAtAddress()