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

« back to all changes in this revision

Viewing changes to contrib/Mono.Debugger.Soft/Mono.Debugger.Soft/ModuleMirror.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:
 
1
using System;
 
2
using Mono.Debugger;
 
3
using Mono.Cecil;
 
4
 
 
5
namespace Mono.Debugger.Soft
 
6
{
 
7
        public class ModuleMirror : Mirror
 
8
        {
 
9
                ModuleInfo info;
 
10
                Guid guid;
 
11
                AssemblyMirror assembly;
 
12
 
 
13
                internal ModuleMirror (VirtualMachine vm, long id) : base (vm, id) {
 
14
                }
 
15
 
 
16
                void ReadInfo () {
 
17
                        if (info == null)
 
18
                                info = vm.conn.Module_GetInfo (id);
 
19
                }
 
20
 
 
21
                public string Name {
 
22
                        get {
 
23
                                ReadInfo ();
 
24
                                return info.Name;
 
25
                        }
 
26
                }
 
27
 
 
28
                public string ScopeName {
 
29
                        get {
 
30
                                ReadInfo ();
 
31
                                return info.ScopeName;
 
32
                        }
 
33
                }
 
34
 
 
35
                public string FullyQualifiedName {
 
36
                        get {
 
37
                                ReadInfo ();
 
38
                                return info.FQName;
 
39
                        }
 
40
                }
 
41
 
 
42
                public Guid ModuleVersionId {
 
43
                        get {
 
44
                                if (guid == Guid.Empty) {
 
45
                                        ReadInfo ();
 
46
                                        guid = new Guid (info.Guid);
 
47
                                }
 
48
                                return guid;
 
49
                        }
 
50
                }
 
51
 
 
52
                public AssemblyMirror Assembly {
 
53
                        get {
 
54
                                if (assembly == null) {
 
55
                                        ReadInfo ();
 
56
                                        if (info.Assembly == 0)
 
57
                                                return null;
 
58
                                        assembly = vm.GetAssembly (info.Assembly);
 
59
                                }
 
60
                                return assembly;
 
61
                        }
 
62
                }
 
63
 
 
64
                // FIXME: Add function to query the guid, check in Metadata
 
65
    }
 
66
}