本文整理汇总了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));
}
示例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();
}
示例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();
}
示例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;
}
}
//.........这里部分代码省略.........
示例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();
}
示例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();
}
示例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));
}
示例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));
}