public ObjectValue[] GetChildren(ObjectPath path, int index, int count, EvaluationOptions options)
        {
            List<ObjectValue> children = new List<ObjectValue> ();
            session.SelectThread (threadId);
            NodeCommandResult res = session.RunCommand ("-var-list-children", "2", path.Join ("."));
            ResultData cdata = res.GetObject ("children");

            // The response may not contain the "children" list at all.
            if (cdata == null)
                return children.ToArray ();

            if (index == -1) {
                index = 0;
                count = cdata.Count;
            }

            for (int n=index; n<cdata.Count && n<index+count; n++) {
                ResultData data = cdata.GetObject (n);
                ResultData child = data.GetObject ("child");

                string name = child.GetValue ("exp");
                if (name.Length > 0 && char.IsNumber (name [0]))
                    name = "[" + name + "]";

                // C++ structures may contain typeless children named
                // "public", "private" and "protected".
                if (child.GetValue("type") == null) {
                    ObjectPath childPath = new ObjectPath (child.GetValue ("name").Split ('.'));
                    ObjectValue[] subchildren = GetChildren (childPath, -1, -1, options);
                    children.AddRange(subchildren);
                } else {
                    ObjectValue val = CreateObjectValue (name, child);
                    children.Add (val);
                }
            }
            return children.ToArray ();
        }
        public ObjectValue[] GetChildren(ObjectPath path, int index, int count, EvaluationOptions options)
        {
            List<ObjectValue> children = new List<ObjectValue>();
            session.SelectThread(threadId);

            string expression = path.Join(".");

            if (expression.Trim().Length == 0)
                return children.ToArray();

            List<DebugScopedSymbol> childSymbols = this.session.SymbolResolver.GetChildSymbols(expression);
            if (childSymbols.Count == 0)
                return children.ToArray();

            for (int i = 0; i < childSymbols.Count; i++)
            {
                DebugScopedSymbol child = childSymbols[i];

                ObjectValue ov = CreateObjectValue(child);
                children.Add(ov);
            }

            return children.ToArray();
        }
Exemple #3
0
		public EvaluationResult SetValue (ObjectPath path, string value, EvaluationOptions options)
		{
			session.SelectThread (threadId);
			session.RunCommand ("-var-assign", path.Join ("."), value);
			return new EvaluationResult (value);
		}
		public bool HasChildren (ObjectPath path, EvaluationOptions options)
		{
			session.SelectThread (threadId);
			GdbCommandResult res = session.RunCommand ("-var-info-num-children", path.Join ("."));

			return res.GetInt ("numchild") > 0;
		}