Skip to content
Open
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
7 changes: 3 additions & 4 deletions eng/DiaSymReaderNative.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>
<Project>

<PropertyGroup>
<!--
Expand Down Expand Up @@ -31,6 +29,7 @@
<Pack>false</Pack>
</Content>

<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)" ExcludeAssets="all"/>
<PackageDownload Include="Microsoft.DiaSymReader.Native" Version="[$(MicrosoftDiaSymReaderNativeVersion)]" />
</ItemGroup>

</Project>
6 changes: 0 additions & 6 deletions eng/Publishing.props

This file was deleted.

10 changes: 5 additions & 5 deletions eng/Signing.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>
<ItemGroup>
<Project>

<ItemGroup>
<FileSignInfo Include="Newtonsoft.Json.dll" CertificateName="3PartySHA2" />
</ItemGroup>
</ItemGroup>

</Project>
5 changes: 3 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>

<PropertyGroup>
<VersionPrefix>1.1.0</VersionPrefix>
<PreReleaseVersionLabel>beta2</PreReleaseVersionLabel>
<SemanticVersioningV1>true</SemanticVersioningV1>
<UsingToolNuGetRepack>true</UsingToolNuGetRepack>
<UsingToolSymbolUploader>true</UsingToolSymbolUploader>

<!-- libs -->
<MicrosoftCodeAnalysisPooledObjectsVersion>4.1.0-1.21523.2</MicrosoftCodeAnalysisPooledObjectsVersion>
<MicrosoftCodeAnalysisDebuggingVersion>4.1.0-1.21523.2</MicrosoftCodeAnalysisDebuggingVersion>
Expand All @@ -20,4 +20,5 @@
<SystemReflectionMetadataVersion>5.0.0</SystemReflectionMetadataVersion>
<SystemTextJsonVersion>5.0.0</SystemTextJsonVersion>
</PropertyGroup>

</Project>
12 changes: 7 additions & 5 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>
<Project>

<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<PropertyGroup>
<LangVersion>Preview</LangVersion>
<LangVersion>preview</LangVersion>
<Nullable>annotations</Nullable>
<Nullable Condition="'$(TargetFramework)' != 'net472'">enable</Nullable>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!-- The minimum supported versions of this repo. -->
<NetMinimum>net8.0</NetMinimum>
<NetFrameworkMinimum>net472</NetFrameworkMinimum>
</PropertyGroup>

</Project>
27 changes: 3 additions & 24 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>
<Project>

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<!--
Workaround for https://github.com/NuGet/Home/issues/6754: cyclic dependency.
-->
<PropertyGroup>
<_ProjectDefinedPackageId>$(PackageId)</_ProjectDefinedPackageId>
<PackageId>*fake_packageid_for_project_$(MSBuildProjectName)*</PackageId>
<BeforePack>$(BeforePack);_UpdatePackageId</BeforePack>
<Nullable Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">enable</Nullable>
</PropertyGroup>

<!--
Workaround for cyclic package reference. PackageId is set to an invalid value above (in evaluation phase to be picked up by Restore),
then updated to the actual value before Pack target.

