diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-12-15 20:23:11 -0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-12-16 14:00:35 -0800 |
commit | 5ab6e962cc76672452b0d49e9242038f54c5c2d7 (patch) | |
tree | 5f1f5eaaa76d77ba1c19c62d1a53aed3472fa29f /src/utilcode | |
parent | 36de3bebb8930bdad554143f9563b83a3356d7b7 (diff) | |
download | coreclr-5ab6e962cc76672452b0d49e9242038f54c5c2d7.tar.gz coreclr-5ab6e962cc76672452b0d49e9242038f54c5c2d7.tar.bz2 coreclr-5ab6e962cc76672452b0d49e9242038f54c5c2d7.zip |
Make JitDump work in ilc.exe
The JIT is not expected to make assumption about format of raw signatures to parse them.
Instead, it should depend on JIT-EE interface for parsing. This invariant was violates in
couple of places related to debug COMPlus_ method filters that caused them to crash under CoreRT.
Fixed the filters to use the proper abstraction instead.
Diffstat (limited to 'src/utilcode')
-rw-r--r-- | src/utilcode/util.cpp | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/src/utilcode/util.cpp b/src/utilcode/util.cpp index d7d3a9f4cb..4642a4ce6a 100644 --- a/src/utilcode/util.cpp +++ b/src/utilcode/util.cpp @@ -18,6 +18,7 @@ #include "loaderheap.h" #include "sigparser.h" #include "cor.h" +#include "corinfo.h" #ifndef FEATURE_CORECLR #include "metahost.h" @@ -1302,7 +1303,7 @@ bool ConfigMethodSet::contains(LPCUTF8 methodName, LPCUTF8 className, PCCOR_SIGN NOTHROW; } CONTRACTL_END; - + _ASSERTE(m_inited == 1); if (m_list.IsEmpty()) @@ -1311,6 +1312,22 @@ bool ConfigMethodSet::contains(LPCUTF8 methodName, LPCUTF8 className, PCCOR_SIGN } /**************************************************************************/ +bool ConfigMethodSet::contains(LPCUTF8 methodName, LPCUTF8 className, CORINFO_SIG_INFO* pSigInfo) +{ + CONTRACTL + { + NOTHROW; + } + CONTRACTL_END; + + _ASSERTE(m_inited == 1); + + if (m_list.IsEmpty()) + return false; + return(m_list.IsInList(methodName, className, pSigInfo)); +} + +/**************************************************************************/ void ConfigDWORD::init_DontUse_(__in_z LPCWSTR keyName, DWORD defaultVal) { CONTRACTL @@ -1648,20 +1665,50 @@ bool MethodNamesListBase::IsInList(LPCUTF8 methName, LPCUTF8 clsName, PCCOR_SIGN NOTHROW; } CONTRACTL_END; - - ULONG numArgs = -1; + + int numArgs = -1; if (sig != NULL) { sig++; // Skip calling convention numArgs = CorSigUncompressData(sig); } + return IsInList(methName, clsName, numArgs); +} + +/**************************************************************/ +bool MethodNamesListBase::IsInList(LPCUTF8 methName, LPCUTF8 clsName, CORINFO_SIG_INFO* pSigInfo) +{ + CONTRACTL + { + NOTHROW; + } + CONTRACTL_END; + + int numArgs = -1; + if (pSigInfo != NULL) + { + numArgs = pSigInfo->numArgs; + } + + return IsInList(methName, clsName, numArgs); +} + +/**************************************************************/ +bool MethodNamesListBase::IsInList(LPCUTF8 methName, LPCUTF8 clsName, int numArgs) +{ + CONTRACTL + { + NOTHROW; + } + CONTRACTL_END; + // Try to match all the entries in the list for(MethodName * pName = pNames; pName; pName = pName->next) { // If numArgs is valid, check for mismatch - if (pName->numArgs != -1 && (ULONG)pName->numArgs != numArgs) + if (pName->numArgs != -1 && pName->numArgs != numArgs) continue; // If methodName is valid, check for mismatch |