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 = TinyCLR_TypeSystem.SymbollessSupport.TinyCLRTokenFromMethodDefToken(mb); uint md = TinyCLR_TypeSystem.ClassMemberIndexFromTinyCLRToken(tk, m_assembly); WireProtocol.Commands.Debugging_Resolve_Method.Result resolvedMethod = m_engine.ResolveMethod(md); string name = null; uint tkClass = 0; if (resolvedMethod != null) { name = resolvedMethod.m_name; uint tkType = TinyCLR_TypeSystem.TinyCLRTokenFromTypeIndex(resolvedMethod.m_td); tkClass = TinyCLR_TypeSystem.SymbollessSupport.TypeDefTokenFromTinyCLRToken(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(Utility.COM_HResults.S_OK); }
public CorDebugFunction GetFunctionFromTokenTinyCLR(uint tk) { if (HasSymbols) { return(GetFunctionFromToken(tk, m_htTokenTinyCLRToPdbx)); } else { uint index = TinyCLR_TypeSystem.ClassMemberIndexFromTinyCLRToken(tk, this); WireProtocol.Commands.Debugging_Resolve_Method.Result resolvedMethod = this.Process.Engine.ResolveMethod(index); Debug.Assert(TinyCLR_TypeSystem.IdxAssemblyFromIndex(resolvedMethod.m_td) == this.Idx); uint tkMethod = TinyCLR_TypeSystem.SymbollessSupport.MethodDefTokenFromTinyCLRToken(tk); uint tkClass = TinyCLR_TypeSystem.TinyCLRTokenFromTypeIndex(resolvedMethod.m_td); CorDebugClass c = GetClassFromTokenTinyCLR(tkClass); return(new CorDebugFunction(c, tkMethod)); } }