-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Adding GetHandleEnum and GetHandleEnumForTypes cDAC APIs #124760
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
+1,109
−19
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ed04271
adding GetHandleForEnum cDAC API
rcj1 71b287d
Merge branch 'main' into GetHandleEnum
rcj1 edcfa8a
Apply suggestions from code review
rcj1 25e4f10
Change DebugDestroyedHandleValue type to uintptr_t
rcj1 c02b4aa
Update docs/design/datacontracts/GC.md
rcj1 8a2ccce
Update docs/design/datacontracts/GC.md
rcj1 5b40d42
Update docs/design/datacontracts/ComWrappers.md
rcj1 d74a515
copilot etc
rcj1 c30a102
Apply suggestions from code review
rcj1 29f26f4
Merge branch 'main' into GetHandleEnum
rcj1 2744100
e
rcj1 7b4785b
code review
rcj1 ab92284
fixing docs and missing files
rcj1 fe5eb4d
Apply suggestion from @Copilot
rcj1 edc8c2c
copilot and trying a full dump for gc dump tests and other fixes
rcj1 165ad43
fix
rcj1 ce97895
fix
rcj1 e01c15a
md
rcj1 a49a6fa
md
rcj1 c9e855b
Update src/coreclr/vm/datadescriptor/datadescriptor.inc
rcj1 39f0fa0
Merge branch 'main' into GetHandleEnum
rcj1 f062e54
fix the enum bug
rcj1 3d34651
add assert
rcj1 59a168d
Update docs/design/datacontracts/GC.md
rcj1 910a8ce
fix bad merge
rcj1 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
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,53 @@ | ||
| # Contract BuiltInCOM | ||
|
|
||
| This contract is for getting information related to built-in COM. | ||
|
|
||
| ## APIs of contract | ||
|
|
||
| ``` csharp | ||
| public ulong GetRefCount(TargetPointer ccw); | ||
| // Check whether the COM wrappers handle is weak. | ||
| public bool IsHandleWeak(TargetPointer ccw); | ||
| ``` | ||
|
|
||
| ## Version 1 | ||
|
|
||
| Data descriptors used: | ||
| | Data Descriptor Name | Field | Meaning | | ||
| | --- | --- | --- | | ||
| | `ComCallWrapper` | `SimpleWrapper` | Address of the associated `SimpleComCallWrapper` | | ||
| | `SimpleComCallWrapper` | `RefCount` | The wrapper refcount value | | ||
| | `SimpleComCallWrapper` | `Flags` | Bit flags for wrapper properties | | ||
|
|
||
| Global variables used: | ||
| | Global Name | Type | Purpose | | ||
| | --- | --- | --- | | ||
| | `ComRefcountMask` | `long` | Mask applied to `SimpleComCallWrapper.RefCount` to produce the visible refcount | | ||
|
|
||
| Contracts used: | ||
| | Contract Name | | ||
| | --- | | ||
| `None` | ||
|
|
||
| ``` csharp | ||
|
|
||
| private enum Flags | ||
| { | ||
| IsHandleWeak = 0x4, | ||
| } | ||
|
|
||
| public ulong GetRefCount(TargetPointer address) | ||
| { | ||
| var ccw = _target.ReadPointer(address + /* ComCallWrapper::SimpleWrapper offset */); | ||
| ulong refCount = _target.Read<ulong>(ccw + /* SimpleComCallWrapper::RefCount offset */); | ||
| long refCountMask = _target.ReadGlobal<long>("ComRefcountMask"); | ||
| return refCount & (ulong)refCountMask; | ||
| } | ||
|
|
||
| public bool IsHandleWeak(TargetPointer address) | ||
| { | ||
| var ccw = _target.ReadPointer(address + /* ComCallWrapper::SimpleWrapper offset */); | ||
| uint flags = _target.Read<uint>(ccw + /* SimpleComCallWrapper::Flags offset */); | ||
| return (flags & (uint)Flags.IsHandleWeak) != 0; | ||
| } | ||
| ``` | ||
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
Oops, something went wrong.
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.