-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[cdac] break up cdacreader into 4 separate assemblies #108156
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
089dfe2
[cdac] break up cdacreader into 4 separate assemblies
lambdageek c283b13
rename the contract factories using libraries naming convention
lambdageek cc3a4f1
removed unused usings
lambdageek 4a5cd7a
fixup mock
lambdageek 18e9d00
document all ITarget members
lambdageek ba9d83a
rename Registry -> ContractRegistry
lambdageek 87d026a
change ITarget -> AbstractTarget
lambdageek 0f2130d
change IContractRegistry -> AbstractContractRegistry
lambdageek 9b937bc
rename Target -> ContractDescriptorTarget; AbstractTarget -> Target
lambdageek fd83148
fixup: rename the .cs file too
lambdageek 6a45fba
Add ReadTargetPointerFromSpan to abstract Target
lambdageek bd64632
change SOSDacImpl to depend on the abstract Target
lambdageek ff762e0
Remove a few move concrete Target dependencies
lambdageek 75dfc46
rename ContractRegistry -> CachingContractRegistry; AbstractContractR…
lambdageek 15ef960
revert unnecesasry change
lambdageek 1ad195b
fixup filenames and namespaces
lambdageek f0700c2
Merge remote-tracking branch 'origin/main' into cdac-abstractions2
lambdageek 32d956b
Merge remote-tracking branch 'origin/main' into cdac-abstractions2
lambdageek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...aged/cdacreader/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Microsoft.Diagnostics.DataContractReader.Contracts; | ||
|
|
||
|
|
||
| namespace Microsoft.Diagnostics.DataContractReader; | ||
|
|
||
| /// <summary> | ||
| /// A registry of all the contracts that may be provided by a target. | ||
| /// </summary> | ||
| internal abstract class ContractRegistry | ||
| { | ||
| /// <summary> | ||
| /// Gets an instance of the Exception contract for the target. | ||
| /// </summary> | ||
| public abstract IException Exception { get;} | ||
| /// <summary> | ||
| /// Gets an instance of the Loader contract for the target. | ||
| /// </summary> | ||
| public abstract ILoader Loader { get; } | ||
| /// <summary> | ||
| /// Gets an instance of the EcmaMetadata contract for the target. | ||
| /// </summary> | ||
| public abstract IEcmaMetadata EcmaMetadata { get; } | ||
| /// <summary> | ||
| /// Gets an instance of the Object contract for the target. | ||
| /// </summary> | ||
| public abstract IObject Object { get; } | ||
| /// <summary> | ||
| /// Gets an instance of the Thread contract for the target. | ||
| /// </summary> | ||
| public abstract IThread Thread { get; } | ||
| /// <summary> | ||
| /// Gets an instance of the RuntimeTypeSystem contract for the target. | ||
| /// </summary> | ||
| public abstract IRuntimeTypeSystem RuntimeTypeSystem { get; } | ||
| /// <summary> | ||
| /// Gets an instance of the DacStreams contract for the target. | ||
| /// </summary> | ||
| public abstract IDacStreams DacStreams { get; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 1 addition & 14 deletions
15
...ed/cdacreader/src/Contracts/DacStreams.cs → ...der.Abstractions/Contracts/IDacStreams.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...ged/cdacreader/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IThread.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System; | ||
|
|
||
| namespace Microsoft.Diagnostics.DataContractReader.Contracts; | ||
|
|
||
| internal record struct ThreadStoreData( | ||
|
lambdageek marked this conversation as resolved.
|
||
| int ThreadCount, | ||
| TargetPointer FirstThread, | ||
| TargetPointer FinalizerThread, | ||
| TargetPointer GCThread); | ||
|
|
||
| internal record struct ThreadStoreCounts( | ||
| int UnstartedThreadCount, | ||
| int BackgroundThreadCount, | ||
| int PendingThreadCount, | ||
| int DeadThreadCount); | ||
|
|
||
| [Flags] | ||
| internal enum ThreadState | ||
| { | ||
| Unknown = 0x00000000, | ||
| Hijacked = 0x00000080, // Return address has been hijacked | ||
| Background = 0x00000200, // Thread is a background thread | ||
| Unstarted = 0x00000400, // Thread has never been started | ||
| Dead = 0x00000800, // Thread is dead | ||
| ThreadPoolWorker = 0x01000000, // Thread is a thread pool worker thread | ||
| } | ||
|
|
||
| internal record struct ThreadData( | ||
| uint Id, | ||
| TargetNUInt OSId, | ||
| ThreadState State, | ||
| bool PreemptiveGCDisabled, | ||
| TargetPointer AllocContextPointer, | ||
| TargetPointer AllocContextLimit, | ||
| TargetPointer Frame, | ||
| TargetPointer FirstNestedException, | ||
| TargetPointer TEB, | ||
| TargetPointer LastThrownObjectHandle, | ||
| TargetPointer NextThread); | ||
|
|
||
| internal interface IThread : IContract | ||
| { | ||
| static string IContract.Name { get; } = nameof(Thread); | ||
|
|
||
| public virtual ThreadStoreData GetThreadStoreData() => throw new NotImplementedException(); | ||
| public virtual ThreadStoreCounts GetThreadCounts() => throw new NotImplementedException(); | ||
| public virtual ThreadData GetThreadData(TargetPointer thread) => throw new NotImplementedException(); | ||
| } | ||
|
|
||
| internal readonly struct Thread : IThread | ||
| { | ||
| // Everything throws NotImplementedException | ||
| } | ||
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
...aged/cdacreader/Microsoft.Diagnostics.DataContractReader.Abstractions/IContractFactory.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System; | ||
|
|
||
| namespace Microsoft.Diagnostics.DataContractReader; | ||
|
|
||
| internal interface IContractFactory<out TContract> where TContract : Contracts.IContract | ||
| { | ||
| TContract CreateContract(Target target, int version); | ||
| } |
21 changes: 21 additions & 0 deletions
21
...aContractReader.Abstractions/Microsoft.Diagnostics.DataContractReader.Abstractions.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework> | ||
| <RootNamespace>Microsoft.Diagnostics.DataContractReader</RootNamespace> | ||
| <Nullable>enable</Nullable> | ||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
| <!-- Do not produce a public package. This ships as part of the runtime --> | ||
| <IsShippingPackage>false</IsShippingPackage> | ||
| <InvariantGlobalization>true</InvariantGlobalization> | ||
| <JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <InternalsVisibleTo Include="Microsoft.Diagnostics.DataContractReader.Tests" /> | ||
| <InternalsVisibleTo Include="Microsoft.Diagnostics.DataContractReader.Contracts" /> | ||
| <InternalsVisibleTo Include="Microsoft.Diagnostics.DataContractReader" /> | ||
| <InternalsVisibleTo Include="cdacreader" Condition="'$(TargetsWindows)' == 'true'"/> | ||
| <InternalsVisibleTo Include="libcdacreader" Condition="'$(TargetsWindows)' != 'true'"/> | ||
| </ItemGroup> | ||
| </Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.