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

Commit d36fefc

Browse files
authored
Fix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap (#27295)
Port #25802 to release/2.1
1 parent baab524 commit d36fefc

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
@@ -1002,13 +1002,19 @@ void DacDbiInterfaceImpl::GetSequencePoints(MethodDesc * pMethodDesc,
10021002
if (!success)
10031003
ThrowHR(E_FAIL);
10041004

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

0 commit comments

Comments
 (0)