winIDEA SDK
test_get_stack_frames.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_getStackFrames():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 dataCtrl = ic.CDataController(connMgr)
16
17 print("Getting stack frames (`isActiveFrameOnly`=False, `isAbsPaths`=True)")
18 sfVector = ic.StackFrameVector()
19 dataCtrl.getStackFrames(False, True, sfVector)
20 for index, stackFrame in enumerate(sfVector):
21 stackFrame: ic.CStackFrame
22 print(f"\nStack entry: {index}")
23
24 print(f"\tAddress: {hex(stackFrame.getAddress()) }")
25 print(f"\tMemory area: {stackFrame.getMemArea()}")
26 print(f"\tFile name: {stackFrame.getFileName()}")
27 print(f"\tLine number: {stackFrame.getLineNumber()}")
28 print(f"\tFunction name: {stackFrame.getFunction().getName()}")
29 print(f"\tPartition number: {stackFrame.getPartition()}")
30
31
32if __name__ == "__main__":
33 test_getStackFrames()