-
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.
- Loading branch information
Showing
527 changed files
with
24,243 additions
and
22,911 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
Validating CODEOWNERS rules …
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
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,28 @@ | ||
# Contract GCHandle | ||
|
||
This contract allows decoding and reading of GCHandles. This will also include handle enumeration in the future | ||
|
||
## Data structures defined by contract | ||
``` csharp | ||
struct DacGCHandle | ||
{ | ||
DacGCHandle(TargetPointer value) { Value = value; } | ||
TargetPointer Value; | ||
} | ||
``` | ||
|
||
## Apis of contract | ||
``` csharp | ||
TargetPointer GetObject(DacGCHandle gcHandle); | ||
``` | ||
|
||
## Version 1 | ||
|
||
``` csharp | ||
TargetPointer GetObject(DacGCHandle gcHandle) | ||
{ | ||
if (gcHandle.Value == TargetPointer.Null) | ||
return TargetPointer.Null; | ||
return Target.ReadTargetPointer(gcHandle.Value); | ||
} | ||
``` |
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,78 @@ | ||
# Contract SList | ||
|
||
This contract allows reading and iterating over an SList data structure. | ||
|
||
## Data structures defined by contract | ||
``` csharp | ||
class SListReader | ||
{ | ||
public abstract TargetPointer GetHead(TargetPointer slistPointer); | ||
public abstract TargetPointer GetNext(TargetPointer entryInSList); | ||
public IEnumerator<TargetPointer> EnumerateList(TargetPointer slistPointer) | ||
{ | ||
TargetPointer current = GetHead(slistPointer); | ||
|
||
while (current != TargetPointer.Null) | ||
{ | ||
yield return current; | ||
current = GetNext(current); | ||
} | ||
} | ||
public IEnumerator<TargetPointer> EnumerateListFromEntry(TargetPointer entryInSList) | ||
{ | ||
TargetPointer current = entryInSList; | ||
|
||
while (current != TargetPointer.Null) | ||
{ | ||
yield return current; | ||
current = GetNext(current); | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Apis of contract | ||
``` csharp | ||
SListReader GetReader(string typeOfDataStructure); | ||
``` | ||
|
||
## Version 1 | ||
|
||
``` csharp | ||
private class SListReaderV1 : SListReader | ||
{ | ||
uint _offsetToSLinkField; | ||
Target Target; | ||
|
||
SListReaderV1(Target target, string typeToEnumerate) | ||
{ | ||
Target = target; | ||
_offsetToSLinkField = Target.Contracts.GetFieldLayout(typeToEnumerate, "m_Link").Offset; | ||
} | ||
public override TargetPointer GetHead(TargetPointer slistPointer) | ||
{ | ||
TargetPointer headPointer = new SListBase(Target, slistPointer).m_pHead; | ||
TargetPointer slinkInHeadObject = new SLink(Target, headPointer).m_pNext; | ||
if (slinkInHeadObject == TargetPointer.Null) | ||
return TargetPointer.Null; | ||
return slinkInHeadObject - _offsetToSLinkField; | ||
} | ||
|
||
public override TargetPointer GetNext(TargetPointer entryInSList) | ||
{ | ||
if (entryInSList == TargetPointer.Null) | ||
throw new ArgumentException(); | ||
|
||
TargetPointer slinkPointer = entryInSList + _offsetToSLinkField; | ||
TargetPointer slinkInObject = new SLink(Target, slinkPointer).m_pNext; | ||
if (slinkInObject == TargetPointer.Null) | ||
return TargetPointer.Null; | ||
return slinkInHeadObject - _offsetToSLinkField; | ||
} | ||
} | ||
|
||
SListReader GetReader(string typeOfDataStructure) | ||
{ | ||
return new SListReaderV1(typeOfDataStructure); | ||
} | ||
``` |
Oops, something went wrong.