Skip to content

Commit

Permalink
Undo breaking change compat in GetMethodNativeMap (dotnet#59114)
Browse files Browse the repository at this point in the history
* Undo breaking change compat when adding tiered aware behaviors to obtaining IL -> native maps.
  • Loading branch information
hoyosjs authored Sep 16, 2021
1 parent 8ef8151 commit 7017817
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6030,13 +6030,20 @@ ClrDataAccess::GetMethodVarInfo(MethodDesc* methodDesc,
SUPPORTS_DAC;
COUNT_T countNativeVarInfo;
NewHolder<ICorDebugInfo::NativeVarInfo> nativeVars(NULL);

NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
TADDR nativeCodeStartAddr;
if (address != NULL)
{
return E_INVALIDARG;
NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
{
return E_INVALIDARG;
}
nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());
}
else
{
nativeCodeStartAddr = PCODEToPINSTR(methodDesc->GetNativeCode());
}
TADDR nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());

DebugInfoRequest request;
request.InitFromStartingAddr(methodDesc, nativeCodeStartAddr);
Expand Down Expand Up @@ -6081,13 +6088,20 @@ ClrDataAccess::GetMethodNativeMap(MethodDesc* methodDesc,

// Use the DebugInfoStore to get IL->Native maps.
// It doesn't matter whether we're jitted, ngenned etc.

NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
TADDR nativeCodeStartAddr;
if (address != NULL)
{
return E_INVALIDARG;
NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
{
return E_INVALIDARG;
}
nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());
}
else
{
nativeCodeStartAddr = PCODEToPINSTR(methodDesc->GetNativeCode());
}
TADDR nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());

DebugInfoRequest request;
request.InitFromStartingAddr(methodDesc, nativeCodeStartAddr);
Expand Down

0 comments on commit 7017817

Please sign in to comment.