-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Adding GetILForModule cDAC API #118546
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
Open
rcj1
wants to merge
8
commits into
dotnet:main
Choose a base branch
from
rcj1:GetILForModule
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Adding GetILForModule cDAC API #118546
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
199a215
Adding GetILForModule cDAC API
rcj1 58b58aa
docs
rcj1 3edd122
!IsMapped()
rcj1 22536e0
Merge branch 'main' into GetILForModule
rcj1 4ee726d
include
rcj1 234423d
Merge branch 'GetILForModule' of https://github.com/rcj1/runtime into…
rcj1 de342f2
codereview
rcj1 3f6e3c8
code review
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
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
17 changes: 17 additions & 0 deletions
17
...ve/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ImageDosHeader.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,17 @@ | ||
// 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 ImageDosHeader : IData<ImageDosHeader> | ||
{ | ||
static ImageDosHeader IData<ImageDosHeader>.Create(Target target, TargetPointer address) | ||
=> new ImageDosHeader(target, address); | ||
private const int LfanewOffset = 60; | ||
|
||
public ImageDosHeader(Target target, TargetPointer address) | ||
{ | ||
Lfanew = target.ReadLittleEndian<int>(address + LfanewOffset); | ||
} | ||
public int Lfanew { get; init; } | ||
} |
20 changes: 20 additions & 0 deletions
20
...e/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ImageFileHeader.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,20 @@ | ||
// 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.Data; | ||
|
||
internal sealed class ImageFileHeader : IData<ImageFileHeader> | ||
{ | ||
static ImageFileHeader IData<ImageFileHeader>.Create(Target target, TargetPointer address) => new ImageFileHeader(target, address); | ||
private const int NumberOfSectionsOffset = 2; | ||
private const int SizeOfOptionalHeaderOffset = 16; | ||
public ImageFileHeader(Target target, TargetPointer address) | ||
{ | ||
NumberOfSections = target.ReadLittleEndian<ushort>(address + NumberOfSectionsOffset); | ||
SizeOfOptionalHeader = target.ReadLittleEndian<ushort>(address + SizeOfOptionalHeaderOffset); | ||
} | ||
public ushort NumberOfSections { get; init; } | ||
public ushort SizeOfOptionalHeader { get; init; } | ||
} |
20 changes: 20 additions & 0 deletions
20
...ve/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ImageNTHeaders.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,20 @@ | ||
// 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.Data; | ||
|
||
internal sealed class ImageNTHeaders : IData<ImageNTHeaders> | ||
{ | ||
static ImageNTHeaders IData<ImageNTHeaders>.Create(Target target, TargetPointer address) => new ImageNTHeaders(target, address); | ||
public const int FileHeaderOffset = 4; | ||
public const int OptionalHeaderOffset = 24; | ||
public ImageNTHeaders(Target target, TargetPointer address) | ||
{ | ||
FileHeader = target.ProcessedData.GetOrAdd<ImageFileHeader>(address + FileHeaderOffset); | ||
OptionalHeader = target.ProcessedData.GetOrAdd<ImageOptionalHeader>(address + OptionalHeaderOffset); | ||
} | ||
public ImageFileHeader FileHeader { get; init; } | ||
public ImageOptionalHeader OptionalHeader { get; init; } | ||
} |
17 changes: 17 additions & 0 deletions
17
...naged/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ImageOptionalHeader.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,17 @@ | ||
// 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.Data; | ||
|
||
internal sealed class ImageOptionalHeader : IData<ImageOptionalHeader> | ||
{ | ||
static ImageOptionalHeader IData<ImageOptionalHeader>.Create(Target target, TargetPointer address) => new ImageOptionalHeader(target, address); | ||
private const int SectionAlignmentOffset = 32; | ||
public ImageOptionalHeader(Target target, TargetPointer address) | ||
{ | ||
SectionAlignment = target.ReadLittleEndian<uint>(address + SectionAlignmentOffset); | ||
} | ||
public uint SectionAlignment { get; init; } | ||
} |
28 changes: 28 additions & 0 deletions
28
...anaged/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ImageSectionHeader.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,28 @@ | ||
// 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.Data; | ||
|
||
internal sealed class ImageSectionHeader : IData<ImageSectionHeader> | ||
{ | ||
static ImageSectionHeader IData<ImageSectionHeader>.Create(Target target, TargetPointer address) => new ImageSectionHeader(target, address); | ||
private const int VirtualSizeOffset = 8; | ||
private const int VirtualAddressOffset = 12; | ||
private const int SizeOfRawDataOffset = 16; | ||
private const int PointerToRawDataOffset = 20; | ||
public const uint Size = 40; | ||
public ImageSectionHeader(Target target, TargetPointer address) | ||
{ | ||
VirtualSize = target.ReadLittleEndian<uint>(address + VirtualSizeOffset); | ||
VirtualAddress = target.ReadLittleEndian<uint>(address + VirtualAddressOffset); | ||
SizeOfRawData = target.ReadLittleEndian<uint>(address + SizeOfRawDataOffset); | ||
PointerToRawData = target.ReadLittleEndian<uint>(address + PointerToRawDataOffset); | ||
} | ||
|
||
public uint VirtualSize { get; init; } | ||
public uint VirtualAddress { get; init; } | ||
public uint SizeOfRawData { get; init; } | ||
public uint PointerToRawData { get; init; } | ||
} |
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.
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.