~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/FieldValueReference.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
                object obj;
39
39
                TypeMirror declaringType;
40
40
                ObjectValueFlags flags;
41
 
                
42
 
                public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType): base (ctx)
 
41
                string vname;
 
42
                
 
43
                public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType)
 
44
                        : this (ctx, field, obj, declaringType, null, ObjectValueFlags.Field)
 
45
                {
 
46
                }
 
47
                
 
48
                public FieldValueReference (EvaluationContext ctx, FieldInfoMirror field, object obj, TypeMirror declaringType, string vname, ObjectValueFlags vflags): base (ctx)
43
49
                {
44
50
                        this.field = field;
45
51
                        this.obj = obj;
46
52
                        this.declaringType = declaringType;
47
 
                        flags = ObjectValueFlags.Field;
 
53
                        this.vname = vname;
 
54
                        flags = vflags;
48
55
                        if (field.IsStatic) {
49
56
                                flags |= ObjectValueFlags.Global;
50
57
                                this.obj = null;
71
78
 
72
79
                public override string Name {
73
80
                        get {
74
 
                                return field.Name;
 
81
                                return vname ?? field.Name;
75
82
                        }
76
83
                }
77
84
 
111
118
                                } else {
112
119
                                        SoftEvaluationContext cx = (SoftEvaluationContext) Context;
113
120
                                        PrimitiveValue val = (PrimitiveValue) obj;
 
121
                                        if (val.Value == null)
 
122
                                                return null;
114
123
                                        FieldInfo rfield = val.Value.GetType ().GetField (field.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
115
124
                                        return cx.Session.VirtualMachine.CreateValue (rfield.GetValue (val.Value));
116
125
                                }