Skip to content

Commit 7017817

Browse files
authored
Undo breaking change compat in GetMethodNativeMap (#59114)
* Undo breaking change compat when adding tiered aware behaviors to obtaining IL -> native maps.
1 parent 8ef8151 commit 7017817

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

src/coreclr/debug/daccess/daccess.cpp

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6030,13 +6030,20 @@ ClrDataAccess::GetMethodVarInfo(MethodDesc* methodDesc,
60306030
SUPPORTS_DAC;
60316031
COUNT_T countNativeVarInfo;
60326032
NewHolder<ICorDebugInfo::NativeVarInfo> nativeVars(NULL);
6033-
6034-
NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
6035-
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
6033+
TADDR nativeCodeStartAddr;
6034+
if (address != NULL)
60366035
{
6037-
return E_INVALIDARG;
6036+
NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
6037+
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
6038+
{
6039+
return E_INVALIDARG;
6040+
}
6041+
nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());
6042+
}
6043+
else
6044+
{
6045+
nativeCodeStartAddr = PCODEToPINSTR(methodDesc->GetNativeCode());
60386046
}
6039-
TADDR nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());
60406047

60416048
DebugInfoRequest request;
60426049
request.InitFromStartingAddr(methodDesc, nativeCodeStartAddr);
@@ -6081,13 +6088,20 @@ ClrDataAccess::GetMethodNativeMap(MethodDesc* methodDesc,
60816088

60826089
// Use the DebugInfoStore to get IL->Native maps.
60836090
// It doesn't matter whether we're jitted, ngenned etc.
6084-
6085-
NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
6086-
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
6091+
TADDR nativeCodeStartAddr;
6092+
if (address != NULL)
60876093
{
6088-
return E_INVALIDARG;
6094+
NativeCodeVersion requestedNativeCodeVersion = ExecutionManager::GetNativeCodeVersion(address);
6095+
if (requestedNativeCodeVersion.IsNull() || requestedNativeCodeVersion.GetNativeCode() == NULL)
6096+
{
6097+
return E_INVALIDARG;
6098+
}
6099+
nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());
6100+
}
6101+
else
6102+
{
6103+
nativeCodeStartAddr = PCODEToPINSTR(methodDesc->GetNativeCode());
60896104
}
6090-
TADDR nativeCodeStartAddr = PCODEToPINSTR(requestedNativeCodeVersion.GetNativeCode());
60916105

60926106
DebugInfoRequest request;
60936107
request.InitFromStartingAddr(methodDesc, nativeCodeStartAddr);

0 commit comments

Comments
 (0)