当前位置: 首页>>代码示例>>C#>>正文


C# ICorDebugModule.GetName方法代码示例

本文整理汇总了C#中ICorDebugModule.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# ICorDebugModule.GetName方法的具体用法?C# ICorDebugModule.GetName怎么用?C# ICorDebugModule.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICorDebugModule的用法示例。


在下文中一共展示了ICorDebugModule.GetName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CorModule

 public CorModule(ICorDebugModule md)
 {
     corModule = md;
     char[] name = new char[300];
     uint sz = 0;
     corModule.GetName((uint)name.Length, out sz, name);
     fullName = new String(name, 0, (int)(sz - 1));
 }
开发者ID:balaramaraju,项目名称:DotNetProcessViewer,代码行数:8,代码来源:CorModule.cs

示例2: Module

        internal Module(AppDomain appDomain, ICorDebugModule corModule)
        {
            this.appDomain = appDomain;
            this.process = appDomain.Process;
            this.corModule = corModule;

            metaData = new MetaDataImport(corModule);

            if (IsDynamic || IsInMemory) {
                name     = corModule.GetName();
            } else {
                fullPath = corModule.GetName();
                name     = System.IO.Path.GetFileName(FullPath);
            }
            asmFilename = corModule.GetAssembly().GetName();

            SetJITCompilerFlags();

            LoadSymbolsFromDisk(process.Options.SymbolsSearchPaths);
            ResetJustMyCodeStatus();
        }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:21,代码来源:Module.cs

