|
| 1 | + |
1 | 2 | // Licensed to the .NET Foundation under one or more agreements.
|
2 | 3 | // The .NET Foundation licenses this file to you under the MIT license.
|
3 | 4 | // See the LICENSE file in the project root for more information.
|
@@ -938,6 +939,8 @@ void DebuggerJitInfo::LazyInitBounds()
|
938 | 939 |
|
939 | 940 | LOG((LF_CORDB,LL_EVERYTHING, "DJI::LazyInitBounds: this=0x%x GetBoundariesAndVars success=0x%x\n", this, fSuccess));
|
940 | 941 |
|
| 942 | + // SetBoundaries uses the CodeVersionManager, need to take it now for lock ordering reasons |
| 943 | + CodeVersionManager::TableLockHolder lockHolder(mdesc->GetCodeVersionManager()); |
941 | 944 | Debugger::DebuggerDataLockHolder debuggerDataLockHolder(g_pDebugger);
|
942 | 945 |
|
943 | 946 | if (!m_fAttemptInit)
|
@@ -1064,6 +1067,8 @@ void DebuggerJitInfo::SetBoundaries(ULONG32 cMap, ICorDebugInfo::OffsetMapping *
|
1064 | 1067 | // Pick a unique initial value (-10) so that the 1st doesn't accidentally match.
|
1065 | 1068 | int ilPrevOld = -10;
|
1066 | 1069 |
|
| 1070 | + _ASSERTE(m_nativeCodeVersion.GetMethodDesc()->GetCodeVersionManager()->LockOwnedByCurrentThread()); |
| 1071 | + |
1067 | 1072 | InstrumentedILOffsetMapping mapping;
|
1068 | 1073 |
|
1069 | 1074 | ILCodeVersion ilVersion = m_nativeCodeVersion.GetILCodeVersion();
|
@@ -1614,7 +1619,12 @@ DebuggerJitInfo *DebuggerMethodInfo::FindOrCreateInitAndAddJitInfo(MethodDesc* f
|
1614 | 1619 | CodeVersionManager::TableLockHolder lockHolder(fd->GetCodeVersionManager());
|
1615 | 1620 | CodeVersionManager *pCodeVersionManager = fd->GetCodeVersionManager();
|
1616 | 1621 | NativeCodeVersion nativeCodeVersion = pCodeVersionManager->GetNativeCodeVersion(fd, startAddr);
|
1617 |
| - _ASSERTE(!nativeCodeVersion.IsNull()); |
| 1622 | + |
| 1623 | + // 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. |
| 1624 | + if (nativeCodeVersion.IsNull()) |
| 1625 | + { |
| 1626 | + nativeCodeVersion = NativeCodeVersion(fd); |
| 1627 | + } |
1618 | 1628 |
|
1619 | 1629 | BOOL jitInfoWasCreated;
|
1620 | 1630 | return CreateInitAndAddJitInfo(nativeCodeVersion, startAddr, &jitInfoWasCreated);
|
|
0 commit comments