@@ -115,8 +115,7 @@ CordbThread::CordbThread(CordbProcess * pProcess, VMPTR_Thread vmThread) :
115
115
#endif
116
116
117
117
// Set AppDomain
118
- VMPTR_AppDomain vmAppDomain = pProcess->GetDAC ()->GetCurrentAppDomain (vmThread);
119
- m_pAppDomain = pProcess->LookupOrCreateAppDomain (vmAppDomain);
118
+ m_pAppDomain = pProcess->GetAppDomain ();
120
119
_ASSERTE (m_pAppDomain != NULL );
121
120
}
122
121
@@ -828,7 +827,7 @@ HRESULT CordbThread::GetCurrentException(ICorDebugValue ** ppExceptionObject)
828
827
#if defined(_DEBUG)
829
828
// Since we know an exception is in progress on this thread, our assumption about the
830
829
// thread's current AppDomain should be correct
831
- VMPTR_AppDomain vmAppDomain = pDAC->GetCurrentAppDomain (m_vmThreadToken );
830
+ VMPTR_AppDomain vmAppDomain = pDAC->GetCurrentAppDomain ();
832
831
_ASSERTE (GetAppDomain ()->GetADToken () == vmAppDomain);
833
832
#endif // _DEBUG
834
833
@@ -1843,12 +1842,8 @@ HRESULT CordbThread::GetCurrentAppDomain(CordbAppDomain ** ppAppDomain)
1843
1842
1844
1843
if (SUCCEEDED (hr))
1845
1844
{
1846
- IDacDbiInterface * pDAC = GetProcess ()->GetDAC ();
1847
- VMPTR_AppDomain vmAppDomain = pDAC->GetCurrentAppDomain (m_vmThreadToken);
1848
-
1849
- CordbAppDomain * pAppDomain = GetProcess ()->LookupOrCreateAppDomain (vmAppDomain);
1845
+ CordbAppDomain * pAppDomain = GetProcess ()->GetAppDomain ();
1850
1846
_ASSERTE (pAppDomain != NULL ); // we should be aware of all AppDomains
1851
-
1852
1847
*ppAppDomain = pAppDomain;
1853
1848
}
1854
1849
}
@@ -1896,23 +1891,9 @@ HRESULT CordbThread::GetObject(ICorDebugValue ** ppThreadObject)
1896
1891
ThrowHR (E_FAIL);
1897
1892
}
1898
1893
1899
- // We create the object relative to the current AppDomain of the thread
1900
- // Thread objects aren't really agile (eg. their m_Context field is domain-bound and
1901
- // fixed up manually during transitions). This means that a thread object can only
1902
- // be used in the domain the thread was in when the object was created.
1903
- VMPTR_AppDomain vmAppDomain = pDAC->GetCurrentAppDomain (m_vmThreadToken);
1904
-
1905
- CordbAppDomain * pThreadCurrentDomain = NULL ;
1906
- pThreadCurrentDomain = GetProcess ()->m_appDomains .GetBaseOrThrow (VmPtrToCookie (vmAppDomain));
1894
+ CordbAppDomain * pThreadCurrentDomain = pThreadCurrentDomain = GetProcess ()->GetAppDomain ();
1907
1895
_ASSERTE (pThreadCurrentDomain != NULL ); // we should be aware of all AppDomains
1908
1896
1909
- if (pThreadCurrentDomain == NULL )
1910
- {
1911
- // fall back to some domain to avoid crashes in retail -
1912
- // safe enough for getting the name of the thread etc.
1913
- pThreadCurrentDomain = GetProcess ()->GetAppDomain ();
1914
- }
1915
-
1916
1897
lockHolder.Release ();
1917
1898
1918
1899
ICorDebugReferenceValue * pRefValue = NULL ;
@@ -2442,7 +2423,7 @@ HRESULT CordbThread::GetCurrentCustomDebuggerNotification(ICorDebugValue ** ppNo
2442
2423
#if defined(_DEBUG)
2443
2424
// Since we know a notification has occurred on this thread, our assumption about the
2444
2425
// thread's current AppDomain should be correct
2445
- VMPTR_AppDomain vmAppDomain = pDAC->GetCurrentAppDomain (m_vmThreadToken );
2426
+ VMPTR_AppDomain vmAppDomain = pDAC->GetCurrentAppDomain ();
2446
2427
2447
2428
_ASSERTE (GetAppDomain ()->GetADToken () == vmAppDomain);
2448
2429
#endif // _DEBUG
0 commit comments