diff options
author | Sergey Andreenko <seandree@microsoft.com> | 2021-02-17 11:10:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-17 11:10:33 +0300 |
commit | 1df2bc9018846da1b1ba4ba38cf04273388c7c27 (patch) | |
tree | 95634ed3d94a932beebc7be750a8edbb1bf32e90 /src/coreclr/ToolBox | |
parent | 44d5fd11d470e22977e7bb17b21e3cda876cc9ce (diff) |
SPMI fixes for missing info. (#48360)
* SPMI hacks/fixes.
* review response.
Diffstat (limited to 'src/coreclr/ToolBox')
3 files changed, 15 insertions, 5 deletions
diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index e00e396f446..7ee97df351b 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -2635,6 +2635,13 @@ void MethodContext::repGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO* key.A = CastHandle(ftn); key.B = CastHandle(memberParent); + + AssertCodeMsg(GetMethodSig != nullptr, EXCEPTIONCODE_MC, + "Didn't find anything anything for ftn-%016llX prt-%016llX", key.A, key.B); + + AssertCodeMsg(GetMethodSig->GetIndex(key) != -1, EXCEPTIONCODE_MC, + "Didn't find anything anything for ftn-%016llX prt-%016llX", key.A, key.B); + value = GetMethodSig->Get(key); *sig = SpmiRecordsHelper::Restore_CORINFO_SIG_INFO(value, GetMethodSig, SigInstHandleMap); @@ -2683,9 +2690,6 @@ CORINFO_CLASS_HANDLE MethodContext::repGetArgClass(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args, DWORD* exceptionCode) { - AssertCodeMsg(GetArgClass != nullptr, EXCEPTIONCODE_MC, - "Didn't find %016llx, %016llx. probably a missing exception in getArgClass", CastHandle(sig->scope), CastHandle(args)); - Agnostic_GetArgClass_Key key; ZeroMemory(&key, sizeof(Agnostic_GetArgClass_Key)); // We use the input structs as a key and use memcmp to compare.. so // we need to zero out padding too @@ -2695,10 +2699,12 @@ CORINFO_CLASS_HANDLE MethodContext::repGetArgClass(CORINFO_SIG_INFO* sig, key.methodSignature = CastPointer(sig->methodSignature); key.scope = CastHandle(sig->scope); key.args = CastHandle(args); - key.sigInst_classInst_Index = SpmiRecordsHelper::ContainsHandleMap(sig->sigInst.classInstCount, sig->sigInst.classInst, SigInstHandleMap); key.sigInst_methInst_Index = SpmiRecordsHelper::ContainsHandleMap(sig->sigInst.methInstCount, sig->sigInst.methInst, SigInstHandleMap); + AssertCodeMsg(GetArgClass != nullptr, EXCEPTIONCODE_MC, + "Didn't find %016llx, %016llx. probably a missing exception in getArgClass", key.scope, key.args); + AssertCodeMsg(GetArgClass->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llx, %016llx. probably a missing exception in getArgClass", key.scope, key.args); diff --git a/src/coreclr/ToolBox/superpmi/superpmi/jitinstance.cpp b/src/coreclr/ToolBox/superpmi/superpmi/jitinstance.cpp index bc81ff9dd3f..7047afe65a5 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi/jitinstance.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi/jitinstance.cpp @@ -354,7 +354,7 @@ JitInstance::Result JitInstance::CompileMethod(MethodContext* MethodToCompile, i { SpmiException e(¶m.exceptionPointers); - if (e.GetCode() == EXCEPTIONCODE_MC) + if (param.exceptionCode == EXCEPTIONCODE_MC) // Can't check e.GetCode() because of https://github.com/dotnet/runtime/issues/48356 { char* message = e.GetExceptionMessage(); LogMissing("Method context %d failed to replay: %s", mcIndex, message); diff --git a/src/coreclr/ToolBox/superpmi/superpmi/superpmi.cpp b/src/coreclr/ToolBox/superpmi/superpmi/superpmi.cpp index a23632693ea..5503eba23fe 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi/superpmi.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi/superpmi.cpp @@ -537,8 +537,12 @@ int __cdecl main(int argc, char* argv[]) { failToReplayCount++; + // Methods that don't compile due to missing JIT-EE information + // should still be added to the failing MC list but we don't create MC repro for them. if (o.mclFilename != nullptr) + { failingToReplayMCL.AddMethodToMCL(reader->GetMethodContextIndex()); + } // The following only apply specifically to failures caused by errors (as opposed // to, for instance, failures caused by missing JIT-EE details). |