示例3: LoadModule

		public void LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule)
		{
			EnterCallback("LoadModule " + pModule.GetName(), pAppDomain);
			
			Module module = new Module(process.GetAppDomain(pAppDomain), pModule);
			process.modules.Add(module);
			process.OnModuleLoaded(module);
			
			ExitCallback();
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:10,代码来源:ManagedCallback.cs

示例4: LoadModule

            public void LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule)
            {
                try
                {
                    _EnterCallback();
                    
                    string assemblyname;
                    bool thismodule = false;
                    lock (dbgproc)
                    {
                        dbgproc.imodules.Add(pModule);

                        ICorDebugModule2 imod2 = pModule as ICorDebugModule2;
                        if (null != imod2)
                        {
                            imod2.SetJITCompilerFlags(0x3); // CORDEBUG_JIT_DISABLE_OPTIMIZATION
                        }

                        //lock (dbgproc)
                        {
                            IntPtr pasmnamebuf = Marshal.AllocHGlobal(PATH_BUFFER_LENGTH * 2);
                            uint asmnamelen = (uint)PATH_BUFFER_LENGTH;
                            pModule.GetName(asmnamelen, out asmnamelen, pasmnamebuf);
                            if (asmnamelen > PATH_BUFFER_LENGTH)
                            {
                                throw new Exception("Assembly path too long");
                            }
                            asmnamelen--; // Remove nul.
                            assemblyname = Marshal.PtrToStringUni(pasmnamebuf, (int)asmnamelen);
                            Marshal.FreeHGlobal(pasmnamebuf);
                        }

                        if (assemblyname.EndsWith(".exe", true, null))
                        {
                            thismodule = true;
                            //lock (dbgproc) // ...
                            {
                                Guid CLSID_CorSymBinder = new Guid("0A29FF9E-7F9C-4437-8B11-F424491E3931");
                                ISymUnmanagedBinder binder = (ISymUnmanagedBinder)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID_CorSymBinder));

                                ICorDebugModule imod = pModule;
                                //ICorDebugAssembly iasm;
                                //imod.GetAssembly(out iasm);

                                Guid CLSID_IMetaDataDispenser = new Guid(0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x00, 0x80, 0xc7, 0x92, 0xe5, 0xd8);
                                IMetaDataDispenser disp = (IMetaDataDispenser)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID_IMetaDataDispenser));

                                Guid CLSID_IMetaDataImport = new Guid(0x7dac8207, 0xd3ae, 0x4c75, 0x9b, 0x67, 0x92, 0x80, 0x1a, 0x49, 0x7d, 0x44);
                                object oimporter;
                                disp.OpenScope(assemblyname, 0 /* OPEN_READ */, ref CLSID_IMetaDataImport, out oimporter);

                                IntPtr pimporter = IntPtr.Zero;
                                try
                                {
                                    pimporter = Marshal.GetComInterfaceForObject(oimporter, typeof(IMMImport));

                                    ISymUnmanagedReader reader;
                                    int hrreader = binder.GetReaderForFile(pimporter, assemblyname, null, out reader);
                                    if (0 == hrreader)
                                    {
                                        {
                                            System.Diagnostics.SymbolStore.SymbolToken symtok;
                                            int hruep = reader.GetUserEntryPoint(out symtok);
                                            if (0 == hruep)
                                            {
                                                //dbgproc.dout.WriteLine("Got entry point for " + assemblyname);

                                                ICorDebugFunction idbgFunc;
                                                imod.GetFunctionFromToken((uint)symtok.GetToken(), out idbgFunc);

                                                ICorDebugClass pclass;
                                                idbgFunc.GetClass(out pclass);

                                                ICorDebugFunctionBreakpoint pBkpt;
                                                idbgFunc.CreateBreakpoint(out pBkpt);
                                                pBkpt.Activate(1);

                                                dbgproc.EntryPointBreakpointSet = true;
                                                dbgproc.ProcessStarted = true;
                                            }

                                        }

                                    }
                                    else
                                    {
                                        dbgproc.EntryPointBreakpointSet = false;
                                        dbgproc.dout.WriteLine("Unable to find entry point (no debug information reader) for " + assemblyname);
                                    }

                                }
                                finally
                                {
                                    if (IntPtr.Zero != pimporter)
                                    {
                                        Marshal.Release(pimporter);
                                        pimporter = IntPtr.Zero;
                                    }
                                }

//.........这里部分代码省略.........
开发者ID:erisonliang,项目名称:qizmt,代码行数:101,代码来源:Program.cs

示例5: Module

		internal Module(AppDomain appDomain, ICorDebugModule corModule)
		{
			this.appDomain = appDomain;
			this.process = appDomain.Process;
			this.corModule = corModule;
			
			unresolvedAssembly = TypeSystemExtensions.LoadModuleAsync(this, corModule);
			metaData = new MetaDataImport(corModule);
			
			if (IsDynamic || IsInMemory) {
				name     = corModule.GetName();
			} else {
				fullPath = corModule.GetName();
				name     = System.IO.Path.GetFileName(FullPath);
			}
			
			SetJITCompilerFlags();
			
			LoadSymbolsFromDisk(process.Options.SymbolsSearchPaths);
			ResetJustMyCode();
			LoadSymbolsDynamic();
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:22,代码来源:Module.cs

示例6: LoadModule

		public void LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule)
		{
			EnterCallback(PausedReason.Other, "LoadModule " + pModule.GetName(), pAppDomain);
			
			Module module = new Module(process.AppDomains[pAppDomain], pModule);
			process.Modules.Add(module);
			
			ExitCallback();
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:9,代码来源:ManagedCallback.cs

示例7: LoadModuleAsync

		internal static Task<IUnresolvedAssembly> LoadModuleAsync(Module module, ICorDebugModule corModule)
		{
			string name = corModule.GetName();
			if (corModule.IsDynamic() == 1 || corModule.IsInMemory() == 1) {
				var defaultUnresolvedAssembly = new DefaultUnresolvedAssembly(name);
				var defaultUnresolvedTypeDefinition = new DefaultUnresolvedTypeDefinition("UnknownDynamicType");
				var defaultUnresolvedMethod = new DefaultUnresolvedMethod(defaultUnresolvedTypeDefinition, "UnknownMethod");
				var defaultUnresolvedField = new DefaultUnresolvedField(defaultUnresolvedTypeDefinition, "UnknownField");
				defaultUnresolvedTypeDefinition.Members.Add(defaultUnresolvedMethod);
				defaultUnresolvedTypeDefinition.Members.Add(defaultUnresolvedField);
				defaultUnresolvedAssembly.AddTypeDefinition(defaultUnresolvedTypeDefinition);
				weakTable.Add(defaultUnresolvedAssembly, new ModuleMetadataInfo(module, null));
				return Task.FromResult<IUnresolvedAssembly>(defaultUnresolvedAssembly);
			}
			
			//return Task.FromResult(LoadModule(module, name));
			return Task.Run(() => LoadModule(module, name));
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:18,代码来源:TypeSystemExtensions.cs

示例8: LoadModuleAsync

		internal static Task<IUnresolvedAssembly> LoadModuleAsync(Module module, ICorDebugModule corModule)
		{
			string name = corModule.GetName();
			if (corModule.IsDynamic() == 1 || corModule.IsInMemory() == 1) {
				var defaultUnresolvedAssembly = new DefaultUnresolvedAssembly(name);
				weakTable.Add(defaultUnresolvedAssembly, new ModuleMetadataInfo(module, null));
				return Task.FromResult<IUnresolvedAssembly>(defaultUnresolvedAssembly);
			}
			
			//return Task.FromResult(LoadModule(module, name));
			return Task.Run(() => LoadModule(module, name));
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:12,代码来源:TypeSystemExtensions.cs


注:本文中的ICorDebugModule.GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。