diff --git a/src/coreclr/debug/runtimeinfo/datadescriptor.h b/src/coreclr/debug/runtimeinfo/datadescriptor.h index b0369d3f0bf1e..b890bd16c720d 100644 --- a/src/coreclr/debug/runtimeinfo/datadescriptor.h +++ b/src/coreclr/debug/runtimeinfo/datadescriptor.h @@ -26,20 +26,20 @@ // offsetof(SomeClass, m_FieldName) if the field is public // // if the field is private, the convention is that SomeClass declares a friend struct -// cdac_offsets and provides a specialization of cdac_offsets with a public constexpr +// cdac_data and provides a specialization of cdac_data with a public constexpr // size_t member that holds the offset: // // class MyClass { // private: // void* m_myField; -// friend template cdac_offsets; +// friend template cdac_data; // }; -// template<> struct cdac_offsets { +// template<> struct cdac_data { // static constexpr size_t MyField = offsetof(MyClass, m_myField); // }; // // then the field layout can be specified as -// CDAC_TYPE_FIELD(MyClassLayout, pointer, MyField, cdac_offsets::MyField) +// CDAC_TYPE_FIELD(MyClassLayout, pointer, MyField, cdac_data::MyField) // There can be zero or more CDAC_TYPE_FIELD entries per type layout // // CDAC_TYPE_END(cdacTypeIdentifier) specifies the end of the type layout for cdacTypeIdentifier @@ -105,29 +105,29 @@ CDAC_TYPES_BEGIN() CDAC_TYPE_BEGIN(Thread) CDAC_TYPE_INDETERMINATE(Thread) -CDAC_TYPE_FIELD(Thread, /*uint32*/, Id, cdac_offsets::Id) -CDAC_TYPE_FIELD(Thread, /*nuint*/, OSId, cdac_offsets::OSId) -CDAC_TYPE_FIELD(Thread, /*uint32*/, State, cdac_offsets::State) -CDAC_TYPE_FIELD(Thread, /*uint32*/, PreemptiveGCDisabled, cdac_offsets::PreemptiveGCDisabled) -CDAC_TYPE_FIELD(Thread, /*pointer*/, RuntimeThreadLocals, cdac_offsets::RuntimeThreadLocals) -CDAC_TYPE_FIELD(Thread, /*pointer*/, Frame, cdac_offsets::Frame) -CDAC_TYPE_FIELD(Thread, /*pointer*/, ExceptionTracker, cdac_offsets::ExceptionTracker) -CDAC_TYPE_FIELD(Thread, GCHandle, GCHandle, cdac_offsets::ExposedObject) -CDAC_TYPE_FIELD(Thread, GCHandle, LastThrownObject, cdac_offsets::LastThrownObject) -CDAC_TYPE_FIELD(Thread, pointer, LinkNext, cdac_offsets::Link) +CDAC_TYPE_FIELD(Thread, /*uint32*/, Id, cdac_data::Id) +CDAC_TYPE_FIELD(Thread, /*nuint*/, OSId, cdac_data::OSId) +CDAC_TYPE_FIELD(Thread, /*uint32*/, State, cdac_data::State) +CDAC_TYPE_FIELD(Thread, /*uint32*/, PreemptiveGCDisabled, cdac_data::PreemptiveGCDisabled) +CDAC_TYPE_FIELD(Thread, /*pointer*/, RuntimeThreadLocals, cdac_data::RuntimeThreadLocals) +CDAC_TYPE_FIELD(Thread, /*pointer*/, Frame, cdac_data::Frame) +CDAC_TYPE_FIELD(Thread, /*pointer*/, ExceptionTracker, cdac_data::ExceptionTracker) +CDAC_TYPE_FIELD(Thread, GCHandle, GCHandle, cdac_data::ExposedObject) +CDAC_TYPE_FIELD(Thread, GCHandle, LastThrownObject, cdac_data::LastThrownObject) +CDAC_TYPE_FIELD(Thread, pointer, LinkNext, cdac_data::Link) #ifndef TARGET_UNIX -CDAC_TYPE_FIELD(Thread, /*pointer*/, TEB, cdac_offsets::TEB) +CDAC_TYPE_FIELD(Thread, /*pointer*/, TEB, cdac_data::TEB) #endif CDAC_TYPE_END(Thread) CDAC_TYPE_BEGIN(ThreadStore) CDAC_TYPE_INDETERMINATE(ThreadStore) -CDAC_TYPE_FIELD(ThreadStore, /*SLink*/, FirstThreadLink, cdac_offsets::FirstThreadLink) -CDAC_TYPE_FIELD(ThreadStore, /*int32*/, ThreadCount, cdac_offsets::ThreadCount) -CDAC_TYPE_FIELD(ThreadStore, /*int32*/, UnstartedCount, cdac_offsets::UnstartedCount) -CDAC_TYPE_FIELD(ThreadStore, /*int32*/, BackgroundCount, cdac_offsets::BackgroundCount) -CDAC_TYPE_FIELD(ThreadStore, /*int32*/, PendingCount, cdac_offsets::PendingCount) -CDAC_TYPE_FIELD(ThreadStore, /*int32*/, DeadCount, cdac_offsets::DeadCount) +CDAC_TYPE_FIELD(ThreadStore, /*SLink*/, FirstThreadLink, cdac_data::FirstThreadLink) +CDAC_TYPE_FIELD(ThreadStore, /*int32*/, ThreadCount, cdac_data::ThreadCount) +CDAC_TYPE_FIELD(ThreadStore, /*int32*/, UnstartedCount, cdac_data::UnstartedCount) +CDAC_TYPE_FIELD(ThreadStore, /*int32*/, BackgroundCount, cdac_data::BackgroundCount) +CDAC_TYPE_FIELD(ThreadStore, /*int32*/, PendingCount, cdac_data::PendingCount) +CDAC_TYPE_FIELD(ThreadStore, /*int32*/, DeadCount, cdac_data::DeadCount) CDAC_TYPE_END(ThreadStore) CDAC_TYPE_BEGIN(RuntimeThreadLocals) @@ -146,14 +146,14 @@ CDAC_TYPE_END(GCAllocContext) // Use exact managed type field names for the descriptor as field names often can't change due to binary serialization or implicit diagnostic contracts CDAC_TYPE_BEGIN(Exception) CDAC_TYPE_INDETERMINATE(Exception) -CDAC_TYPE_FIELD(Exception, /*pointer*/, _message, cdac_offsets::_message) -CDAC_TYPE_FIELD(Exception, /*pointer*/, _innerException, cdac_offsets::_innerException) -CDAC_TYPE_FIELD(Exception, /*pointer*/, _stackTrace, cdac_offsets::_stackTrace) -CDAC_TYPE_FIELD(Exception, /*pointer*/, _watsonBuckets, cdac_offsets::_watsonBuckets) -CDAC_TYPE_FIELD(Exception, /*pointer*/, _stackTraceString, cdac_offsets::_stackTraceString) -CDAC_TYPE_FIELD(Exception, /*pointer*/, _remoteStackTraceString, cdac_offsets::_remoteStackTraceString) -CDAC_TYPE_FIELD(Exception, /*int32*/, _HResult, cdac_offsets::_HResult) -CDAC_TYPE_FIELD(Exception, /*int32*/, _xcode, cdac_offsets::_xcode) +CDAC_TYPE_FIELD(Exception, /*pointer*/, _message, cdac_data::_message) +CDAC_TYPE_FIELD(Exception, /*pointer*/, _innerException, cdac_data::_innerException) +CDAC_TYPE_FIELD(Exception, /*pointer*/, _stackTrace, cdac_data::_stackTrace) +CDAC_TYPE_FIELD(Exception, /*pointer*/, _watsonBuckets, cdac_data::_watsonBuckets) +CDAC_TYPE_FIELD(Exception, /*pointer*/, _stackTraceString, cdac_data::_stackTraceString) +CDAC_TYPE_FIELD(Exception, /*pointer*/, _remoteStackTraceString, cdac_data::_remoteStackTraceString) +CDAC_TYPE_FIELD(Exception, /*int32*/, _HResult, cdac_data::_HResult) +CDAC_TYPE_FIELD(Exception, /*int32*/, _xcode, cdac_data::_xcode) CDAC_TYPE_END(Exception) CDAC_TYPE_BEGIN(ExceptionInfo) @@ -174,114 +174,114 @@ CDAC_TYPE_END(GCHandle) CDAC_TYPE_BEGIN(Object) CDAC_TYPE_INDETERMINATE(Object) -CDAC_TYPE_FIELD(Object, /*pointer*/, m_pMethTab, cdac_offsets::m_pMethTab) +CDAC_TYPE_FIELD(Object, /*pointer*/, m_pMethTab, cdac_data::m_pMethTab) CDAC_TYPE_END(Object) CDAC_TYPE_BEGIN(String) CDAC_TYPE_INDETERMINATE(String) -CDAC_TYPE_FIELD(String, /*pointer*/, m_FirstChar, cdac_offsets::m_FirstChar) -CDAC_TYPE_FIELD(String, /*uint32*/, m_StringLength, cdac_offsets::m_StringLength) +CDAC_TYPE_FIELD(String, /*pointer*/, m_FirstChar, cdac_data::m_FirstChar) +CDAC_TYPE_FIELD(String, /*uint32*/, m_StringLength, cdac_data::m_StringLength) CDAC_TYPE_END(String) CDAC_TYPE_BEGIN(Array) CDAC_TYPE_SIZE(sizeof(ArrayBase)) -CDAC_TYPE_FIELD(Array, /*pointer*/, m_NumComponents, cdac_offsets::m_NumComponents) +CDAC_TYPE_FIELD(Array, /*pointer*/, m_NumComponents, cdac_data::m_NumComponents) CDAC_TYPE_END(Array) // Loader CDAC_TYPE_BEGIN(Module) CDAC_TYPE_INDETERMINATE(Module) -CDAC_TYPE_FIELD(Module, /*pointer*/, Assembly, cdac_offsets::Assembly) -CDAC_TYPE_FIELD(Module, /*pointer*/, Base, cdac_offsets::Base) -CDAC_TYPE_FIELD(Module, /*pointer*/, Flags, cdac_offsets::Flags) -CDAC_TYPE_FIELD(Module, /*pointer*/, LoaderAllocator, cdac_offsets::LoaderAllocator) -CDAC_TYPE_FIELD(Module, /*pointer*/, ThunkHeap, cdac_offsets::ThunkHeap) -CDAC_TYPE_FIELD(Module, /*pointer*/, DynamicMetadata, cdac_offsets::DynamicMetadata) - -CDAC_TYPE_FIELD(Module, /*pointer*/, FieldDefToDescMap, cdac_offsets::FieldDefToDescMap) -CDAC_TYPE_FIELD(Module, /*pointer*/, ManifestModuleReferencesMap, cdac_offsets::ManifestModuleReferencesMap) -CDAC_TYPE_FIELD(Module, /*pointer*/, MemberRefToDescMap, cdac_offsets::MemberRefToDescMap) -CDAC_TYPE_FIELD(Module, /*pointer*/, MethodDefToDescMap, cdac_offsets::MethodDefToDescMap) -CDAC_TYPE_FIELD(Module, /*pointer*/, TypeDefToMethodTableMap, cdac_offsets::TypeDefToMethodTableMap) -CDAC_TYPE_FIELD(Module, /*pointer*/, TypeRefToMethodTableMap, cdac_offsets::TypeRefToMethodTableMap) +CDAC_TYPE_FIELD(Module, /*pointer*/, Assembly, cdac_data::Assembly) +CDAC_TYPE_FIELD(Module, /*pointer*/, Base, cdac_data::Base) +CDAC_TYPE_FIELD(Module, /*pointer*/, Flags, cdac_data::Flags) +CDAC_TYPE_FIELD(Module, /*pointer*/, LoaderAllocator, cdac_data::LoaderAllocator) +CDAC_TYPE_FIELD(Module, /*pointer*/, ThunkHeap, cdac_data::ThunkHeap) +CDAC_TYPE_FIELD(Module, /*pointer*/, DynamicMetadata, cdac_data::DynamicMetadata) + +CDAC_TYPE_FIELD(Module, /*pointer*/, FieldDefToDescMap, cdac_data::FieldDefToDescMap) +CDAC_TYPE_FIELD(Module, /*pointer*/, ManifestModuleReferencesMap, cdac_data::ManifestModuleReferencesMap) +CDAC_TYPE_FIELD(Module, /*pointer*/, MemberRefToDescMap, cdac_data::MemberRefToDescMap) +CDAC_TYPE_FIELD(Module, /*pointer*/, MethodDefToDescMap, cdac_data::MethodDefToDescMap) +CDAC_TYPE_FIELD(Module, /*pointer*/, TypeDefToMethodTableMap, cdac_data::TypeDefToMethodTableMap) +CDAC_TYPE_FIELD(Module, /*pointer*/, TypeRefToMethodTableMap, cdac_data::TypeRefToMethodTableMap) CDAC_TYPE_END(Module) // RuntimeTypeSystem CDAC_TYPE_BEGIN(MethodTable) CDAC_TYPE_INDETERMINATE(MethodTable) -CDAC_TYPE_FIELD(MethodTable, /*uint32*/, MTFlags, cdac_offsets::MTFlags) -CDAC_TYPE_FIELD(MethodTable, /*uint32*/, BaseSize, cdac_offsets::BaseSize) -CDAC_TYPE_FIELD(MethodTable, /*uint32*/, MTFlags2, cdac_offsets::MTFlags2) -CDAC_TYPE_FIELD(MethodTable, /*nuint*/, EEClassOrCanonMT, cdac_offsets::EEClassOrCanonMT) -CDAC_TYPE_FIELD(MethodTable, /*pointer*/, Module, cdac_offsets::Module) -CDAC_TYPE_FIELD(MethodTable, /*pointer*/, ParentMethodTable, cdac_offsets::ParentMethodTable) -CDAC_TYPE_FIELD(MethodTable, /*uint16*/, NumInterfaces, cdac_offsets::NumInterfaces) -CDAC_TYPE_FIELD(MethodTable, /*uint16*/, NumVirtuals, cdac_offsets::NumVirtuals) -CDAC_TYPE_FIELD(MethodTable, /*pointer*/, PerInstInfo, cdac_offsets::PerInstInfo) +CDAC_TYPE_FIELD(MethodTable, /*uint32*/, MTFlags, cdac_data::MTFlags) +CDAC_TYPE_FIELD(MethodTable, /*uint32*/, BaseSize, cdac_data::BaseSize) +CDAC_TYPE_FIELD(MethodTable, /*uint32*/, MTFlags2, cdac_data::MTFlags2) +CDAC_TYPE_FIELD(MethodTable, /*nuint*/, EEClassOrCanonMT, cdac_data::EEClassOrCanonMT) +CDAC_TYPE_FIELD(MethodTable, /*pointer*/, Module, cdac_data::Module) +CDAC_TYPE_FIELD(MethodTable, /*pointer*/, ParentMethodTable, cdac_data::ParentMethodTable) +CDAC_TYPE_FIELD(MethodTable, /*uint16*/, NumInterfaces, cdac_data::NumInterfaces) +CDAC_TYPE_FIELD(MethodTable, /*uint16*/, NumVirtuals, cdac_data::NumVirtuals) +CDAC_TYPE_FIELD(MethodTable, /*pointer*/, PerInstInfo, cdac_data::PerInstInfo) CDAC_TYPE_END(MethodTable) CDAC_TYPE_BEGIN(EEClass) CDAC_TYPE_INDETERMINATE(EEClass) -CDAC_TYPE_FIELD(EEClass, /*pointer*/, MethodTable, cdac_offsets::MethodTable) -CDAC_TYPE_FIELD(EEClass, /*uint16*/, NumMethods, cdac_offsets::NumMethods) -CDAC_TYPE_FIELD(EEClass, /*uint32*/, CorTypeAttr, cdac_offsets::CorTypeAttr) -CDAC_TYPE_FIELD(EEClass, /*uint8*/, InternalCorElementType, cdac_offsets::InternalCorElementType) -CDAC_TYPE_FIELD(EEClass, /*uint16*/, NumNonVirtualSlots, cdac_offsets::NumNonVirtualSlots) +CDAC_TYPE_FIELD(EEClass, /*pointer*/, MethodTable, cdac_data::MethodTable) +CDAC_TYPE_FIELD(EEClass, /*uint16*/, NumMethods, cdac_data::NumMethods) +CDAC_TYPE_FIELD(EEClass, /*uint32*/, CorTypeAttr, cdac_data::CorTypeAttr) +CDAC_TYPE_FIELD(EEClass, /*uint8*/, InternalCorElementType, cdac_data::InternalCorElementType) +CDAC_TYPE_FIELD(EEClass, /*uint16*/, NumNonVirtualSlots, cdac_data::NumNonVirtualSlots) CDAC_TYPE_END(EEClass) CDAC_TYPE_BEGIN(ArrayClass) CDAC_TYPE_INDETERMINATE(ArrayClass) -CDAC_TYPE_FIELD(ArrayClass, /*uint8*/, Rank, cdac_offsets::Rank) +CDAC_TYPE_FIELD(ArrayClass, /*uint8*/, Rank, cdac_data::Rank) CDAC_TYPE_END(ArrayClass) CDAC_TYPE_BEGIN(GenericsDictInfo) CDAC_TYPE_INDETERMINATE(GenericsDictInfo) -CDAC_TYPE_FIELD(GenericsDictInfo, /*uint16*/, NumTypeArgs, cdac_offsets::NumTypeArgs) +CDAC_TYPE_FIELD(GenericsDictInfo, /*uint16*/, NumTypeArgs, cdac_data::NumTypeArgs) CDAC_TYPE_END(GenericsDictInfo) CDAC_TYPE_BEGIN(TypeDesc) CDAC_TYPE_INDETERMINATE(TypeDesc) -CDAC_TYPE_FIELD(TypeDesc, /*uint32*/, TypeAndFlags, cdac_offsets::TypeAndFlags) +CDAC_TYPE_FIELD(TypeDesc, /*uint32*/, TypeAndFlags, cdac_data::TypeAndFlags) CDAC_TYPE_END(TypeDesc) CDAC_TYPE_BEGIN(ParamTypeDesc) CDAC_TYPE_INDETERMINATE(ParamTypeDesc) -CDAC_TYPE_FIELD(ParamTypeDesc, /*pointer*/, TypeArg, cdac_offsets::TypeArg) +CDAC_TYPE_FIELD(ParamTypeDesc, /*pointer*/, TypeArg, cdac_data::TypeArg) CDAC_TYPE_END(ParamTypeDesc) CDAC_TYPE_BEGIN(TypeVarTypeDesc) CDAC_TYPE_INDETERMINATE(TypeVarTypeDesc) -CDAC_TYPE_FIELD(TypeVarTypeDesc, /*pointer*/, Module, cdac_offsets::Module) -CDAC_TYPE_FIELD(TypeVarTypeDesc, /*uint32*/, Token, cdac_offsets::Token) +CDAC_TYPE_FIELD(TypeVarTypeDesc, /*pointer*/, Module, cdac_data::Module) +CDAC_TYPE_FIELD(TypeVarTypeDesc, /*uint32*/, Token, cdac_data::Token) CDAC_TYPE_END(TypeVarTypeDesc) CDAC_TYPE_BEGIN(FnPtrTypeDesc) CDAC_TYPE_INDETERMINATE(FnPtrTypeDesc) -CDAC_TYPE_FIELD(FnPtrTypeDesc, /*uint32*/, NumArgs, cdac_offsets::NumArgs) -CDAC_TYPE_FIELD(FnPtrTypeDesc, /*uint32*/, CallConv, cdac_offsets::CallConv) -CDAC_TYPE_FIELD(FnPtrTypeDesc, /*uint32*/, RetAndArgTypes, cdac_offsets::RetAndArgTypes) +CDAC_TYPE_FIELD(FnPtrTypeDesc, /*uint32*/, NumArgs, cdac_data::NumArgs) +CDAC_TYPE_FIELD(FnPtrTypeDesc, /*uint32*/, CallConv, cdac_data::CallConv) +CDAC_TYPE_FIELD(FnPtrTypeDesc, /*uint32*/, RetAndArgTypes, cdac_data::RetAndArgTypes) CDAC_TYPE_END(FnPtrTypeDesc) CDAC_TYPE_BEGIN(DynamicMetadata) -CDAC_TYPE_FIELD(DynamicMetadata, /*uint32*/, Size, cdac_offsets::Size) -CDAC_TYPE_FIELD(DynamicMetadata, /*inline byte array*/, Data, cdac_offsets::Data) +CDAC_TYPE_FIELD(DynamicMetadata, /*uint32*/, Size, cdac_data::Size) +CDAC_TYPE_FIELD(DynamicMetadata, /*inline byte array*/, Data, cdac_data::Data) CDAC_TYPE_END(DynamicMetadata) CDAC_TYPE_BEGIN(MethodDesc) CDAC_TYPE_INDETERMINATE(MethodDesc) -CDAC_TYPE_FIELD(MethodDesc, /*uint8*/, ChunkIndex, cdac_offsets::ChunkIndex) -CDAC_TYPE_FIELD(MethodDesc, /*uint16*/, Slot, cdac_offsets::Slot) -CDAC_TYPE_FIELD(MethodDesc, /*uint16*/, Flags, cdac_offsets::Flags) +CDAC_TYPE_FIELD(MethodDesc, /*uint8*/, ChunkIndex, cdac_data::ChunkIndex) +CDAC_TYPE_FIELD(MethodDesc, /*uint16*/, Slot, cdac_data::Slot) +CDAC_TYPE_FIELD(MethodDesc, /*uint16*/, Flags, cdac_data::Flags) CDAC_TYPE_END(MethodDesc) CDAC_TYPE_BEGIN(MethodDescChunk) CDAC_TYPE_SIZE(sizeof(MethodDescChunk)) -CDAC_TYPE_FIELD(MethodDescChunk, /*pointer*/, MethodTable, cdac_offsets::MethodTable) -CDAC_TYPE_FIELD(MethodDescChunk, /*pointer*/, Next, cdac_offsets::Next) -CDAC_TYPE_FIELD(MethodDescChunk, /*uint8*/, Size, cdac_offsets::Size) -CDAC_TYPE_FIELD(MethodDescChunk, /*uint8*/, Count, cdac_offsets::Count) +CDAC_TYPE_FIELD(MethodDescChunk, /*pointer*/, MethodTable, cdac_data::MethodTable) +CDAC_TYPE_FIELD(MethodDescChunk, /*pointer*/, Next, cdac_data::Next) +CDAC_TYPE_FIELD(MethodDescChunk, /*uint8*/, Size, cdac_data::Size) +CDAC_TYPE_FIELD(MethodDescChunk, /*uint8*/, Count, cdac_data::Count) CDAC_TYPE_END(MethodDescChunk) CDAC_TYPES_END() @@ -310,7 +310,7 @@ CDAC_GLOBAL(ObjectToMethodTableUnmask, uint8, 1 | 1 << 1) CDAC_GLOBAL(SOSBreakingChangeVersion, uint8, SOS_BREAKING_CHANGE_VERSION) CDAC_GLOBAL(MethodDescAlignment, uint64, MethodDesc::ALIGNMENT) CDAC_GLOBAL(ObjectHeaderSize, uint64, OBJHEADER_SIZE) -CDAC_GLOBAL_POINTER(ArrayBoundsZero, cdac_offsets::s_arrayBoundsZero) +CDAC_GLOBAL_POINTER(ArrayBoundsZero, cdac_data::ArrayBoundsZero) CDAC_GLOBAL_POINTER(ExceptionMethodTable, &::g_pExceptionClass) CDAC_GLOBAL_POINTER(FreeObjectMethodTable, &::g_pFreeObjectMethodTable) CDAC_GLOBAL_POINTER(ObjectMethodTable, &::g_pObjectClass) diff --git a/src/coreclr/inc/slist.h b/src/coreclr/inc/slist.h index e48a078adda5d..ebd892b1882a9 100644 --- a/src/coreclr/inc/slist.h +++ b/src/coreclr/inc/slist.h @@ -26,7 +26,7 @@ #ifndef _H_SLIST_ #define _H_SLIST_ -#include "cdacoffsets.h" +#include "cdacdata.h" //------------------------------------------------------------------ // struct SLink, to use a singly linked list @@ -120,7 +120,7 @@ class SList PTR_SLink m_pHead; PTR_SLink m_pTail; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; // get the list node within the object static SLink* GetLink (T* pLink) diff --git a/src/coreclr/vm/CMakeLists.txt b/src/coreclr/vm/CMakeLists.txt index cd68323da7700..203820d14fd70 100644 --- a/src/coreclr/vm/CMakeLists.txt +++ b/src/coreclr/vm/CMakeLists.txt @@ -391,7 +391,7 @@ set(VM_HEADERS_WKS callhelpers.h callsiteinspect.h callconvbuilder.hpp - cdacoffsets.h + cdacdata.h ceemain.h clrconfignative.h clrex.h diff --git a/src/coreclr/vm/cdacdata.h b/src/coreclr/vm/cdacdata.h new file mode 100644 index 0000000000000..e8bd2c6f2cb69 --- /dev/null +++ b/src/coreclr/vm/cdacdata.h @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef CDACDATA_H__ +#define CDACDATA_H__ + +// See datadescriptor.h +// +// This struct enables exposing information that is private to a class to the cDAC. For example, +// if class C has private information that must be provided, declare cdac_data as a friend: +// +// template friend struct ::cdac_data; +// +// and provide a specialization cdac_data with constexpr members exposing the information. +// For example, if the offset of field F is required: +// +// template<> struct cdac_data { +// static constexpr size_t F_Offset = offsetof(C, F); +// }; +template +struct cdac_data +{ +}; + +#endif// CDACDATA_H__ diff --git a/src/coreclr/vm/cdacoffsets.h b/src/coreclr/vm/cdacoffsets.h deleted file mode 100644 index 38c5b316c4244..0000000000000 --- a/src/coreclr/vm/cdacoffsets.h +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef CDACOFFSETS_H__ -#define CDACOFFSETS_H__ - -// See data-descriptor.h -// -// If the offset of some field F in class C must be provided to cDAC, but the field is private, the -// class C should declare cdac_offsets as a friend: -// -// template friend struct ::cdac_offsets; -// -// and provide a specialization cdac_offsets with a constexpr size_t member providing the offset: -// -// template<> struct cdac_offsets { -// static constexpr size_t F_Offset = offsetof(C, F); -// }; -template -struct cdac_offsets -{ -}; - -#endif// CDACOFFSETS_H__ diff --git a/src/coreclr/vm/ceeload.h b/src/coreclr/vm/ceeload.h index 9bcae6e145d84..7fb76e81a4979 100644 --- a/src/coreclr/vm/ceeload.h +++ b/src/coreclr/vm/ceeload.h @@ -95,11 +95,11 @@ struct DynamicMetadata { uint32_t Size; BYTE Data[0]; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t Size = offsetof(DynamicMetadata, Size); static constexpr size_t Data = offsetof(DynamicMetadata, Data); @@ -1629,11 +1629,11 @@ class Module : public ModuleBase uint32_t GetNativeMetadataAssemblyCount(); #endif // !defined(DACCESS_COMPILE) - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t Assembly = offsetof(Module, m_pAssembly); static constexpr size_t Base = offsetof(Module, m_baseAddress); diff --git a/src/coreclr/vm/class.h b/src/coreclr/vm/class.h index 260abc08fa6fa..3d936b7bf69af 100644 --- a/src/coreclr/vm/class.h +++ b/src/coreclr/vm/class.h @@ -1798,10 +1798,10 @@ class EEClass // DO NOT CREATE A NEW EEClass USING NEW! } #endif // !DACCESS_COMPILE - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; -template<> struct cdac_offsets +template<> struct cdac_data { static constexpr size_t InternalCorElementType = offsetof(EEClass, m_NormType); static constexpr size_t MethodTable = offsetof(EEClass, m_pMethodTable); @@ -1997,10 +1997,10 @@ class ArrayClass : public EEClass BOOL fForStubAsIL ); - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; -template<> struct cdac_offsets +template<> struct cdac_data { static constexpr size_t Rank = offsetof(ArrayClass, m_rank); }; diff --git a/src/coreclr/vm/exstate.h b/src/coreclr/vm/exstate.h index 14ef9ee3b0e78..3d57a935b65d9 100644 --- a/src/coreclr/vm/exstate.h +++ b/src/coreclr/vm/exstate.h @@ -12,7 +12,7 @@ class DebuggerExState; class EHClauseInfo; #include "exceptionhandling.h" -#include "cdacoffsets.h" +#include "cdacdata.h" #if !defined(FEATURE_EH_FUNCLETS) // ExInfo contains definitions for 32bit @@ -51,7 +51,7 @@ class ThreadExceptionState // ExceptionTracker or the ExInfo as appropriate for the platform friend class ProfToEEInterfaceImpl; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; #ifdef FEATURE_EH_FUNCLETS friend class ExceptionTracker; diff --git a/src/coreclr/vm/method.hpp b/src/coreclr/vm/method.hpp index 320565b39d01c..628eb39864b7e 100644 --- a/src/coreclr/vm/method.hpp +++ b/src/coreclr/vm/method.hpp @@ -253,7 +253,7 @@ class MethodDesc pamTracker = NULL; } - // If EnsureTemporaryEntryPointCore is called, then + // If EnsureTemporaryEntryPointCore is called, then // both GetTemporaryEntryPointIfExists and GetSlot() // are guaranteed to return a NON-NULL PCODE. EnsureTemporaryEntryPointCore(pamTracker); @@ -316,7 +316,7 @@ class MethodDesc Precode* GetOrCreatePrecode(); void MarkPrecodeAsStableEntrypoint(); - + // Given a code address return back the MethodDesc whenever possible // @@ -1909,10 +1909,10 @@ class MethodDesc static void Init(); #endif - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; -template<> struct cdac_offsets +template<> struct cdac_data { static constexpr size_t ChunkIndex = offsetof(MethodDesc, m_chunkIndex); static constexpr size_t Slot = offsetof(MethodDesc, m_wSlotNumber); @@ -2338,11 +2338,11 @@ class MethodDescChunk // Followed by array of method descs... - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t MethodTable = offsetof(MethodDescChunk, m_methodTable); static constexpr size_t Next = offsetof(MethodDescChunk, m_next); diff --git a/src/coreclr/vm/methodtable.h b/src/coreclr/vm/methodtable.h index 48d27b3e54430..0fedd53ef4c73 100644 --- a/src/coreclr/vm/methodtable.h +++ b/src/coreclr/vm/methodtable.h @@ -293,12 +293,12 @@ struct GenericsDictInfo // Number of type parameters (NOT including those of superclasses). WORD m_wNumTyPars; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; // struct GenericsDictInfo typedef DPTR(GenericsDictInfo) PTR_GenericsDictInfo; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t NumTypeArgs = offsetof(GenericsDictInfo, m_wNumTyPars); }; @@ -4029,10 +4029,10 @@ public : static void GetStaticsOffsets(StaticsOffsetType staticsOffsetType, bool fGenericsStatics, uint32_t *dwGCOffset, uint32_t *dwNonGCOffset); - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; // class MethodTable -template<> struct cdac_offsets +template<> struct cdac_data { static constexpr size_t MTFlags = offsetof(MethodTable, m_dwFlags); static constexpr size_t BaseSize = offsetof(MethodTable, m_BaseSize); diff --git a/src/coreclr/vm/object.h b/src/coreclr/vm/object.h index 641af78dcd13a..61b7a23a6cd7d 100644 --- a/src/coreclr/vm/object.h +++ b/src/coreclr/vm/object.h @@ -463,11 +463,11 @@ class Object private: VOID ValidateInner(BOOL bDeep, BOOL bVerifyNextHeader, BOOL bVerifySyncBlock); - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t m_pMethTab = offsetof(Object, m_pMethTab); }; @@ -639,16 +639,16 @@ class ArrayBase : public Object inline static unsigned GetBoundsOffset(MethodTable* pMT); inline static unsigned GetLowerBoundsOffset(MethodTable* pMT); - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; #ifndef DACCESS_COMPILE template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t m_NumComponents = offsetof(ArrayBase, m_NumComponents); - static constexpr INT32* s_arrayBoundsZero = &ArrayBase::s_arrayBoundsZero; + static constexpr INT32* ArrayBoundsZero = &ArrayBase::s_arrayBoundsZero; }; #endif @@ -951,11 +951,11 @@ class StringObject : public Object static STRINGREF* EmptyStringRefPtr; static bool EmptyStringIsFrozen; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t m_FirstChar = offsetof(StringObject, m_FirstChar); static constexpr size_t m_StringLength = offsetof(StringObject, m_StringLength); @@ -2385,11 +2385,11 @@ class ExceptionObject : public Object INT32 _xcode; INT32 _HResult; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t _message = offsetof(ExceptionObject, _message); static constexpr size_t _innerException = offsetof(ExceptionObject, _innerException); diff --git a/src/coreclr/vm/threads.h b/src/coreclr/vm/threads.h index 2e368864ee723..34a6379f1f3b1 100644 --- a/src/coreclr/vm/threads.h +++ b/src/coreclr/vm/threads.h @@ -121,7 +121,7 @@ #include "gchandleutilities.h" #include "gcinfotypes.h" #include -#include "cdacoffsets.h" +#include "cdacdata.h" class Thread; class ThreadStore; @@ -3966,11 +3966,11 @@ class Thread private: bool m_hasPendingActivation; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t Id = offsetof(Thread, m_ThreadId); static constexpr size_t OSId = offsetof(Thread, m_OSThreadId); @@ -4248,11 +4248,11 @@ class ThreadStore bool ShouldTriggerGCForDeadThreads(); void TriggerGCForDeadThreadsIfNecessary(); - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t FirstThreadLink = offsetof(ThreadStore, m_ThreadList) + offsetof(ThreadList, m_link); static constexpr size_t ThreadCount = offsetof(ThreadStore, m_ThreadCount); diff --git a/src/coreclr/vm/typedesc.h b/src/coreclr/vm/typedesc.h index 2518f86d5adaf..3932b07d3db01 100644 --- a/src/coreclr/vm/typedesc.h +++ b/src/coreclr/vm/typedesc.h @@ -204,11 +204,11 @@ class TypeDesc // internal RuntimeType object handle RUNTIMETYPEHANDLE m_hExposedClassObject; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t TypeAndFlags = offsetof(TypeDesc, m_typeAndFlags); }; @@ -269,11 +269,11 @@ class ParamTypeDesc : public TypeDesc { // The type that is being modified TypeHandle m_Arg; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t TypeArg = offsetof(ParamTypeDesc, m_Arg); }; @@ -395,11 +395,11 @@ class TypeVarTypeDesc : public TypeDesc // index within declaring type or method, numbered from zero unsigned int m_index; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t Module = offsetof(TypeVarTypeDesc, m_pModule); static constexpr size_t Token = offsetof(TypeVarTypeDesc, m_token); @@ -490,11 +490,11 @@ class FnPtrTypeDesc : public TypeDesc // Return type first, then argument types TypeHandle m_RetAndArgTypes[1]; - template friend struct ::cdac_offsets; + template friend struct ::cdac_data; }; // class FnPtrTypeDesc template<> -struct cdac_offsets +struct cdac_data { static constexpr size_t NumArgs = offsetof(FnPtrTypeDesc, m_NumArgs); static constexpr size_t RetAndArgTypes = offsetof(FnPtrTypeDesc, m_RetAndArgTypes);