Skip to content

Commit

Permalink
Fix GetSequencePoints when profiler provides mapping via SetILInstrum…
Browse files Browse the repository at this point in the history
…entedCodeMap (dotnet/coreclr#25802)

* Fix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap

* code review feedback


Commit migrated from dotnet/coreclr@75c628f
  • Loading branch information
davmason authored Jul 24, 2019
1 parent 723efc2 commit 226ef40
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/coreclr/src/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PTR_MethodDesc>(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
Expand Down

0 comments on commit 226ef40

Please sign in to comment.