Пример #1
0
        public static DbgValueNode[] ToValueNodeArray(DbgLanguage language, DbgRuntime runtime, DbgEngineValueNode[] engineNodes)
        {
            var nodes = new DbgValueNode[engineNodes.Length];

            for (int i = 0; i < nodes.Length; i++)
            {
                nodes[i] = new DbgValueNodeImpl(language, runtime, engineNodes[i]);
            }
            runtime.CloseOnContinue(nodes);
            return(nodes);
        }
Пример #2
0
        public static DbgLocalsValueNodeInfo[] ToLocalsValueNodeInfoArray(DbgLanguage language, DbgRuntime runtime, DbgEngineLocalsValueNodeInfo[] engineNodeInfos)
        {
            var infos = new DbgLocalsValueNodeInfo[engineNodeInfos.Length];
            var nodes = new DbgValueNode[engineNodeInfos.Length];

            for (int i = 0; i < nodes.Length; i++)
            {
                var node = new DbgValueNodeImpl(language, runtime, engineNodeInfos[i].ValueNode);
                nodes[i] = node;
                infos[i] = new DbgLocalsValueNodeInfo(engineNodeInfos[i].Kind, node);
            }
            runtime.CloseOnContinue(nodes);
            return(infos);
        }
Пример #3
0
        DbgCreateValueNodeResult[] CreateResult(DbgRuntime runtime, DbgEngineValueNode[] results)
        {
            if (results.Length == 0)
            {
                return(Array.Empty <DbgCreateValueNodeResult>());
            }
            var res = new DbgCreateValueNodeResult[results.Length];

            try {
                for (int i = 0; i < res.Length; i++)
                {
                    var result    = results[i];
                    var valueNode = new DbgValueNodeImpl(Language, runtime, result);
                    runtime.CloseOnContinue(valueNode);
                    res[i] = new DbgCreateValueNodeResult(valueNode, result.CausesSideEffects);
                }
            }
            catch {
                runtime.Process.DbgManager.Close(res.Select(a => a.ValueNode).Where(a => !(a is null)));
                throw;
            }
            return(res);
        }