Note: $(BeforePack) is used instead of BeforeTargets="$(PackDependsOn)" because PackDependsOn now includes
_GetRestoreProjectStyle (NuGet/NuGet.Client#6712), which would cause this target to run during Restore and
undo the fake PackageId before the restore graph is built.
-->
<Target Name="_UpdatePackageId">
<PropertyGroup>
<PackageId>$(_ProjectDefinedPackageId)</PackageId>
<PackageId Condition="'$(PackageId)' == ''">$(AssemblyName)</PackageId>
<PackageId Condition="'$(PackageId)' == ''">$(MSBuildProjectName)</PackageId>
</PropertyGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(NetCurrent);net472</TargetFrameworks>
<TargetFrameworks>$(BundledNETCoreAppTargetFramework);$(NetFrameworkMinimum)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!--
We would need to download 32bit dotnet cli, which would add extra time to PR runs
Testing 64bit only on Desktop suffixiently covers our interop code paths.
-->
<TestArchitectures Condition="'$(TargetFramework)' == 'net472'">x64;x86</TestArchitectures>

<TestArchitectures Condition="'$(TargetFramework)' == '$(NetFrameworkMinimum)'">x64;x86</TestArchitectures>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Metadata.Visualizer" Version="$(MicrosoftMetadataVisualizerVersion)" />
<PackageReference Include="Microsoft.DiaSymReader.PortablePdb" Version="$(MicrosoftDiaSymReaderPortablePdbVersion)" />
Expand All @@ -21,4 +20,5 @@
</ItemGroup>

<Import Project="$(RepositoryEngineeringDir)DiaSymReaderNative.targets" />

</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>$(NetMinimum);$(NetFrameworkMinimum)</TargetFrameworks>
<RootNamespace>Microsoft.DiaSymReader.Tools</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -16,13 +15,15 @@
<!-- Workaround for https://github.com/dotnet/sdk/issues/11270 -->
<GenerateDependencyFile>false</GenerateDependencyFile>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Microsoft.DiaSymReader.Converter\Utilities\HResult.cs" Link="Utilities\HResult.cs" />
<Compile Include="..\Microsoft.DiaSymReader.Converter\Utilities\StreamUtilities.cs" Link="Utilities\StreamUtilities.cs" />
<Compile Include="..\Microsoft.DiaSymReader.Converter\Utilities\SymReaderHelpers.cs" Link="Utilities\SymReaderHelpers.cs" />
<Compile Include="..\Microsoft.DiaSymReader.Converter\Utilities\SymMetadataProvider.cs" Link="Utilities\SymMetadataProvider.cs" />
<Compile Include="..\Microsoft.DiaSymReader.Converter\Utilities\DummySymReaderMetadataProvider.cs" Link="Utilities\DummySymReaderMetadataProvider.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DiaSymReader" Version="$(MicrosoftDiaSymReaderVersion)" />
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)" />
Expand All @@ -32,6 +33,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.PooledObjects" Version="$(MicrosoftCodeAnalysisPooledObjectsVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Debugging" Version="$(MicrosoftCodeAnalysisDebuggingVersion)" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="PdbToXmlResources.resx" GenerateSource="true" />
<EmbeddedResource Update="ConverterResources.resx" GenerateSource="true" />
Expand All @@ -45,4 +47,5 @@
<Link Condition="'%(NuGetPackageId)' != ''">%(NuGetPackageId)\%(Link)</Link>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ internal byte[] Buffer
internal void FillBuffer(Stream stream, int capacity)
{
MinCapacity(capacity);
#if NET
stream.ReadExactly(_buffer, 0, capacity);
#else
stream.Read(_buffer, 0, capacity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a bug on .NET Framework?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we should probably add code similar to https://github.com/dotnet/arcade/pull/15673/changes

#endif
_offset = 0;
}

Expand All @@ -90,7 +94,11 @@ internal void Append(Stream stream, int count)
Array.Copy(_buffer, newBuffer, _buffer.Length);
_buffer = newBuffer;
}
#if NET
stream.ReadExactly(_buffer, _offset, count);
#else
stream.Read(_buffer, _offset, count);
#endif
_offset += count;
}

Expand Down Expand Up @@ -389,14 +397,14 @@ private static int GetPrime(int minSize)

// The hash table data.
// This cannot be serialized
private struct bucket
private struct Bucket
{
internal int key;
internal int hash_coll; // Store hash code; sign bit means there was a collision.
internal Object val;
internal object val;
}

private bucket[] _buckets;
private Bucket[] _buckets;

// The total number of entries in the hash table.
private int _count;
Expand Down Expand Up @@ -428,7 +436,7 @@ internal IntHashTable(int capacity, int loadFactorPerc)
_loadFactorPerc = (loadFactorPerc * 72) / 100;

int hashsize = GetPrime((int)(capacity / _loadFactorPerc));
_buckets = new bucket[hashsize];
_buckets = new Bucket[hashsize];

_loadsize = (int)(_loadFactorPerc * hashsize) / 100;
if (_loadsize >= hashsize)
Expand Down Expand Up @@ -466,11 +474,11 @@ internal Object this[int key]
uint seed;
uint incr;
// Take a snapshot of buckets, in case another thread does a resize
bucket[] lbuckets = _buckets;
Bucket[] lbuckets = _buckets;
uint hashcode = InitHash(key, lbuckets.Length, out seed, out incr);
int ntry = 0;

