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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-02-02 11:39:59 UTC
  • mfrom: (1.4.4 upstream)
  • mto: (1.5.1 sid)
  • mto: This revision was merged to the branch mainline in revision 47.
  • Revision ID: james.westby@ubuntu.com-20100202113959-n3u848nfj35yyd03
* New upstream release
* debian/control:
  + Standards version 3.8.4 (no changes needed)
* debian/patches/remove_support_for_non_debian_functionality.patch,
  debian/patches/remove_support_for_soft_debugger.patch,
  debian/patches/remove_support_for_moonlight.patch,
  debian/rules:
  + Split patch into two pieces, to make it easier to enable either
    SDB or Moonlight support with a rebuild
* debian/monodevelop-moonlight.install,
  debian/monodevelop-debugger-sdb.install,
  debian/control:
  + Create packaging data for the Soft Debugger addin and Moonlight addin -
    and comment them out of debian/control as we can't provide them on
    Debian for now

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
// THE SOFTWARE.
26
26
 
27
27
using System;
 
28
using System.Reflection;
28
29
using Mono.Debugging.Evaluation;
29
30
using Mono.Debugger;
30
31
using Mono.Debugging.Client;
44
45
                        this.obj = obj;
45
46
                        this.declaringType = declaringType;
46
47
                        flags = ObjectValueFlags.Field;
47
 
                        if (field.IsStatic)
 
48
                        if (field.IsStatic) {
48
49
                                flags |= ObjectValueFlags.Global;
 
50
                                this.obj = null;
 
51
                        }
49
52
                        if (field.IsPublic)
50
53
                                flags |= ObjectValueFlags.Public;
51
54
                        else if (field.IsPrivate)
56
59
                                flags |= ObjectValueFlags.Internal;
57
60
                        else if (field.IsFamilyOrAssembly)
58
61
                                flags |= ObjectValueFlags.InternalProtected;
 
62
                        if (obj is PrimitiveValue)
 
63
                                flags |= ObjectValueFlags.ReadOnly;
59
64
                }
60
65
                
61
66
                public override ObjectValueFlags Flags {
88
93
                                        return declaringType.GetValue (field);
89
94
                                else if (obj is ObjectMirror)
90
95
                                        return ((ObjectMirror)obj).GetValue (field);
91
 
                                else {
 
96
                                else if (obj is StructMirror) {
92
97
                                        StructMirror sm = (StructMirror)obj;
93
98
                                        int idx = 0;
94
99
                                        foreach (FieldInfoMirror f in sm.Type.GetFields ()) {
98
103
                                                idx++;
99
104
                                        }
100
105
                                        return sm.Fields [idx];
 
106
                                } else if (obj is StringMirror) {
 
107
                                        SoftEvaluationContext cx = (SoftEvaluationContext) Context;
 
108
                                        StringMirror val = (StringMirror) obj;
 
109
                                        FieldInfo rfield = typeof(string).GetField (field.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
 
110
                                        return cx.Session.VirtualMachine.CreateValue (rfield.GetValue (val.Value));
 
111
                                } else {
 
112
                                        SoftEvaluationContext cx = (SoftEvaluationContext) Context;
 
113
                                        PrimitiveValue val = (PrimitiveValue) obj;
 
114
                                        FieldInfo rfield = val.Value.GetType ().GetField (field.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
 
115
                                        return cx.Session.VirtualMachine.CreateValue (rfield.GetValue (val.Value));
101
116
                                }
102
117
                        }
103
118
                        set {