winIDEA SDK
Loading...
Searching...
No Matches
test_get_stack_frames.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
#
# (c) TASKING Germany GmbH, 2023
import isystem.connect as ic
winidea_id = ''
def test_getStackFrames():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
dataCtrl = ic.CDataController(connMgr)
print("Getting stack frames (`isActiveFrameOnly`=False, `isAbsPaths`=True)")
sfVector = ic.StackFrameVector()
dataCtrl.getStackFrames(False, True, sfVector)
for index, stackFrame in enumerate(sfVector):
stackFrame: ic.CStackFrame
print(f"\nStack entry: {index}")
print(f"\tAddress: {hex(stackFrame.getAddress()) }")
print(f"\tMemory area: {stackFrame.getMemArea()}")
print(f"\tFile name: {stackFrame.getFileName()}")
print(f"\tLine number: {stackFrame.getLineNumber()}")
print(f"\tFunction name: {stackFrame.getFunction().getName()}")
print(f"\tPartition number: {stackFrame.getPartition()}")
if __name__ == "__main__":
test_getStackFrames()