internal void SetBreakPoint(CorModule module, string className, string methodName, INotification _lisenter) { BreakPointInfo breakpoint = new BreakPointInfo(module.Name, className, methodName, null, _lisenter); if (!breakStringVsBP.ContainsKey(breakpoint.Identifier)){ int token = 0; CorFunction fun = null; try{ module.Importer.FindTypeDefByName(className, 0, out token); } catch (Exception){ throw new BreakPointException(className + " class is not found in" + module.Name); } MetaType type = new MetaType(module.Importer, token); try{ List<BreakPointInfo> bps = new List<BreakPointInfo>(); foreach (MetadataMethodInfo methodInfo in type.GetMethods(methodName)){ BreakPointInfo bp = new BreakPointInfo(module.Name, className, methodName, null, _lisenter); fun = module.GetCorFuntion((uint)methodInfo.MetadataToken); bp.bpoint = fun.CreateBreakPoint(); bp.bpoint.Activate(); bps.Add(bp); } if(bps.Count > 0){ breakStringVsBP.Add(bps[0].Identifier, bps); } } catch (Exception) { throw new BreakPointException(methodName + " Method is not found in" + className); } } }
public static CorFunction GetFuntion(CorModule module, string className, string funtionName) { CorFunction fun = null; int token = 0; try { module.Importer.FindTypeDefByName(className, 0, out token); } catch (Exception) { throw new BreakPointException(className + " class is not found in" + module.Name); } MetaType type = new MetaType(module.Importer, token); try { MetadataMethodInfo method = type.GetMethod(funtionName); fun = module.GetCorFuntion((uint)method.MetadataToken); } catch (Exception) { throw new BreakPointException(funtionName + " Method is not found in" + className); } return fun; //method.MetadataToken }
public CorFunction(ICorDebugFunction funtion) { corFunction = funtion; ICorDebugModule imodule = null; corFunction.GetModule(out imodule); module = new CorModule(imodule); corFunction.GetToken(out token); //corFunction.GetLocalVarSigToken( //ICorDebugFunctionBreakpoint breakPoint = null; //corFunction. }
public MetaModule(ICorDebugModule module) { m_module = new CorModule(module); Guid interfaceGuid = typeof(IMetadataImport).GUID; module.GetMetaDataInterface(ref interfaceGuid, out m_importer); }