bucket b;
Bucket b;
do
{
int bucketNumber = (int)(seed % (uint)lbuckets.Length);
Expand Down Expand Up @@ -513,13 +521,13 @@ private void rehash(int newsize)
// at all times
// 2) Protect against an OutOfMemoryException while allocating this
// new bucket[].
bucket[] newBuckets = new bucket[newsize];
Bucket[] newBuckets = new Bucket[newsize];

// rehash table into new buckets
int nb;
for (nb = 0; nb < _buckets.Length; nb++)
{
bucket oldb = _buckets[nb];
Bucket oldb = _buckets[nb];
if (oldb.val != null)
{
putEntry(newBuckets, oldb.key, oldb.val, oldb.hash_coll & 0x7FFFFFFF);
Expand Down Expand Up @@ -646,7 +654,7 @@ private void Insert(int key, Object nvalue, bool add)
throw new InvalidOperationException("InvalidOperation_HashInsertFailed");
}

private void putEntry(bucket[] newBuckets, int key, Object nvalue, int hashcode)
private void putEntry(Bucket[] newBuckets, int key, Object nvalue, int hashcode)
{
uint seed = (uint)hashcode;
uint incr = (uint)(1 + (((seed >> 5) + 1) % ((uint)newBuckets.Length - 1)));
Expand Down Expand Up @@ -867,7 +875,11 @@ internal void Seek(int page, int offset)

internal void Read(byte[] bytes, int offset, int count)
{
#if NET
reader.ReadExactly(bytes, offset, count);
#else
reader.Read(bytes, offset, count);
#endif
}

internal int PagesFromSize(int size)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>$(NetMinimum);$(NetFrameworkMinimum)</TargetFrameworks>
<RootNamespace>Microsoft.DiaSymReader.Tools</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -17,6 +16,7 @@
<!-- Workaround for https://github.com/dotnet/sdk/issues/11270 -->
<GenerateDependencyFile>false</GenerateDependencyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PooledObjects" Version="$(MicrosoftCodeAnalysisPooledObjectsVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Debugging" Version="$(MicrosoftCodeAnalysisDebuggingVersion)" PrivateAssets="all" />
Expand All @@ -27,10 +27,12 @@
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Microsoft.DiaSymReader.Converter.UnitTests" />
<InternalsVisibleTo Include="Pdb2Pdb.UnitTests" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="ConverterResources.resx" GenerateSource="true" />
</ItemGroup>
Expand All @@ -43,4 +45,5 @@
<Link Condition="'%(NuGetPackageId)' != ''">%(NuGetPackageId)\%(Link)</Link>
</Compile>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ private unsafe static byte[] GetBytes(byte* data, int size)
}

private unsafe static string GetString(byte* data, int size) =>
#if NET45
new string((sbyte*)data, 0, size, Encoding.UTF8);
#else
Encoding.UTF8.GetString(data, size);
#endif

public unsafe static string? GetSourceLinkData(this ISymUnmanagedReader5 reader) =>
TryGetSourceLinkData(reader, out byte* data, out int size) ? GetString(data, size) : null;
Expand Down
9 changes: 5 additions & 4 deletions src/Pdb2Pdb.Tests/Pdb2Pdb.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>$(NetFrameworkMinimum)</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.DiaSymReader.Converter.Xml\Microsoft.DiaSymReader.Converter.Xml.csproj" />
<ProjectReference Include="..\Microsoft.DiaSymReader.Converter\Microsoft.DiaSymReader.Converter.csproj" />
Expand All @@ -14,4 +14,5 @@
</ItemGroup>

<Import Project="$(RepositoryEngineeringDir)DiaSymReaderNative.targets" />

</Project>
12 changes: 8 additions & 4 deletions src/Pdb2Pdb/Pdb2Pdb.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<TargetFramework>$(NetFrameworkMinimum)</TargetFramework>
<RootNamespace>Microsoft.DiaSymReader.Tools</RootNamespace>
<OutputType>Exe</OutputType>
<LargeAddressAware>true</LargeAddressAware>
Expand All @@ -16,19 +15,24 @@
<NuspecBasePath>$(OutputPath)</NuspecBasePath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.DiaSymReader.Converter\Microsoft.DiaSymReader.Converter.csproj" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Pdb2Pdb.UnitTests" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Resources.resx" GenerateSource="true" />
<Compile Include="..\Common\NullableAttributes.cs" Link="Common\NullableAttributes.cs" />
</ItemGroup>

<ItemGroup>
<NuspecProperty Include="Configuration=$(Configuration)"/>
</ItemGroup>

<Import Project="$(RepositoryEngineeringDir)DiaSymReaderNative.targets" />

</Project>
Loading
Loading