GetValue() публичный Метод

public GetValue ( int index ) : string
index int
Результат string
Пример #1
0
        ObjectValue CreateObjectValue(string name, ResultData data)
        {
            string vname = data.GetValue ("name");
            string typeName = data.GetValue ("type");
            string value = data.GetValue ("value");
            int nchild = data.GetInt ("numchild");

            ObjectValue val;
            ObjectValueFlags flags = ObjectValueFlags.Variable;

            // There can be 'public' et al children for C++ structures
            if (typeName == null)
                typeName = "none";

            if (typeName.EndsWith ("]")) {
                val = ObjectValue.CreateArray (this, new ObjectPath (vname), typeName, nchild, flags, null);
            } else if (value == "{...}" || typeName.EndsWith ("*") || nchild > 0) {
                val = ObjectValue.CreateObject (this, new ObjectPath (vname), typeName, value, flags, null);
            } else {
                val = ObjectValue.CreatePrimitive (this, new ObjectPath (vname), typeName, new EvaluationResult (value), flags);
            }
            val.Name = name;
            return val;
        }
Пример #2
0
        StackFrame CreateFrame(ResultData frameData)
        {
            string lang = "Native";
            string func = frameData.GetValue ("func");
            string sadr = frameData.GetValue ("addr");

            /*
            if (func == "??" && session.IsMonoProcess) {
                // Try to get the managed func name
                try {
                    ResultData data = session.RunCommand ("-data-evaluate-expression", "mono_pmip(" + sadr + ")");
                    string val = data.GetValue ("value");
                    if (val != null) {
                        int i = val.IndexOf ('"');
                        if (i != -1) {
                            func = val.Substring (i).Trim ('"',' ');
                            lang = "Mono";
                        }
                    }
                } catch {
                }
            }
            */

            int line = -1;
            string sline = frameData.GetValue ("line");
            if (sline != null)
                line = int.Parse (sline);

            string sfile = frameData.GetValue ("fullname");
            if (sfile == null)
                sfile = frameData.GetValue ("file");
            if (sfile == null)
                sfile = frameData.GetValue ("from");
            SourceLocation loc = new SourceLocation (func ?? "?", sfile, line);

            long addr;
            if (!string.IsNullOrEmpty (sadr))
                addr = long.Parse (sadr.Substring (2), NumberStyles.HexNumber);
            else
                addr = 0;

            return new StackFrame (addr, loc, lang);
        }