diff options
author | Mike McLaughlin <mikem@microsoft.com> | 2015-02-24 15:25:57 -0800 |
---|---|---|
committer | Mike McLaughlin <mikem@microsoft.com> | 2015-03-06 14:32:22 -0800 |
commit | eaed12c0dc4e458e89ce03685c21a697787c5b67 (patch) | |
tree | d14193756a459249af619bf1aae984d875369607 /src/vm | |
parent | 52a0efc99c562e715c278eed8421f58d3ca6b327 (diff) | |
download | coreclr-eaed12c0dc4e458e89ce03685c21a697787c5b67.tar.gz coreclr-eaed12c0dc4e458e89ce03685c21a697787c5b67.tar.bz2 coreclr-eaed12c0dc4e458e89ce03685c21a697787c5b67.zip |
Add a fourth parameter to the DEFINE_DACVAR macro that is the actual fully qualified name of the static/global.
First pass at the global DAC table support for Linux. Explicitly build the table in the coreclr module instead of extract it from the pdb and put it in a resource.
Fixed the SVR gc globals in the DAC table. They had to be seperated and initialized in gceesvr.cpp.
Start on global pointer table.
PAL functions to write and read the DAC table address between processes.
The dac table is now copied from the coreclr process to the DAC/debugger process. The tables were not being built with exactly the same defines so they weren't the same size. Fixed a bug in the read memory implementation. Still assumes pid = 0.
Changed the dacTable entries to be RVAs and renabled getting the corclr module base addres (m_globalBase). Added dac table address file cleanup on coreclr shutdown.
Filled in the vtable entries in the global dac table. Changed some of the VPTR_* macros to be defined on the coreclr side (RS) to defined a constructor that is used to get the vtable in dactable.cpp. These changes required default constructors to be added to some of the classes.
Changed getting the vtable address to not invoke the destructors since the constructor used didn't do anything (like initialize variables, etc.).
Added a TODO comment about the debuggee pid not being available in the dac table address file name.
Fixed Windows build. Created a couple of new VPTR_* macros that add a default constructor only if building coreclr (not DAC) on Linux.
Comment on how these DAC table functions are temporary.
Diffstat (limited to 'src/vm')
-rw-r--r-- | src/vm/appdomain.hpp | 3 | ||||
-rw-r--r-- | src/vm/ceemain.h | 2 | ||||
-rw-r--r-- | src/vm/codeman.h | 6 | ||||
-rw-r--r-- | src/vm/crst.h | 3 | ||||
-rw-r--r-- | src/vm/dbginterface.h | 2 | ||||
-rw-r--r-- | src/vm/eedbginterface.h | 2 | ||||
-rw-r--r-- | src/vm/eedbginterfaceimpl.h | 4 | ||||
-rw-r--r-- | src/vm/object.h | 1 | ||||
-rw-r--r-- | src/vm/pefile.h | 1 | ||||
-rw-r--r-- | src/vm/rcwwalker.h | 2 | ||||
-rw-r--r-- | src/vm/security.h | 6 | ||||
-rw-r--r-- | src/vm/securitydescriptor.h | 2 | ||||
-rw-r--r-- | src/vm/securitydescriptorappdomain.h | 2 | ||||
-rw-r--r-- | src/vm/securitydescriptorassembly.h | 2 | ||||
-rw-r--r-- | src/vm/simplerwlock.hpp | 2 | ||||
-rw-r--r-- | src/vm/stackwalktypes.h | 2 | ||||
-rw-r--r-- | src/vm/stubmgr.h | 3 | ||||
-rw-r--r-- | src/vm/win32threadpool.h | 17 |
18 files changed, 37 insertions, 25 deletions
diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp index 24c86e9ae4..0e966659bb 100644 --- a/src/vm/appdomain.hpp +++ b/src/vm/appdomain.hpp @@ -5162,8 +5162,7 @@ typedef VPTR(class SharedDomain) PTR_SharedDomain; class SharedDomain : public BaseDomain { - - VPTR_VTABLE_CLASS(SharedDomain, BaseDomain) + VPTR_VTABLE_CLASS_AND_CTOR(SharedDomain, BaseDomain) public: diff --git a/src/vm/ceemain.h b/src/vm/ceemain.h index e4f70057b9..9a6a54fbb3 100644 --- a/src/vm/ceemain.h +++ b/src/vm/ceemain.h @@ -57,6 +57,8 @@ void InnerCoEEShutDownCOM(); // how the g_pCEE and related variables are initialized. class CExecutionEngine : public IExecutionEngine, public IEEMemoryManager { + friend struct _DacGlobals; + //*************************************************************************** // public API: //*************************************************************************** diff --git a/src/vm/codeman.h b/src/vm/codeman.h index e7ba84b862..a28c556dfd 100644 --- a/src/vm/codeman.h +++ b/src/vm/codeman.h @@ -390,10 +390,7 @@ class CodeHeap VPTR_BASE_VTABLE_CLASS(CodeHeap) public: - -#ifdef DACCESS_COMPILE CodeHeap() {} -#endif // virtual dtor. Clean up heap virtual ~CodeHeap() {} @@ -1143,6 +1140,7 @@ public: class ExecutionManager { friend class CorExternalDataAccess; + friend struct _DacGlobals; #ifdef DACCESS_COMPILE friend class ClrDataAccess; @@ -1282,7 +1280,7 @@ public: LoaderAllocator *pLoaderAllocator = NULL); #endif -private : +private: static RangeSection * FindCodeRangeWithLock(PCODE currentPC); static BOOL IsManagedCodeWithLock(PCODE currentPC); diff --git a/src/vm/crst.h b/src/vm/crst.h index da50066ccc..010cb5f8fb 100644 --- a/src/vm/crst.h +++ b/src/vm/crst.h @@ -473,11 +473,12 @@ public: LIMITED_METHOD_CONTRACT; }; +#endif + Crst() { LIMITED_METHOD_CONTRACT; } -#endif #endif // CLR_STANDALONE_BINDER }; diff --git a/src/vm/dbginterface.h b/src/vm/dbginterface.h index fb3e167374..4d55f74e02 100644 --- a/src/vm/dbginterface.h +++ b/src/vm/dbginterface.h @@ -28,7 +28,7 @@ typedef void (*FAVORCALLBACK)(void *); class DebugInterface { - VPTR_BASE_VTABLE_CLASS(DebugInterface); + VPTR_BASE_VTABLE_CLASS_AND_CTOR(DebugInterface); public: diff --git a/src/vm/eedbginterface.h b/src/vm/eedbginterface.h index f300a0f665..e6678a8861 100644 --- a/src/vm/eedbginterface.h +++ b/src/vm/eedbginterface.h @@ -63,7 +63,7 @@ struct DebugOffsetToHandlerInfo class EEDebugInterface { - VPTR_BASE_VTABLE_CLASS(EEDebugInterface); + VPTR_BASE_VTABLE_CLASS_AND_CTOR(EEDebugInterface); public: diff --git a/src/vm/eedbginterfaceimpl.h b/src/vm/eedbginterfaceimpl.h index 5b59f897d0..f743dd02c1 100644 --- a/src/vm/eedbginterfaceimpl.h +++ b/src/vm/eedbginterfaceimpl.h @@ -36,7 +36,7 @@ class EEDbgInterfaceImpl : public EEDebugInterface { - VPTR_VTABLE_CLASS(EEDbgInterfaceImpl, EEDebugInterface); + VPTR_VTABLE_CLASS_AND_CTOR(EEDbgInterfaceImpl, EEDebugInterface); public: @@ -48,7 +48,7 @@ public: static FORCEINLINE void Init(void) { g_pEEDbgInterfaceImpl = new EEDbgInterfaceImpl(); // new throws on failure - } + } // // Cleanup any global data used by this interface. diff --git a/src/vm/object.h b/src/vm/object.h index 4930944c96..2669a54b2a 100644 --- a/src/vm/object.h +++ b/src/vm/object.h @@ -747,6 +747,7 @@ class ArrayBase : public Object friend OBJECTREF FastAllocatePrimitiveArray(MethodTable* arrayType, DWORD cElements, BOOL bAllocateInLargeHeap); friend class JIT_TrialAlloc; friend class CheckAsmOffsets; + friend struct _DacGlobals; private: // This MUST be the first field, so that it directly follows Object. This is because diff --git a/src/vm/pefile.h b/src/vm/pefile.h index a62ba774c8..8f8a5f3588 100644 --- a/src/vm/pefile.h +++ b/src/vm/pefile.h @@ -108,7 +108,6 @@ class PEFile // ------------------------------------------------------------ // SOS support // ------------------------------------------------------------ - VPTR_BASE_CONCRETE_VTABLE_CLASS(PEFile) public: diff --git a/src/vm/rcwwalker.h b/src/vm/rcwwalker.h index a2272eafbb..2497b8c2f8 100644 --- a/src/vm/rcwwalker.h +++ b/src/vm/rcwwalker.h @@ -32,6 +32,8 @@ // class RCWWalker { + friend struct _DacGlobals; + private : static VolatilePtr<IJupiterGCManager> s_pGCManager; // The one and only GCManager instance static BOOL s_bGCStarted; // Has GC started? diff --git a/src/vm/security.h b/src/vm/security.h index 2b9e63c06d..9331a6820a 100644 --- a/src/vm/security.h +++ b/src/vm/security.h @@ -246,7 +246,9 @@ namespace Security class ISecurityDescriptor { public: +#ifndef FEATURE_PAL VPTR_BASE_VTABLE_CLASS(ISecurityDescriptor) +#endif virtual ~ISecurityDescriptor() { LIMITED_METHOD_CONTRACT; } virtual BOOL IsFullyTrusted() = 0; @@ -274,7 +276,9 @@ public: class IApplicationSecurityDescriptor : public ISecurityDescriptor { public: +#ifndef FEATURE_PAL VPTR_ABSTRACT_VTABLE_CLASS(IApplicationSecurityDescriptor, ISecurityDescriptor) +#endif #ifndef DACCESS_COMPILE public: @@ -318,7 +322,9 @@ public: class IAssemblySecurityDescriptor : public ISecurityDescriptor { public: +#ifndef FEATURE_PAL VPTR_ABSTRACT_VTABLE_CLASS(IAssemblySecurityDescriptor, ISecurityDescriptor) +#endif #ifndef DACCESS_COMPILE virtual SharedSecurityDescriptor *GetSharedSecDesc() = 0; diff --git a/src/vm/securitydescriptor.h b/src/vm/securitydescriptor.h index 22aecf5dd8..5d52f0494b 100644 --- a/src/vm/securitydescriptor.h +++ b/src/vm/securitydescriptor.h @@ -139,7 +139,9 @@ template<typename IT> class SecurityDescriptorBase : public IT, public SecurityDescriptor { public: +#ifndef FEATURE_PAL VPTR_ABSTRACT_VTABLE_CLASS(SecurityDescriptorBase, IT) // needed for the DAC +#endif inline SecurityDescriptorBase(AppDomain *pAppDomain, DomainAssembly *pAssembly, PEFile* pPEFile, LoaderAllocator *pLoaderAllocator); diff --git a/src/vm/securitydescriptorappdomain.h b/src/vm/securitydescriptorappdomain.h index d39cf0e3a9..6deab32c2d 100644 --- a/src/vm/securitydescriptorappdomain.h +++ b/src/vm/securitydescriptorappdomain.h @@ -36,7 +36,9 @@ class ApplicationSecurityDescriptor : public SecurityDescriptorBase<IApplicationSecurityDescriptor> { public: +#ifndef FEATURE_PAL VPTR_VTABLE_CLASS(ApplicationSecurityDescriptor, SecurityDescriptorBase<IApplicationSecurityDescriptor>) +#endif private: // Dependency in managed : System.Security.HostSecurityManager.cs diff --git a/src/vm/securitydescriptorassembly.h b/src/vm/securitydescriptorassembly.h index 306ac24517..3687538a06 100644 --- a/src/vm/securitydescriptorassembly.h +++ b/src/vm/securitydescriptorassembly.h @@ -57,7 +57,9 @@ void StoreObjectInLazyHandle(LOADERHANDLE& handle, OBJECTREF ref, LoaderAllocato class AssemblySecurityDescriptor : public SecurityDescriptorBase<IAssemblySecurityDescriptor> { public: +#ifndef FEATURE_PAL VPTR_VTABLE_CLASS(AssemblySecurityDescriptor, SecurityDescriptorBase<IAssemblySecurityDescriptor>) +#endif private: PsetCacheEntry* m_arrPassedLinktimeDemands[MAX_PASSED_DEMANDS]; diff --git a/src/vm/simplerwlock.hpp b/src/vm/simplerwlock.hpp index 4566bcd4d1..6363d60884 100644 --- a/src/vm/simplerwlock.hpp +++ b/src/vm/simplerwlock.hpp @@ -163,7 +163,6 @@ public: #endif } -#ifdef DACCESS_COMPILE // Special empty CTOR for DAC. We still need to assign to const fields, but they won't actually be used. SimpleRWLock() : m_gcMode(COOPERATIVE_OR_PREEMPTIVE) @@ -174,7 +173,6 @@ public: m_countNoTriggerGC = 0; #endif //_DEBUG } -#endif #ifndef DACCESS_COMPILE // Acquire the reader lock. diff --git a/src/vm/stackwalktypes.h b/src/vm/stackwalktypes.h index f2be145c81..89829a85dc 100644 --- a/src/vm/stackwalktypes.h +++ b/src/vm/stackwalktypes.h @@ -199,6 +199,8 @@ static_assert_no_msg(sizeof(StackwalkCacheEntry) == 2 * sizeof(UINT_PTR)); class StackwalkCache { + friend struct _DacGlobals; + public: BOOL Lookup(UINT_PTR IP); void Insert(StackwalkCacheEntry *pCacheEntry); diff --git a/src/vm/stubmgr.h b/src/vm/stubmgr.h index 70405ddf50..00743e2b14 100644 --- a/src/vm/stubmgr.h +++ b/src/vm/stubmgr.h @@ -194,6 +194,7 @@ typedef VPTR(class StubManager) PTR_StubManager; class StubManager { friend class StubManagerIterator; + VPTR_BASE_VTABLE_CLASS(StubManager) public: @@ -319,7 +320,7 @@ public: // This is used by DAC to provide more information on who owns a stub. virtual LPCWSTR GetStubManagerName(PCODE addr) = 0; #endif - + private: SPTR_DECL(StubManager, g_pFirstManager); PTR_StubManager m_pNextManager; diff --git a/src/vm/win32threadpool.h b/src/vm/win32threadpool.h index 20d2412c18..22fd6e05b4 100644 --- a/src/vm/win32threadpool.h +++ b/src/vm/win32threadpool.h @@ -104,7 +104,7 @@ class ThreadpoolMgr friend class ManagedPerAppDomainTPCount; friend class PerAppDomainTPCountList; friend class HillClimbing; - + friend struct _DacGlobals; // // UnfairSemaphore is a more scalable semaphore than CLRSemaphore. It prefers to release threads that have more recently begun waiting, @@ -1291,8 +1291,8 @@ private: static LONG Initialization; // indicator of whether the threadpool is initialized. - SVAL_DECL(LONG,MinLimitTotalWorkerThreads); // same as MinLimitTotalCPThreads - SVAL_DECL(LONG,MaxLimitTotalWorkerThreads); // same as MaxLimitTotalCPThreads + SVAL_DECL(LONG,MinLimitTotalWorkerThreads); // same as MinLimitTotalCPThreads + SVAL_DECL(LONG,MaxLimitTotalWorkerThreads); // same as MaxLimitTotalCPThreads static Volatile<unsigned int> LastDequeueTime; // used to determine if work items are getting thread starved @@ -1306,12 +1306,10 @@ private: static int ThreadAdjustmentInterval; - private: - SPTR_DECL(WorkRequest,WorkRequestHead); // Head of work request queue SPTR_DECL(WorkRequest,WorkRequestTail); // Head of work request queue - static unsigned int LastCPThreadCreation; // last time a completion port thread was created + static unsigned int LastCPThreadCreation; // last time a completion port thread was created static unsigned int NumberOfProcessors; // = NumberOfWorkerThreads - no. of blocked threads static BOOL IsApcPendingOnWaitThread; // Indicates if an APC is pending on the wait thread @@ -1323,9 +1321,8 @@ public: static CrstStatic WorkerCriticalSection; private: - static const DWORD WorkerTimeout = 20 * 1000; - static const DWORD WorkerTimeoutAppX = 5 * 1000; // shorter timeout to allow threads to exit prior to app suspension + static const DWORD WorkerTimeoutAppX = 5 * 1000; // shorter timeout to allow threads to exit prior to app suspension SVAL_DECL(ThreadCounter,WorkerCounter); @@ -1361,10 +1358,10 @@ private: static BOOL InitCompletionPortThreadpool; // flag indicating whether completion port threadpool has been initialized static HANDLE GlobalCompletionPort; // used for binding io completions on file handles - public: +public: SVAL_DECL(ThreadCounter,CPThreadCounter); - private: +private: SVAL_DECL(LONG,MaxLimitTotalCPThreads); // = MaxLimitCPThreadsPerCPU * number of CPUS SVAL_DECL(LONG,MinLimitTotalCPThreads); SVAL_DECL(LONG,MaxFreeCPThreads); // = MaxFreeCPThreadsPerCPU * Number of CPUS |