-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Restore symbol-free decoding for CORINFO_HELP_NEW helpers #131554
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
6 commits
Select commit
Hold shift + click to select a range
c7353eb
Restore allocation helper auxiliary symbols
Copilot 9071b7f
Update AuxiliarySymbolsDumpTests.cs
rcj1 974a748
Update AuxiliarySymbols.md
rcj1 8cfb940
Update docs/design/datacontracts/AuxiliarySymbols.md
rcj1 5510405
Add auxiliary symbols for new helper names
rcj1 30de716
Merge branch 'main' into copilot/add-jit-helpers-coding
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
65 changes: 65 additions & 0 deletions
65
src/native/managed/cdac/tests/DumpTests/AuxiliarySymbolsDumpTests.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,65 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Collections.Generic; | ||
| using Microsoft.Diagnostics.DataContractReader.Contracts; | ||
| using Microsoft.Diagnostics.DataContractReader.TestInfrastructure; | ||
| using Xunit; | ||
|
|
||
| namespace Microsoft.Diagnostics.DataContractReader.DumpTests; | ||
|
|
||
| public class AuxiliarySymbolsDumpTests : DumpTestBase | ||
| { | ||
| protected override string DebuggeeName => "BasicThreads"; | ||
| protected override string DumpType => "full"; | ||
|
|
||
| [ConditionalTheory] | ||
| [MemberData(nameof(TestConfigurations))] | ||
| [SkipOnVersion("net10.0", "Allocation helpers are not included in the .NET 10 auxiliary symbol table")] | ||
| public void JitHelpersAreReachableByAddress(TestConfiguration config) | ||
| { | ||
| InitializeDumpTest(config); | ||
|
|
||
| HashSet<string> expectedHelpers = | ||
| [ | ||
| "CORINFO_HELP_NEWFAST", | ||
| "CORINFO_HELP_NEWFAST_MAYBEFROZEN", | ||
| "CORINFO_HELP_NEWSFAST", | ||
| "CORINFO_HELP_NEWSFAST_ALIGN8", | ||
| "CORINFO_HELP_NEWSFAST_ALIGN8_VC", | ||
| "CORINFO_HELP_NEWARR_1_DIRECT", | ||
| "CORINFO_HELP_NEWARR_1_MAYBEFROZEN", | ||
| "CORINFO_HELP_NEWARR_1_PTR", | ||
| "CORINFO_HELP_NEWARR_1_VC", | ||
| "CORINFO_HELP_NEWARR_1_ALIGN8", | ||
| ]; | ||
| Dictionary<TargetCodePointer, string> helpersByAddress = []; | ||
|
|
||
| TargetPointer table = Target.ReadGlobalPointer(Constants.Globals.AuxiliarySymbols); | ||
| uint count = Target.Read<uint>(Target.ReadGlobalPointer(Constants.Globals.AuxiliarySymbolCount)); | ||
| Target.TypeInfo typeInfo = Target.GetTypeInfo(DataType.AuxiliarySymbolInfo); | ||
| uint entrySize = typeInfo.Size!.Value; | ||
| int addressOffset = typeInfo.Fields["Address"].Offset; | ||
| int nameOffset = typeInfo.Fields["Name"].Offset; | ||
|
|
||
| for (uint i = 0; i < count; i++) | ||
| { | ||
| TargetPointer entry = table + ((ulong)i * entrySize); | ||
| TargetPointer namePointer = Target.ReadPointer(entry + (ulong)nameOffset); | ||
| string name = Target.ReadUtf8String(namePointer); | ||
| if (expectedHelpers.Remove(name)) | ||
| { | ||
| TargetCodePointer address = Target.ReadCodePointer(entry + (ulong)addressOffset); | ||
| Assert.NotEqual(TargetCodePointer.Null, address); | ||
| helpersByAddress.TryAdd(address, name); | ||
| } | ||
| } | ||
|
|
||
| Assert.Empty(expectedHelpers); | ||
| foreach ((TargetCodePointer address, string expectedName) in helpersByAddress) | ||
| { | ||
| Assert.True(Target.Contracts.AuxiliarySymbols.TryGetAuxiliarySymbolName(address.AsTargetPointer, out string? name)); | ||
| Assert.Equal(expectedName, name); | ||
| } | ||
| } | ||
| } |
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.