Beispiel #1
0
        internal UTF8String CalculateDnlibName(CorModule module)
        {
            var  mdi   = this.GetMetaDataInterface <IMetaDataImport>();
            uint token = new MDToken(Table.Module, 1).Raw;

            return(DotNet.Utils.GetUTF8String(MDAPI.GetUtf8Name(mdi, token), MDAPI.GetModuleName(mdi) ?? string.Empty));
        }
 public CorExceptionObjectStackFrame(CorDebugExceptionObjectStackFrame other)
 {
     this.Module = other.pModule == null ? null : new CorModule(other.pModule);
     this.IP     = other.ip;
     this.Token  = other.methodDef;
     this.IsLastForeignExceptionFrame = other.isLastForeignExceptionFrame;
 }
Beispiel #3
0
 internal DnModule(DnAssembly ownerAssembly, ICorDebugModule module, int incrementedId, int moduleOrder)
 {
     this.ownerAssembly = ownerAssembly;
     this.module        = new CorModule(module);
     this.incrementedId = incrementedId;
     this.moduleOrder   = moduleOrder;
 }
Beispiel #4
0
		internal DnModule(DnAssembly ownerAssembly, ICorDebugModule module, int uniqueId, int uniqueIdProcess, int uniqueIdAppDomain) {
			Assembly = ownerAssembly;
			CorModule = new CorModule(module);
			UniqueId = uniqueId;
			UniqueIdProcess = uniqueIdProcess;
			UniqueIdAppDomain = uniqueIdAppDomain;
			DnModuleId = CorModule.GetModuleId((uint)UniqueId);
		}
Beispiel #5
0
 internal DnModule(DnAssembly ownerAssembly, ICorDebugModule module, int uniqueId, int uniqueIdProcess, int uniqueIdAppDomain)
 {
     this.ownerAssembly      = ownerAssembly;
     this.module             = new CorModule(module);
     this.uniqueId           = uniqueId;
     this.uniqueIdProcess    = uniqueIdProcess;
     this.uniqueIdAppDomain  = uniqueIdAppDomain;
     this.serializedDnModule = this.module.SerializedDnModule;
 }
 bool IsOurModule(CorModule module, out string filename)
 {
     if (IsModule(module, filename1))
     {
         filename = filename1;
         return(true);
     }
     if (IsModule(module, filename2))
     {
         filename = filename2;
         return(true);
     }
     filename = null;
     return(false);
 }
Beispiel #7
0
        static string CalculateFullName(CorModule manifestModule)
        {
            var  mdai  = manifestModule.GetMetaDataInterface <IMetaDataAssemblyImport>();
            uint token = new MDToken(Table.Assembly, 1).Raw;

            var asm = new AssemblyNameInfo();

            asm.Name             = MDAPI.GetAssemblySimpleName(mdai, token) ?? string.Empty;
            asm.Version          = MDAPI.GetAssemblyVersionAndLocale(mdai, token, out var locale) ?? new Version(0, 0, 0, 0);
            asm.Culture          = locale ?? string.Empty;
            asm.HashAlgId        = MDAPI.GetAssemblyHashAlgorithm(mdai, token) ?? AssemblyHashAlgorithm.SHA1;
            asm.Attributes       = MDAPI.GetAssemblyAttributes(mdai, token) ?? AssemblyAttributes.None;
            asm.PublicKeyOrToken = MDAPI.GetAssemblyPublicKey(mdai, token) ?? new PublicKey((byte[]?)null);
            return(asm.FullName);
        }
Beispiel #8
0
        internal IDebuggerModule FindModuleUI(DBG.CorModule corModule)
        {
            dispatcher.VerifyAccess();
            var dbg = theDebugger.Debugger;

            if (dbg == null)
            {
                return(null);
            }
            foreach (var m in dbg.Modules)
            {
                if (m.CorModule == corModule)
                {
                    return(new DebuggerModule(this, m));
                }
            }
            return(null);
        }
Beispiel #9
0
 static bool IsModule(CorModule module, string filename) => module != null && !module.IsDynamic && !module.IsInMemory && StringComparer.OrdinalIgnoreCase.Equals(module.Name, filename);
Beispiel #10
0
 bool IsOurModule(CorModule module) => IsModule(module, filename);
Beispiel #11
0
 public bool Equals(CorModule other) => !ReferenceEquals(other, null) && RawObject == other.RawObject;
Beispiel #12
0
 public bool Equals(CorModule other)
 {
     return(!ReferenceEquals(other, null) &&
            RawObject == other.RawObject);
 }
Beispiel #13
0
 public CorFunction(ICorDebugFunction func, CorModule module = null)
     : base(func)
 {
     //TODO: ICorDebugFunction2::EnumerateNativeCode
     //TODO: ICorDebugFunction3::GetActiveReJitRequestILCode
 }
Beispiel #14
0
 bool IsOurModule(CorModule module)
 {
     return(IsModule(module, filename));
 }
Beispiel #15
0
 public CorFunction(ICorDebugFunction func, CorModule module = null)
     : base(func)
 {
 }
Beispiel #16
0
 static bool IsModule(CorModule module, string filename)
 {
     return(module != null && module.SerializedDnModule == new SerializedDnModule(filename));
 }
Beispiel #17
0
 bool IsFile(CorModule module) => !module.IsDynamic && !module.IsInMemory;