-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cdac] Implement !PrintException
#99302
Comments
Tagging subscribers to this area: @tommcdon Issue Detailsnull
|
DAC interfaces used by CLRMA https://github.com/mikem8361/diagnostics/blob/clrma/documentation/clrma.md#dac-interfaces-used-by-clrma Managed stack walking:
|
Add new details to the RuntimeTypeSystem and Loader contracts as needed to load metadata and examine and identify all of the kinds of type that the CoreCLR type system can represent Add a type name generator based on a line by line copy from the CoreCLR codebase Add an Ecma335 metadata parser which is pure safe managed code, and is capable of loading metadata that is not structured as a single array. This implementation is heavily based on the dnmd implementation. It is intended that this implementation is short-lived, and really ought to be replaced by dnmd or System.Reflection.Metadata when those apis become suitable for use in this scenario. Provide implementations and documentation for all of the new contracts except for the RW metadata one. (Its rarely needed, so we can add it later) Enhance the target infrastructure to better handle various forms of arrays, and contracts which do math based on target pointer sizes. Contributes to #99302
Add a number of new `MethodDesc` contract definitions | Contract algorithm on RuntimeTypeSystem | | --- | | `IsGenericMethodDefinition`| |`GetGenericMethodInstantiation`| |`GetMethodToken`| |`IsArrayMethod`| |`IsDynamicMethod`| |`IsStoredSigMethodDesc`| |`IsNoMetadataMethod`| |`IsILStub`| Update cDAC compat asserts in cDAC to always be enabled by using a tls variable in `mscordaccore` Implement `GetMethodDescName` on `ISOSDacInterface` in the `cdacreader` Stub out an implementation of `GetPath` in the `Loader` contract used in a fallback after a fallback. This will need further work, but is included to make sure the code path isn't lost. Fix the `EcmaMetadataReader` to be able to find blobs in the metadata Add ability to read target data from a buffer held on the cdac side using the `Target` class. This was needed to handle signature containing a `CorElementType.Internal`. And finally actually implement the name generation algorithm via a line for line port from the CoreCLR codebase. Contributes to #99302
The CodeVersions contract implements the IL and native code versioning as described in [code-versioning.md](docs/design/features/code-versioning.md) Contributes to dotnet#108553 Contributes to dotnet#99302 * rename contract NativeCodePointers => CodeVersions * FindActiveILCodeVersion * implement GetModuleLookupMapElement * FindActiveILCodeVersion/FindActiveNativeCodeVersion * il code version lookup table * remove AppDomain.CodeVersionManager from cdac * CodeVersionManager is basically a static class in the C++ side * NativeCodeVersionContract.GetSpecificNativeCodeVersion * checkpoint: start adding NativeCodeVersion operations * WIP: native code version
* [cdac] Add a CodeVersions contract The CodeVersions contract implements the IL and native code versioning as described in [code-versioning.md](docs/design/features/code-versioning.md) Contributes to #108553 Contributes to #99302 * rename contract NativeCodePointers => CodeVersions * FindActiveILCodeVersion * implement GetModuleLookupMapElement * FindActiveILCodeVersion/FindActiveNativeCodeVersion * il code version lookup table * remove AppDomain.CodeVersionManager from cdac * CodeVersionManager is basically a static class in the C++ side * NativeCodeVersionContract.GetSpecificNativeCodeVersion * checkpoint: start adding NativeCodeVersion operations * WIP: native code version * tighter cdac_data friends * remove unused DataType values they'll come in from a future PR * move ecma metadata helpers to their own class * WIP: CodeVersionsTests * WIP: TestGetNativeCodeVersionOneVersionVersionable * implement GetNativeCode for a NativeCodeVersionNode handle * checkpoint: TestGetNativeCodeVersionOneVersionVersionable passes * Add TestGetActiveNativeCodeVersionDefaultCase * don't add ILCodeVersioningState::Next field yet * describe Loader::GetModuleLookupMapElement contract * remove unused member * update contract markdown * simplify flags handling a bit * add TODOs for RuntimeTypeSystem additions
Adds a `PrecodeStubs` contract for working with precode. Adds a `CDacMetadata` contract for exposing useful platform-specific properties Contributes to #99302 Contributes to #108553 * [cdac] PrecodeStubs contract * move PrecodeStubs to a separate contract * remove instance field initialization from PrecodeMachineDescriptor * PrecodeMachineDescriptor::Init() will initialize g_PrecodeMachineDescriptor * fix thumb flag logic * add FixupPrecodeData * checkpoint: StubPrecodeData, StubCodePageSize * checkpoint: PrecodeMachineDescriptor and KnownPrecodeType * WIP: start adding PrecodeStubs test infrastructure * checkpoint: stub precode test passing * set the "thumb" bit * cleanup thumb bit * add a CDacMetadata struct * permute PrecodeMachineDescriptor fields for better packability * reader for CDacMetadata contract * WIP: code pointer flags * checkpoint tests with CDacMetadata * rename CDacMetadata -> PlatformMetadata * add a define for Loongarch64 stub precode shift * conditionally define fields for precode absent precode types * clarify how stub and pinvoke precodes work --------- Co-authored-by: Elinor Fung <elfung@microsoft.com>
This is enough for `!PrintException` without R2R methods on the stack There's also a `ReJIT` contract here which just checks whether rejit is enabled. Most of the complexity is in validating MethodDescs Contributes to #99302 Contributes to #108553 --- * ReJIT contract * document the ExecutionManager methods * cache EECodeInfo based on given code pointer, not start of the method The EECodeInfo includes the relative offset (given ip - start of method) so it's not ok to share for different code pointers into the same method * add legacy DAC comparison for GetMethodDescData * add documentation to managed contract impl * add TODOs for RuntimeTypeSystem additions * update contract markdown * get collectible flag for module from Assembly instead of LoaderAllocator * Use CodePointerFlags in RuntimeTypeSystem * implement MethodDesc GetLoaderModule via the loader module attached to a chunk * implement MethodTable GetLoaderModule * add MethodTable.AuxiliaryData field to test typeinfo * implement vtable indirections * fixup: GetVtableIndirections - add MethodTable size to data descriptor * rename some vestigial CDacMetadata references * WIP: MethodDesc tests * checkpoint GetMethodToken test passes * move MethodValidation to a separate class also move method flags out of the RuntimeTypeSystem_1 contract for the cases where the method validation needs to call back to type validation, go via the contract * move COR_PRF_MONITOR into ReJIT_1 it's an implementation detail * Update src/native/managed/cdacreader/src/Legacy/SOSDacImpl.cs Co-authored-by: Aaron Robinson <arobins@microsoft.com> * assert the expected slot number * Exercise a few more easy properties of MethodDesc * remove TypeHandleFromAddress from contract we just use GetTypeHandle now * clean up MethodClassification -> size lookups * document RuntimeTypeSystem contract additions * update the CodeVersions contract to match implementation * remove some TODO comments * add sizes for method desc subclasses the "additional pointers" logic in RuntimeTypeSystem_1 depends on the sizes --------- Co-authored-by: Elinor Fung <elfung@microsoft.com> Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Part of #99298
This will require bringing up a basic data stream reader and registering enough data types and instances in the runtime so that we can get at the exception.
.NET 10
ISOSDacInterface9::GetBreakingChangeVersion
([cdac] Read/store globals from contract descriptor #101450)ISOSDacInterface::GetThreadStoreData()
([cdac] Implement GetThreadStoreData in cDAC #102404)ISOSDacInterface::GetThreadData()
([cdac] Implement ISOSDacInterface.GetThreadData #103324)ISOSDacInterface::GetNestedExceptionData()
([cdac] Implement ISOSDacInterface::GetNestedExceptionData #103668)PEAssembly
in the SOS DAC APIs - return/consume (including inDacpModuleData
) pointers to aModule
instead, and avoid exposing PEAssembly in the cDAC contracts. (Make DAC return Module instead of PEAssembly for DacpModuleData::PEAssembly #103821, Remove printing of DacpModuleData::PEAssembly from DumpModule command diagnostics#4751)ISOSDacInterface::GetMethodTableData()
([cdac] start of RuntimeTypeSystem contract; implement GetMethodTableData SOS method #103444)ISOSDacInterface::GetModuleData()
([cdac] Start Loader contract and implement ISOSDacInterface::GetModuleData in cDAC #104257)ISOSDacInterface2::GetObjectExceptionData()
(* This is where the stack trace comes from - uses the stack trace array on the exception object) ([cdac] Implement ISOSDacInterface2::GetObjectExceptionData #104343)ISOSDacInterface::GetObjectData()
ISOSDacInterface::GetObjectStringData()
([cdac] Implement GetObjectStringData #105061)ISOSDacInterface::GetMethodDescData()
ISOSDacInterface::GetMethodTableName()
- big, traverses a lot of metadata (cDac work necessary to get the MethodTableName #104759)ISOSDacInterface::GetMethodDescName()
- big, traverses a lot of metadata (Implementation of SOSDacApi GetMethodDescName for cDAC #106169)ISOSDacInterface::GetPEFileName()
Module
for easier diagnostics #106103ISOSDacInterface::GetUsefulGlobals()
([cdac] Implement ISOSDacInterface::GetUsefulGlobals #105106)ISOSDacInterface::GetModule()
([cdac] ImplementISOSDacInterface::GetModule
andIXCLRDataModule::GetFileName
#109133)IXCLRDataModule::GetFileName()
([cdac] ImplementISOSDacInterface::GetModule
andIXCLRDataModule::GetFileName
#109133)Additionally see sos_printexception_walkthrough.md#exception-informaiton for a walkthrough of the relationship of these interfaces to what SOS is doing
For CLRMA, we will need a few additional methods:
https://github.com/dotnet/diagnostics/blob/main/documentation/clrma.md#dac-interfaces-used-by-clrma
.NET 9
We maintain a branch
feature/9.0-cdac-backports
that has selected data descriptor and contract changes necessary for the cdacreader to interrogate a net9.0 runtime. The backports to this branch include:Replaces
[cdac][.NET9] Data descriptor changes for GetMethodDescData #106417The text was updated successfully, but these errors were encountered: