Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 8f60f14

Browse files
authored
Fix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap (#27843)
Port #25802 to 3.0.2
1 parent bb3006f commit 8f60f14

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/debug/daccess/dacdbiimpl.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,13 +1003,19 @@ void DacDbiInterfaceImpl::GetSequencePoints(MethodDesc * pMethodDesc,
10031003
if (!success)
10041004
ThrowHR(E_FAIL);
10051005

1006-
// if there is a rejit IL map for this function, apply that in preference to load-time mapping
10071006
#ifdef FEATURE_REJIT
10081007
CodeVersionManager * pCodeVersionManager = pMethodDesc->GetCodeVersionManager();
1008+
ILCodeVersion ilVersion;
10091009
NativeCodeVersion nativeCodeVersion = pCodeVersionManager->GetNativeCodeVersion(dac_cast<PTR_MethodDesc>(pMethodDesc), (PCODE)startAddr);
10101010
if (!nativeCodeVersion.IsNull())
10111011
{
1012-
const InstrumentedILOffsetMapping * pRejitMapping = nativeCodeVersion.GetILCodeVersion().GetInstrumentedILMap();
1012+
ilVersion = nativeCodeVersion.GetILCodeVersion();
1013+
}
1014+
1015+
// if there is a rejit IL map for this function, apply that in preference to load-time mapping
1016+
if (!ilVersion.IsNull() && !ilVersion.IsDefaultVersion())
1017+
{
1018+
const InstrumentedILOffsetMapping * pRejitMapping = ilVersion.GetInstrumentedILMap();
10131019
ComposeMapping(pRejitMapping, mapCopy, &entryCount);
10141020
}
10151021
else

0 commit comments

Comments
 (0)