Skip to content
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

Open
15 of 21 tasks
Tracked by #99298
lambdageek opened this issue Mar 5, 2024 · 2 comments
Open
15 of 21 tasks
Tracked by #99298

[cdac] Implement !PrintException #99302

lambdageek opened this issue Mar 5, 2024 · 2 comments
Assignees
Labels
area-Diagnostics-coreclr enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@lambdageek
Copy link
Member

lambdageek commented Mar 5, 2024

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

  • Module name fallback if debugger and GetPEFileName() can't get the name
  • ISOSDacInterface::GetModule()
  • IXCLRDataModule::GetFileName()

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:

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 5, 2024
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 5, 2024
@ghost
Copy link

ghost commented Mar 5, 2024

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: lambdageek
Assignees: -
Labels:

area-Diagnostics-coreclr, untriaged, needs-area-label

Milestone: -

@lambdageek lambdageek added this to the 9.0.0 milestone Mar 5, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Mar 5, 2024
@lambdageek lambdageek removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 5, 2024
@tommcdon tommcdon added the enhancement Product code improvement that does NOT require public API changes/additions label Mar 11, 2024
@lambdageek
Copy link
Member Author

lambdageek commented Jun 28, 2024

DAC interfaces used by CLRMA https://github.com/mikem8361/diagnostics/blob/clrma/documentation/clrma.md#dac-interfaces-used-by-clrma

Managed stack walking:

  • IXCLRDataProcess::GetTaskByOSThreadID()
  • IXCLRDataTask::CreateStackWalk()
  • IXCLRDataStackWalk::Request(DACSTACKPRIV_REQUEST_FRAME_DATA, ...)
  • IXCLRDataStackWalk::GetContext()
  • IXCLRDataStackWalk::Next()

The stack walker is only used in the fallback case for hang dumps. Crash dumps are the most important

davidwrighton added a commit that referenced this issue Jul 17, 2024
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
@tommcdon tommcdon modified the milestones: 9.0.0, 10.0.0 Jul 23, 2024
davidwrighton added a commit that referenced this issue Aug 13, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Diagnostics-coreclr enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

3 participants