winIDEA SDK
test_get_source_line_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_getSourceLineAtAddress():
11 connMgr = ic.ConnectionMgr()
12 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
13
14 # for STM32 use
15 ADDRESS = 0x08001F84 # main()
16 # for TC399xe use
17 # ADDRESS = 0xA0080ED8
18
19 addCtrl = ic.CAddressController(connMgr)
20 srcPosData = addCtrl.getSourceLineAtAddress(ADDRESS)
21 print(f"Assignment location: '{srcPosData.getFileName()}::{srcPosData.getLineNumber()}'.")
22 print(f"Source file and line number can also be printed with `.toString()` function:")
23 print(srcPosData.toString())
24
25
26if __name__ == "__main__":
27 test_getSourceLineAtAddress()