From: David Mason Date: Wed, 16 Oct 2019 20:13:55 +0000 (-0700) Subject: Fix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap... X-Git-Tag: accepted/tizen/unified/20200402.155517~102 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=617091aa904c74fe8a42cebf7fcb56677c60c079;p=platform%2Fupstream%2Fcoreclr.git Fix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap (#27075) Port #25802 to 3.1 --- diff --git a/src/debug/daccess/dacdbiimpl.cpp b/src/debug/daccess/dacdbiimpl.cpp index 4ef3bc7..a65233c 100644 --- a/src/debug/daccess/dacdbiimpl.cpp +++ b/src/debug/daccess/dacdbiimpl.cpp @@ -1003,13 +1003,19 @@ void DacDbiInterfaceImpl::GetSequencePoints(MethodDesc * pMethodDesc, if (!success) ThrowHR(E_FAIL); - // if there is a rejit IL map for this function, apply that in preference to load-time mapping #ifdef FEATURE_REJIT CodeVersionManager * pCodeVersionManager = pMethodDesc->GetCodeVersionManager(); + ILCodeVersion ilVersion; NativeCodeVersion nativeCodeVersion = pCodeVersionManager->GetNativeCodeVersion(dac_cast(pMethodDesc), (PCODE)startAddr); if (!nativeCodeVersion.IsNull()) { - const InstrumentedILOffsetMapping * pRejitMapping = nativeCodeVersion.GetILCodeVersion().GetInstrumentedILMap(); + ilVersion = nativeCodeVersion.GetILCodeVersion(); + } + + // if there is a rejit IL map for this function, apply that in preference to load-time mapping + if (!ilVersion.IsNull() && !ilVersion.IsDefaultVersion()) + { + const InstrumentedILOffsetMapping * pRejitMapping = ilVersion.GetInstrumentedILMap(); ComposeMapping(pRejitMapping, mapCopy, &entryCount); } else