summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorAndrew Au <cshung@gmail.com>2019-01-14 09:43:51 -0800
committerGitHub <noreply@github.com>2019-01-14 09:43:51 -0800
commit9292b459ee805233b0f1624235222427fb018244 (patch)
treec72c6f25c592f9ee6048c9a455504e9f0e31793b /src/debug
parent8b7d300c164971f573d8186e78204597a679c7d8 (diff)
downloadcoreclr-9292b459ee805233b0f1624235222427fb018244.tar.gz
coreclr-9292b459ee805233b0f1624235222427fb018244.tar.bz2
coreclr-9292b459ee805233b0f1624235222427fb018244.zip
Making sure the nativeCodeVersion flowing change works with Rejit and EnC (#21961)
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/ee/functioninfo.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/debug/ee/functioninfo.cpp b/src/debug/ee/functioninfo.cpp
index 5898d208de..56b07c3fe9 100644
--- a/src/debug/ee/functioninfo.cpp
+++ b/src/debug/ee/functioninfo.cpp
@@ -1,3 +1,4 @@
+
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
@@ -938,6 +939,8 @@ void DebuggerJitInfo::LazyInitBounds()
LOG((LF_CORDB,LL_EVERYTHING, "DJI::LazyInitBounds: this=0x%x GetBoundariesAndVars success=0x%x\n", this, fSuccess));
+ // SetBoundaries uses the CodeVersionManager, need to take it now for lock ordering reasons
+ CodeVersionManager::TableLockHolder lockHolder(mdesc->GetCodeVersionManager());
Debugger::DebuggerDataLockHolder debuggerDataLockHolder(g_pDebugger);
if (!m_fAttemptInit)
@@ -1064,6 +1067,8 @@ void DebuggerJitInfo::SetBoundaries(ULONG32 cMap, ICorDebugInfo::OffsetMapping *
// Pick a unique initial value (-10) so that the 1st doesn't accidentally match.
int ilPrevOld = -10;
+ _ASSERTE(m_nativeCodeVersion.GetMethodDesc()->GetCodeVersionManager()->LockOwnedByCurrentThread());
+
InstrumentedILOffsetMapping mapping;
ILCodeVersion ilVersion = m_nativeCodeVersion.GetILCodeVersion();
@@ -1614,7 +1619,12 @@ DebuggerJitInfo *DebuggerMethodInfo::FindOrCreateInitAndAddJitInfo(MethodDesc* f
CodeVersionManager::TableLockHolder lockHolder(fd->GetCodeVersionManager());
CodeVersionManager *pCodeVersionManager = fd->GetCodeVersionManager();
NativeCodeVersion nativeCodeVersion = pCodeVersionManager->GetNativeCodeVersion(fd, startAddr);
- _ASSERTE(!nativeCodeVersion.IsNull());
+
+ // Some day we'll get EnC to use code versioning properly, but until then we'll get the right behavior treating all EnC versions as the default native code version.
+ if (nativeCodeVersion.IsNull())
+ {
+ nativeCodeVersion = NativeCodeVersion(fd);
+ }
BOOL jitInfoWasCreated;
return CreateInitAndAddJitInfo(nativeCodeVersion, startAddr, &jitInfoWasCreated);