Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Sentry.Android.AssemblyReader/V2/ATTRIBUTION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ and subsequently updated from:
- https://github.com/dotnet/android/tree/64018e13e53cec7246e54866b520d3284de344e0/tools/assembly-store-reader-mk2
(assembly store v3, .NET 10)
- https://github.com/dotnet/android/tree/f1aecf9e6ae80fe3f3992ec1f52ef953dac7c06b/.github/skills/read-assembly-store
(assembly store v4 and index entry sizing, .NET 11)
(assembly store v4 and index entry sizing, .NET 11 previews)
- https://github.com/dotnet/android/commit/8f7c4d4fa53c6682f2c4f2d2caf08e9fb4d8cd60
(v4 reverted to v3 before .NET 11 GA)

Individual files note which of these they were updated from.

Expand Down
4 changes: 3 additions & 1 deletion src/Sentry.Android.AssemblyReader/V2/StoreReader.Classes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* Updated from https://github.com/dotnet/android/blob/64018e13e53cec7246e54866b520d3284de344e0/tools/assembly-store-reader-mk2/AssemblyStore/StoreReader_V2.Classes.cs
* - Adding support for AssemblyStore v3 format that shipped in .NET 10 (https://github.com/dotnet/android/pull/10249)
* Updated from https://github.com/dotnet/android/blob/f1aecf9e6ae80fe3f3992ec1f52ef953dac7c06b/.github/skills/read-assembly-store/src/AssemblyStore/StoreReader_V2.Classes.cs
* - Adding support for AssemblyStore v4 format (CoreCLR) that ships in .NET 11
* - Adding support for AssemblyStore v4 format (CoreCLR), which only ever shipped in .NET 11 previews
* Reviewed against https://github.com/dotnet/android/commit/8f7c4d4fa53c6682f2c4f2d2caf08e9fb4d8cd60
* - v4 was reverted before .NET 11 GA (dotnet/android#12780); CoreCLR emits v3 again
* Original code licensed under the MIT License (https://github.com/dotnet/android/blob/5ebcb1dd1503648391e3c0548200495f634d90c6/LICENSE.TXT)
*/

Expand Down
7 changes: 5 additions & 2 deletions src/Sentry.Android.AssemblyReader/V2/StoreReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
* Updated from https://github.com/dotnet/android/blob/64018e13e53cec7246e54866b520d3284de344e0/tools/assembly-store-reader-mk2/AssemblyStore/StoreReader_V2.cs
* - Adding support for AssemblyStore v3 format that shipped in .NET 10 (https://github.com/dotnet/android/pull/10249)
* Updated from https://github.com/dotnet/android/blob/f1aecf9e6ae80fe3f3992ec1f52ef953dac7c06b/.github/skills/read-assembly-store/src/AssemblyStore/StoreReader_V2.cs
* - Adding support for AssemblyStore v4 format (CoreCLR) that ships in .NET 11
* - Adding support for AssemblyStore v4 format (CoreCLR), which only ever shipped in .NET 11 previews
* - Deriving the index entry size from the header rather than the ABI
* Reviewed against https://github.com/dotnet/android/commit/8f7c4d4fa53c6682f2c4f2d2caf08e9fb4d8cd60
* - v4 was reverted before .NET 11 GA (dotnet/android#12780); CoreCLR emits v3 again
* Original code licensed under the MIT License (https://github.com/dotnet/android/blob/5ebcb1dd1503648391e3c0548200495f634d90c6/LICENSE.TXT)
*/

Expand All @@ -15,7 +17,8 @@ internal partial class StoreReader : AssemblyStoreReader
// Bit 31 is set for 64-bit platforms, cleared for the 32-bit ones
private const uint ASSEMBLY_STORE_FORMAT_VERSION_64BIT_V3 = 0x80000003;
private const uint ASSEMBLY_STORE_FORMAT_VERSION_32BIT_V3 = 0x00000003;
private const uint ASSEMBLY_STORE_FORMAT_VERSION_CORECLR_64BIT_V4 = 0x80000004; // Must match the ASSEMBLY_STORE_FORMAT_VERSION native constant
// v4 was only emitted by .NET 11 previews; it was reverted to v3 before GA by dotnet/android#12780
private const uint ASSEMBLY_STORE_FORMAT_VERSION_CORECLR_64BIT_V4 = 0x80000004;
private const uint ASSEMBLY_STORE_FORMAT_VERSION_CORECLR_32BIT_V4 = 0x00000004;
private const uint ASSEMBLY_STORE_FORMAT_VERSION_MASK = 0xF0000000;
private const uint ASSEMBLY_STORE_FORMAT_NUMBER_MASK = 0x0000FFFF;
Expand Down
9 changes: 5 additions & 4 deletions test/Sentry.Android.AssemblyReader.Tests/StoreReaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ namespace Sentry.Android.AssemblyReader.Tests;
public class StoreReaderTests
{
[Theory]
[InlineData(0x80000003u | 0x00010000u, true, sizeof(ulong))] // v3, 64-bit, arm64
[InlineData(0x80000003u | 0x00010000u, true, sizeof(ulong))] // v3, 64-bit, arm64 (MonoVM)
[InlineData(0x80000003u | 0x00010000u, true, sizeof(uint))] // v3, 64-bit, arm64 (CoreCLR)
[InlineData(0x00000003u | 0x00020000u, false, sizeof(uint))] // v3, 32-bit, arm
[InlineData(0x80000004u | 0x00030000u, true, sizeof(ulong))] // v4, 64-bit, x86_64 (MonoVM)
[InlineData(0x80000004u | 0x00030000u, true, sizeof(uint))] // v4, 64-bit, x86_64 (CoreCLR)
[InlineData(0x00000004u | 0x00040000u, false, sizeof(uint))] // v4, 32-bit, x86
[InlineData(0x80000004u | 0x00030000u, true, sizeof(ulong))] // v4, 64-bit, x86_64 (MonoVM, .NET 11 previews)
[InlineData(0x80000004u | 0x00030000u, true, sizeof(uint))] // v4, 64-bit, x86_64 (CoreCLR, .NET 11 previews)
[InlineData(0x00000004u | 0x00040000u, false, sizeof(uint))] // v4, 32-bit, x86 (.NET 11 previews)
public void Create_SupportedVersion_ReadsStore(uint version, bool is64Bit, int nameHashSize)
{
// Arrange
Expand Down
Loading