import isystem.connect as ic
winidea_id = ''
def test_configureStackUsage():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
addrCtrl = ic.CAddressController(connMgr)
cfgCtrl = ic.CConfigurationController(connMgr)
dataCtrl = ic.CDataController(connMgr)
STACK_START_ADDR = addrCtrl.getVariableAddress("_sdata").getAddress()
STACK_END_ADDR = addrCtrl.getVariableAddress("_edata").getAddress()
VALUE = 0x55
stack_cfg = cfgCtrl.ide_app().opt('StackUsage')
stack_cfg.set_bool('Use', True)
stack_cfg.set_uint('Pattern', VALUE)
stack_cfg.set('Position', 'End')
stack_cfg.set('Start', str(hex(STACK_START_ADDR)))
stack_cfg.set('End', str(hex(STACK_END_ADDR)))
print(f'Disable by setting option `Use` to `False`')
stack_cfg.set_bool('Use', False)
if __name__ == "__main__":
test_configureStackUsage()