public int GetMethodProps(uint mb, IntPtr pClass, IntPtr szMethod, uint cchMethod, IntPtr pchMethod, IntPtr pdwAttr, IntPtr ppvSigBlob, IntPtr pcbSigBlob, IntPtr pulCodeRVA, IntPtr pdwImplFlags) { uint tk = nanoCLR_TypeSystem.SymbollessSupport.nanoCLRTokenFromMethodDefToken(mb); uint md = nanoCLR_TypeSystem.ClassMemberIndexFromnanoCLRToken(tk, m_assembly); var resolveMethod = m_engine.ResolveMethodAsync(md); resolveMethod.Wait(); Debugger.WireProtocol.Commands.Debugging_Resolve_Method.Result resolvedMethod = resolveMethod.Result; string name = null; uint tkClass = 0; if (resolvedMethod != null) { name = resolvedMethod.m_name; uint tkType = nanoCLR_TypeSystem.nanoCLRTokenFromTypeIndex(resolvedMethod.m_td); tkClass = nanoCLR_TypeSystem.SymbollessSupport.TypeDefTokenFromnanoCLRToken(tkType); } Utility.MarshalString(name, cchMethod, pchMethod, szMethod); Utility.MarshalInt(pClass, (int)tkClass); Utility.MarshalInt(pdwAttr, (int)CorMethodAttr.mdStatic); Utility.MarshalInt(pulCodeRVA, 0); Utility.MarshalInt(pdwImplFlags, 0); Utility.MarshalInt(pcbSigBlob, m_cbFakeSig); Utility.MarshalInt(ppvSigBlob, m_fakeSig.ToInt32()); return(COM_HResults.S_OK); }
public CorDebugFunction GetFunctionFromTokennanoCLR(uint tk) { if (HasSymbols) { return(GetFunctionFromToken(tk, _htTokennanoCLRToPdbx)); } else { uint index = nanoCLR_TypeSystem.ClassMemberIndexFromnanoCLRToken(tk, this); Debugger.WireProtocol.Commands.Debugging_Resolve_Method.Result resolvedMethod = this.Process.Engine.ResolveMethod(index); Debug.Assert(nanoCLR_TypeSystem.IdxAssemblyFromIndex(resolvedMethod.m_td) == this.Idx); uint tkMethod = nanoCLR_TypeSystem.SymbollessSupport.MethodDefTokenFromnanoCLRToken(tk); uint tkClass = nanoCLR_TypeSystem.nanoCLRTokenFromTypeIndex(resolvedMethod.m_td); CorDebugClass c = GetClassFromTokennanoCLR(tkClass); return(new CorDebugFunction(c, tkMethod)); } }