-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cdac] Implement ISOSDacInterface::GetObjectData getting COM RCW/CCW (#…
…105846) - Add `SyncTableEntry`, `SyncBlock`, `InteropSyncBlockInfo` data descriptors, `SyncTableEntries` global - Get the sync block corresponding to a given object address in `Object` contract - Add `GetComData` to `Object` contract - Finish implementation of `ISOSDacInterface::GetObjectData` such that it populates the RCW/CCW - Add test helpers for mocking out sync blocks
- Loading branch information
1 parent
a5635ff
commit c5a89d4
Showing
14 changed files
with
357 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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
25 changes: 25 additions & 0 deletions
25
src/native/managed/cdacreader/src/Data/InteropSyncBlockInfo.cs
This file contains 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,25 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.Diagnostics.DataContractReader.Data; | ||
|
||
internal sealed class InteropSyncBlockInfo : IData<InteropSyncBlockInfo> | ||
{ | ||
static InteropSyncBlockInfo IData<InteropSyncBlockInfo>.Create(Target target, TargetPointer address) | ||
=> new InteropSyncBlockInfo(target, address); | ||
|
||
public InteropSyncBlockInfo(Target target, TargetPointer address) | ||
{ | ||
Target.TypeInfo type = target.GetTypeInfo(DataType.InteropSyncBlockInfo); | ||
|
||
RCW = type.Fields.TryGetValue(nameof(RCW), out Target.FieldInfo rcwField) | ||
? target.ReadPointer(address + (ulong)rcwField.Offset) | ||
: TargetPointer.Null; | ||
CCW = type.Fields.TryGetValue(nameof(CCW), out Target.FieldInfo ccwField) | ||
? target.ReadPointer(address + (ulong)ccwField.Offset) | ||
: TargetPointer.Null; | ||
} | ||
|
||
public TargetPointer RCW { get; init; } | ||
public TargetPointer CCW { get; init; } | ||
} |
This file contains 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 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.Diagnostics.DataContractReader.Data; | ||
|
||
internal sealed class SyncBlock : IData<SyncBlock> | ||
{ | ||
static SyncBlock IData<SyncBlock>.Create(Target target, TargetPointer address) | ||
=> new SyncBlock(target, address); | ||
|
||
public SyncBlock(Target target, TargetPointer address) | ||
{ | ||
Target.TypeInfo type = target.GetTypeInfo(DataType.SyncBlock); | ||
|
||
TargetPointer interopInfoPointer = target.ReadPointer(address + (ulong)type.Fields[nameof(InteropInfo)].Offset); | ||
if (interopInfoPointer != TargetPointer.Null) | ||
InteropInfo = target.ProcessedData.GetOrAdd<InteropSyncBlockInfo>(interopInfoPointer); | ||
} | ||
|
||
public InteropSyncBlockInfo? InteropInfo { get; init; } | ||
} |
This file contains 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 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.Diagnostics.DataContractReader.Data; | ||
|
||
internal sealed class SyncTableEntry : IData<SyncTableEntry> | ||
{ | ||
static SyncTableEntry IData<SyncTableEntry>.Create(Target target, TargetPointer address) | ||
=> new SyncTableEntry(target, address); | ||
|
||
public SyncTableEntry(Target target, TargetPointer address) | ||
{ | ||
Target.TypeInfo type = target.GetTypeInfo(DataType.SyncTableEntry); | ||
|
||
TargetPointer syncBlockPointer = target.ReadPointer(address + (ulong)type.Fields[nameof(SyncBlock)].Offset); | ||
if (syncBlockPointer != TargetPointer.Null) | ||
SyncBlock = target.ProcessedData.GetOrAdd<SyncBlock>(syncBlockPointer); | ||
} | ||
|
||
public SyncBlock? SyncBlock { get; init; } | ||
} |
This file contains 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 |
---|---|---|
|
@@ -42,4 +42,7 @@ public enum DataType | |
MethodDesc, | ||
MethodDescChunk, | ||
Array, | ||
SyncBlock, | ||
SyncTableEntry, | ||
InteropSyncBlockInfo, | ||
} |
This file contains 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
Oops, something went wrong.