From a6d535c79313d87441a70502cbb4d725e3393493 Mon Sep 17 00:00:00 2001 From: Tomas Rylek Date: Sun, 4 Sep 2022 20:22:38 +0200 Subject: [PATCH 01/12] Initial provisions for semantic Crossgen2 PDB validation This Quality Week work item is motivated by my findings from a few months back that Crossgen2 PDB generator had been producing bogus symbol files for almost half a year due to a trivial bug and no testing in place was able to catch that. This change adds initial provisions for semantic PDB validation. In this initial commit I'm adding a new managed app PdbChecker that uses the DIA library to read a given PDB and optionally check it for the presence of given symbols. In parallel I'm making test infra changes that enable selective PDB validation support in individual tests including checks for the presence of expected symbols. This change by itself introduces rudimentary PR / CI validation of PDB files produced by Crossgen2. As next step I plan to introduce additional provisions for running this logic for all tests to be added to one of the Crossgen2-specific pipelines, and validation of PDBs produced during compilation of the framework assemblies. Thanks Tomas --- src/tests/Common/CLRTest.CrossGen.targets | 31 ++++++++-- src/tests/Common/Directory.Build.targets | 1 + .../Common/PdbChecker/MSDiaSymbolReader.cs | 58 ++++++++++++++++++ src/tests/Common/PdbChecker/PdbChecker.csproj | 17 ++++++ src/tests/Common/PdbChecker/PdbChecker.sln | 25 ++++++++ src/tests/Common/PdbChecker/Program.cs | 60 +++++++++++++++++++ .../test_dependencies.csproj | 1 + .../crossgen2/crossgen2smoke.csproj | 7 +++ 8 files changed, 196 insertions(+), 4 deletions(-) create mode 100644 src/tests/Common/PdbChecker/MSDiaSymbolReader.cs create mode 100644 src/tests/Common/PdbChecker/PdbChecker.csproj create mode 100644 src/tests/Common/PdbChecker/PdbChecker.sln create mode 100644 src/tests/Common/PdbChecker/Program.cs diff --git a/src/tests/Common/CLRTest.CrossGen.targets b/src/tests/Common/CLRTest.CrossGen.targets index c71df61f92e998..87af80d4e14ab9 100644 --- a/src/tests/Common/CLRTest.CrossGen.targets +++ b/src/tests/Common/CLRTest.CrossGen.targets @@ -81,6 +81,7 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then OneFileCrossgen2() { date +%H:%M:%S __OutputFile=$1 + __PdbFile=$ __ResponseFile="$__OutputFile.rsp" rm $__ResponseFile 2>/dev/null @@ -189,8 +190,12 @@ if /i "$(AlwaysUseCrossGen2)" == "true" ( REM CrossGen2 Script if defined RunCrossGen2 ( set ExtraCrossGen2Args=!ExtraCrossGen2Args! $(CrossGen2TestExtraArguments) + set CrossGen2TestCheckPdb=$(CrossGen2TestCheckPdb) + set __CreatePdb=$(__CreatePdb) if defined LargeVersionBubble ( set ExtraCrossGen2Args=!ExtraCrossGen2Args! --inputbubble) + if defined CrossGen2TestCheckPdb ( set __CreatePdb=1) + set CrossGen2Status=0 set R2RDumpStatus=0 set compilationDoneFlagFile=!ScriptPath!IL-CG2\done @@ -214,6 +219,7 @@ if defined RunCrossGen2 ( if defined CompositeBuildMode ( set ExtraCrossGen2Args=!ExtraCrossGen2Args! --composite set __OutputFile=!scriptPath!\composite-r2r.dll + set __PdbFile=!scriptPath!\composite-r2r.ni.pdb rem In composite mode, treat all dll's in the test folder as rooting inputs set __InputFile=!scriptPath!IL-CG2\*.dll call :CompileOneFileCrossgen2 @@ -222,6 +228,7 @@ if defined RunCrossGen2 ( set ExtraCrossGen2Args=!ExtraCrossGen2Args! -r:!scriptPath!IL-CG2\*.dll for %%I in (!scriptPath!IL-CG2\*.dll) do ( set __OutputFile=!scriptPath!%%~nI.dll + set __PdbFile=!scriptPath!%%~nI.ni.pdb set __InputFile=%%I call :CompileOneFileCrossgen2 IF NOT !CrossGen2Status!==0 ( @@ -238,13 +245,14 @@ if defined RunCrossGen2 ( set __ResponseFile=!__OutputFile!.rsp del /Q !__ResponseFile! 2>nul - set __Command=!_DebuggerFullPath! REM Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path if defined __TestDotNetCmd ( - set __Command=!__Command! "!__TestDotNetCmd!" + set __DotNet="!__TestDotNetCmd!" ) else ( - set __Command=!__Command! "dotnet" + set __DotNet="dotnet" ) + set __Command=!_DebuggerFullPath! + set __Command=!__Command! !__DotNet! set __R2RDumpCommand=!__Command! "!CORE_ROOT!\r2rdump\r2rdump.dll" set __R2RDumpCommand=!__R2RDumpCommand! --header --sc --in !__OutputFile! --out !__OutputFile!.r2rdump --val set __Command=!__Command! "!CORE_ROOT!\crossgen2\crossgen2.dll" @@ -269,7 +277,7 @@ if defined RunCrossGen2 ( echo -r:!CORE_ROOT!\mscorlib.dll>>!__ResponseFile! echo -r:!CORE_ROOT!\netstandard.dll>>!__ResponseFile! - if not "$(__CreatePdb)" == "" ( + if defined __CreatePdb ( echo --pdb>>!__ResponseFile! ) @@ -303,6 +311,21 @@ if defined RunCrossGen2 ( endlocal & set "R2RDumpStatus=%R2RDumpStatus%" &set "CrossGen2Status=%CrossGen2Status%" echo %time% + + if !CrossGen2Status!==0 ( + if defined CrossGen2TestCheckPdb ( + set __CheckPdbCommand=!__DotNet! + set __CheckPdbCommand=!__CheckPdbCommand! "!CORE_ROOT!\PdbChecker\PdbChecker.dll" + set __CheckPdbCommand=!__CheckPdbCommand! !__PdbFile! @(CheckPdbSymbol->'%22%(Identity)%22', ' ') + echo "!__CheckPdbCommand!" + call !__CheckPdbCommand! + if not !ERRORLEVEL!==0 ( + echo PDB check failed for file !__PdbFile! >2 + set CrossGen2Status=42 + ) + ) + ) + Exit /b 0 :DoneCrossgen2Operations diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index 74e2cc211c5329..544fac82632599 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -41,6 +41,7 @@ + diff --git a/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs b/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs new file mode 100644 index 00000000000000..bd12bde9fff53b --- /dev/null +++ b/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs @@ -0,0 +1,58 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.IO; +using Dia2Lib; + +class MSDiaSymbolReader +{ + private readonly IDiaDataSource _diaDataSource; + private readonly IDiaSession _diaSession; + + private readonly List _pdbSymbols; + + public MSDiaSymbolReader(string pdbFile) + { + try + { + _diaDataSource = new DiaSourceClass(); + _diaDataSource.loadDataFromPdb(pdbFile); + _diaDataSource.openSession(out _diaSession); + + _pdbSymbols = new List(); + + _diaSession.getSymbolsByAddr(out IDiaEnumSymbolsByAddr symbolEnum); + int symbolsTotal = 0; + for (IDiaSymbol symbol = symbolEnum.symbolByRVA(0); symbol != null; symbolEnum.Next(1, out symbol, out uint fetched)) + { + symbolsTotal++; + if (symbol.symTag == (uint)SymTagEnum.SymTagFunction || symbol.symTag == (uint)SymTagEnum.SymTagPublicSymbol) + { + _pdbSymbols.Add(symbol.name); + } + } + + Console.WriteLine("PDB file: {0}", pdbFile); + Console.WriteLine("Total symbols: {0}", symbolsTotal); + Console.WriteLine("Public symbols: {0}", _pdbSymbols.Count); + } + catch (Exception ex) + { + throw new Exception($"Error opening PDB file {pdbFile}", ex); + } + } + + public void DumpSymbols() + { + Console.WriteLine("PDB public symbol list:"); + foreach (string symbol in _pdbSymbols.OrderBy(s => s)) + { + Console.WriteLine(symbol); + } + Console.WriteLine("End of PDB public symbol list"); + } + + public bool ContainsSymbol(string symbolName) => _pdbSymbols.Any(s => s.Contains(symbolName)); +} diff --git a/src/tests/Common/PdbChecker/PdbChecker.csproj b/src/tests/Common/PdbChecker/PdbChecker.csproj new file mode 100644 index 00000000000000..a2114f8be3229f --- /dev/null +++ b/src/tests/Common/PdbChecker/PdbChecker.csproj @@ -0,0 +1,17 @@ + + + + Exe + net7.0 + enable + enable + true + + + + + + + + + diff --git a/src/tests/Common/PdbChecker/PdbChecker.sln b/src/tests/Common/PdbChecker/PdbChecker.sln new file mode 100644 index 00000000000000..3ba7e9ae4c3370 --- /dev/null +++ b/src/tests/Common/PdbChecker/PdbChecker.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32708.82 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdbChecker", "PdbChecker.csproj", "{6247A503-5387-4BE1-ACA3-027CADA30CA9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6247A503-5387-4BE1-ACA3-027CADA30CA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6247A503-5387-4BE1-ACA3-027CADA30CA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6247A503-5387-4BE1-ACA3-027CADA30CA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6247A503-5387-4BE1-ACA3-027CADA30CA9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4033231C-763B-4C57-BA35-7C1AC007AD0E} + EndGlobalSection +EndGlobal diff --git a/src/tests/Common/PdbChecker/Program.cs b/src/tests/Common/PdbChecker/Program.cs new file mode 100644 index 00000000000000..41f4209ce648dc --- /dev/null +++ b/src/tests/Common/PdbChecker/Program.cs @@ -0,0 +1,60 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using Dia2Lib; +class Program +{ + public static int Main(string[] args) + { + try + { + TryMain(args); + return 0; + } + catch (Exception ex) + { + Console.Error.WriteLine("Fatal error: {0}", ex); + return 1; + } + } + + private static void TryMain(string[] args) + { + if (args.Length == 0) + { + DisplayUsage(); + return; + } + MSDiaSymbolReader reader = new MSDiaSymbolReader(args[0]); + int matchedSymbols = 0; + int missingSymbols = 0; + for (int symbolArgIndex = 1; symbolArgIndex < args.Length; symbolArgIndex++) + { + string symbolName = args[symbolArgIndex]; + if (reader.ContainsSymbol(symbolName)) + { + matchedSymbols++; + } + else + { + missingSymbols++; + Console.Error.WriteLine("Missing symbol: {0}", symbolName); + } + } + if (missingSymbols > 0) + { + reader.DumpSymbols(); + throw new Exception($"{missingSymbols} missing symbols ({matchedSymbols} symbols matched)"); + } + if (matchedSymbols > 0) + { + Console.WriteLine("Matched all {0} symbols", matchedSymbols); + } + } + + private static void DisplayUsage() + { + Console.WriteLine("Usage: PdbChecker { }"); + } +} diff --git a/src/tests/Common/test_dependencies/test_dependencies.csproj b/src/tests/Common/test_dependencies/test_dependencies.csproj index 112944f3544cf2..f18a1953ef91c1 100644 --- a/src/tests/Common/test_dependencies/test_dependencies.csproj +++ b/src/tests/Common/test_dependencies/test_dependencies.csproj @@ -11,6 +11,7 @@ + diff --git a/src/tests/readytorun/crossgen2/crossgen2smoke.csproj b/src/tests/readytorun/crossgen2/crossgen2smoke.csproj index c233cd8dcbd044..dfefd2c243fb15 100644 --- a/src/tests/readytorun/crossgen2/crossgen2smoke.csproj +++ b/src/tests/readytorun/crossgen2/crossgen2smoke.csproj @@ -5,6 +5,13 @@ true + true + + + + + + From c879e22861e25afae99d2752e168acec0943bc56 Mon Sep 17 00:00:00 2001 From: Tomas Date: Wed, 7 Sep 2022 03:25:04 +0200 Subject: [PATCH 02/12] Revert unnecessary change in the Unix section of CLRTest.Crossgen.targets --- src/tests/Common/CLRTest.CrossGen.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/Common/CLRTest.CrossGen.targets b/src/tests/Common/CLRTest.CrossGen.targets index 87af80d4e14ab9..ff8f875df7449a 100644 --- a/src/tests/Common/CLRTest.CrossGen.targets +++ b/src/tests/Common/CLRTest.CrossGen.targets @@ -81,7 +81,6 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then OneFileCrossgen2() { date +%H:%M:%S __OutputFile=$1 - __PdbFile=$ __ResponseFile="$__OutputFile.rsp" rm $__ResponseFile 2>/dev/null From c4891d3e472c6f11d00e3d12523d573777337dad Mon Sep 17 00:00:00 2001 From: Tomas Rylek Date: Thu, 8 Sep 2022 22:41:21 +0200 Subject: [PATCH 03/12] Instrument the test to fail to check its proper behavior in the lab --- src/tests/readytorun/crossgen2/crossgen2smoke.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/readytorun/crossgen2/crossgen2smoke.csproj b/src/tests/readytorun/crossgen2/crossgen2smoke.csproj index dfefd2c243fb15..4808e35ee48991 100644 --- a/src/tests/readytorun/crossgen2/crossgen2smoke.csproj +++ b/src/tests/readytorun/crossgen2/crossgen2smoke.csproj @@ -11,6 +11,7 @@ + From b68c5cfe73ad2e3fff77cefb02dbc784ed1bb1b7 Mon Sep 17 00:00:00 2001 From: Tomas Rylek Date: Fri, 16 Sep 2022 19:46:37 +0200 Subject: [PATCH 04/12] Modify PdbChecker project to include DiaSymReader --- src/tests/Common/PdbChecker/PdbChecker.csproj | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/tests/Common/PdbChecker/PdbChecker.csproj b/src/tests/Common/PdbChecker/PdbChecker.csproj index a2114f8be3229f..cb4415fd8aa94d 100644 --- a/src/tests/Common/PdbChecker/PdbChecker.csproj +++ b/src/tests/Common/PdbChecker/PdbChecker.csproj @@ -10,8 +10,30 @@ + + + + $(TargetArchitectureForSharedLibraries) + amd64 + Microsoft.DiaSymReader.Native.$(DiaSymReaderTargetArch).dll + $(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\$(DiaSymReaderTargetArchFileName) + + $(CoreCLRArtifactsPath)crossgen2/$(DiaSymReaderTargetArchFileName) + + + + - + From f5b2d9382e968893c766e19134a81e06db131573 Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 20 Sep 2022 01:59:27 +0200 Subject: [PATCH 05/12] Retry building against Dia2Lib --- src/tests/Common/PdbChecker/PdbChecker.csproj | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/tests/Common/PdbChecker/PdbChecker.csproj b/src/tests/Common/PdbChecker/PdbChecker.csproj index cb4415fd8aa94d..214485340c189f 100644 --- a/src/tests/Common/PdbChecker/PdbChecker.csproj +++ b/src/tests/Common/PdbChecker/PdbChecker.csproj @@ -12,28 +12,11 @@ - - $(TargetArchitectureForSharedLibraries) - amd64 - Microsoft.DiaSymReader.Native.$(DiaSymReaderTargetArch).dll - $(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\$(DiaSymReaderTargetArchFileName) - - $(CoreCLRArtifactsPath)crossgen2/$(DiaSymReaderTargetArchFileName) - - - - - + From ebc3f717ead3ae6d27902590bb7823b5bcf87fa7 Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 20 Sep 2022 15:04:25 +0200 Subject: [PATCH 06/12] Make the package reference to TraceEvent unconditional --- src/tests/Common/PdbChecker/PdbChecker.csproj | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/tests/Common/PdbChecker/PdbChecker.csproj b/src/tests/Common/PdbChecker/PdbChecker.csproj index 214485340c189f..cc9d3881353b63 100644 --- a/src/tests/Common/PdbChecker/PdbChecker.csproj +++ b/src/tests/Common/PdbChecker/PdbChecker.csproj @@ -10,13 +10,7 @@ - - - - + From 31ca949bce8adc279604fc7f0173f6545591af80 Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 20 Sep 2022 19:14:24 +0200 Subject: [PATCH 07/12] Fix build of PdbChecker in test_dependencies.csproj --- src/tests/Common/test_dependencies/test_dependencies.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/test_dependencies/test_dependencies.csproj b/src/tests/Common/test_dependencies/test_dependencies.csproj index f18a1953ef91c1..0d64a1e948d012 100644 --- a/src/tests/Common/test_dependencies/test_dependencies.csproj +++ b/src/tests/Common/test_dependencies/test_dependencies.csproj @@ -11,7 +11,7 @@ - + From c8448af353553f61f7e0851593597f6a494a133e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rylek?= Date: Wed, 17 Jan 2024 12:33:29 +0100 Subject: [PATCH 08/12] Fix PdbChecker to not require msdia140 registration --- .../Common/PdbChecker/MSDiaSymbolReader.cs | 24 ++++++++++++++++++- src/tests/Common/PdbChecker/PdbChecker.csproj | 5 +++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs b/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs index bd12bde9fff53b..d4611b2293299b 100644 --- a/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs +++ b/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs @@ -4,10 +4,28 @@ using System; using System.Collections.Generic; using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; using Dia2Lib; class MSDiaSymbolReader { + [return: MarshalAs(UnmanagedType.Interface)] + [DllImport("msdia140.dll", CharSet = CharSet.Unicode, ExactSpelling = true, PreserveSig = false)] + private static extern object DllGetClassObject( + [In] in Guid rclsid, + [In] in Guid riid); + + [ComImport, ComVisible(false), Guid("00000001-0000-0000-C000-000000000046"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IClassFactory + { + void CreateInstance([MarshalAs(UnmanagedType.Interface)] object? aggregator, + [In] in Guid refiid, + [MarshalAs(UnmanagedType.Interface)] out object createdObject); + void LockServer(bool incrementRefCount); + } + private readonly IDiaDataSource _diaDataSource; private readonly IDiaSession _diaSession; @@ -17,7 +35,11 @@ public MSDiaSymbolReader(string pdbFile) { try { - _diaDataSource = new DiaSourceClass(); + var dia140SourceClassGuid = new Guid("{e6756135-1e65-4d17-8576-610761398c3c}"); + IClassFactory diaClassFactory = (IClassFactory)DllGetClassObject(dia140SourceClassGuid, typeof(IClassFactory).GetTypeInfo().GUID); + diaClassFactory.CreateInstance(null, typeof(IDiaDataSource).GetTypeInfo().GUID, out object comObject); + + _diaDataSource = (IDiaDataSource)comObject; _diaDataSource.loadDataFromPdb(pdbFile); _diaDataSource.openSession(out _diaSession); diff --git a/src/tests/Common/PdbChecker/PdbChecker.csproj b/src/tests/Common/PdbChecker/PdbChecker.csproj index cc9d3881353b63..c365a4a78bd264 100644 --- a/src/tests/Common/PdbChecker/PdbChecker.csproj +++ b/src/tests/Common/PdbChecker/PdbChecker.csproj @@ -2,7 +2,10 @@ Exe - net7.0 + $(NetCoreAppToolCurrent) + x64;x86;arm64;arm + AnyCPU + win-x64;win-x86;win-arm;win-arm64 enable enable true From bb9520b1413fb17ad5d2cf627baad502ba9c8612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rylek?= Date: Thu, 18 Jan 2024 01:17:26 +0100 Subject: [PATCH 09/12] Make PdbChecker a tool as it requires the native msdia140 library --- eng/Subsets.props | 1 + .../tools}/PdbChecker/MSDiaSymbolReader.cs | 1 + .../tools}/PdbChecker/PdbChecker.csproj | 11 ++++++----- .../tools}/PdbChecker/PdbChecker.sln | 0 .../Common => coreclr/tools}/PdbChecker/Program.cs | 0 src/tests/Common/Directory.Build.targets | 6 +++++- .../Common/test_dependencies/test_dependencies.csproj | 1 - 7 files changed, 13 insertions(+), 7 deletions(-) rename src/{tests/Common => coreclr/tools}/PdbChecker/MSDiaSymbolReader.cs (99%) rename src/{tests/Common => coreclr/tools}/PdbChecker/PdbChecker.csproj (57%) rename src/{tests/Common => coreclr/tools}/PdbChecker/PdbChecker.sln (100%) rename src/{tests/Common => coreclr/tools}/PdbChecker/Program.cs (100%) diff --git a/eng/Subsets.props b/eng/Subsets.props index 2ed013d619c209..d693e2a58f9ff0 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -338,6 +338,7 @@ $(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo.csproj; $(CoreClrProjectRoot)tools\aot\ILCompiler\repro\repro.csproj; $(CoreClrProjectRoot)tools\r2rtest\R2RTest.csproj; + $(CoreClrProjectRoot)tools\PdbChecker\PdbChecker.csproj; $(CoreClrProjectRoot)tools\AssemblyChecker\AssemblyChecker.csproj" Category="clr" Condition="'$(DotNetBuildFromSource)' != 'true'"/> diff --git a/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs b/src/coreclr/tools/PdbChecker/MSDiaSymbolReader.cs similarity index 99% rename from src/tests/Common/PdbChecker/MSDiaSymbolReader.cs rename to src/coreclr/tools/PdbChecker/MSDiaSymbolReader.cs index d4611b2293299b..ddea0a5ef01743 100644 --- a/src/tests/Common/PdbChecker/MSDiaSymbolReader.cs +++ b/src/coreclr/tools/PdbChecker/MSDiaSymbolReader.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using Dia2Lib; diff --git a/src/tests/Common/PdbChecker/PdbChecker.csproj b/src/coreclr/tools/PdbChecker/PdbChecker.csproj similarity index 57% rename from src/tests/Common/PdbChecker/PdbChecker.csproj rename to src/coreclr/tools/PdbChecker/PdbChecker.csproj index c365a4a78bd264..295191c658acbc 100644 --- a/src/tests/Common/PdbChecker/PdbChecker.csproj +++ b/src/coreclr/tools/PdbChecker/PdbChecker.csproj @@ -1,18 +1,19 @@ + PdbChecker Exe $(NetCoreAppToolCurrent) - x64;x86;arm64;arm AnyCPU - win-x64;win-x86;win-arm;win-arm64 - enable - enable + false + true true + enable + $(RuntimeBinDir)\PdbChecker + false - diff --git a/src/tests/Common/PdbChecker/PdbChecker.sln b/src/coreclr/tools/PdbChecker/PdbChecker.sln similarity index 100% rename from src/tests/Common/PdbChecker/PdbChecker.sln rename to src/coreclr/tools/PdbChecker/PdbChecker.sln diff --git a/src/tests/Common/PdbChecker/Program.cs b/src/coreclr/tools/PdbChecker/Program.cs similarity index 100% rename from src/tests/Common/PdbChecker/Program.cs rename to src/coreclr/tools/PdbChecker/Program.cs diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index 544fac82632599..1ba79d35468740 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -41,7 +41,6 @@ - @@ -109,6 +108,11 @@ True + + + True + + True diff --git a/src/tests/Common/test_dependencies/test_dependencies.csproj b/src/tests/Common/test_dependencies/test_dependencies.csproj index 0d64a1e948d012..112944f3544cf2 100644 --- a/src/tests/Common/test_dependencies/test_dependencies.csproj +++ b/src/tests/Common/test_dependencies/test_dependencies.csproj @@ -11,7 +11,6 @@ - From 702fe866cdf04204a6ee0702b30e8a8f97ca6683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rylek?= Date: Thu, 18 Jan 2024 04:34:19 +0100 Subject: [PATCH 10/12] Propagate the correct architectural version of msdia140 --- src/coreclr/tools/PdbChecker/PdbChecker.csproj | 8 ++++++++ src/tests/Common/Directory.Build.targets | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/coreclr/tools/PdbChecker/PdbChecker.csproj b/src/coreclr/tools/PdbChecker/PdbChecker.csproj index 295191c658acbc..9504bd4a7758e8 100644 --- a/src/coreclr/tools/PdbChecker/PdbChecker.csproj +++ b/src/coreclr/tools/PdbChecker/PdbChecker.csproj @@ -17,4 +17,12 @@ + + + $(TargetArchitecture) + amd64 + + + + diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index 1ba79d35468740..faa9d09b22a96a 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -109,9 +109,7 @@ - - True - + From bb2763fb5a5dd2e22d8b507d2adb278e926edcf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rylek?= Date: Thu, 18 Jan 2024 17:06:39 +0100 Subject: [PATCH 11/12] Remove instrumentation --- src/tests/readytorun/crossgen2/crossgen2smoke.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/readytorun/crossgen2/crossgen2smoke.csproj b/src/tests/readytorun/crossgen2/crossgen2smoke.csproj index 4808e35ee48991..dfefd2c243fb15 100644 --- a/src/tests/readytorun/crossgen2/crossgen2smoke.csproj +++ b/src/tests/readytorun/crossgen2/crossgen2smoke.csproj @@ -11,7 +11,6 @@ - From 1bcf06874f9a171ebfb5c85132649178d0967d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rylek?= Date: Thu, 18 Jan 2024 19:06:38 +0100 Subject: [PATCH 12/12] Don't copy msdia on Linux where it doesn't exist --- src/coreclr/tools/PdbChecker/PdbChecker.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/tools/PdbChecker/PdbChecker.csproj b/src/coreclr/tools/PdbChecker/PdbChecker.csproj index 9504bd4a7758e8..fe2ade9844ceee 100644 --- a/src/coreclr/tools/PdbChecker/PdbChecker.csproj +++ b/src/coreclr/tools/PdbChecker/PdbChecker.csproj @@ -17,7 +17,7 @@ - + $(TargetArchitecture) amd64