diff --git a/Compilers.sln b/Compilers.sln index d93b531611a385aff4c10af4de0028a44a4ed65b..480ebfffd5ed8de734ba10306b8a86bd2d93ff25 100644 --- a/Compilers.sln +++ b/Compilers.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeAnalysisTest", "src\Compilers\Core\CodeAnalysisTest\CodeAnalysisTest.csproj", "{A4C99B85-765C-4C65-9C2A-BB609AAB09E6}" EndProject @@ -75,12 +75,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpWinRTTest", "src\Comp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vbc", "src\Compilers\VisualBasic\vbc\vbc.csproj", "{E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugging", "Debugging", "{07ED9FF4-8027-42B7-A178-0114F26437C2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.PortablePdb", "src\Debugging\Microsoft.DiaSymReader.PortablePdb\Microsoft.DiaSymReader.PortablePdb.csproj", "{F83343BA-B4EA-451C-B6DB-5D645E6171BC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.PortablePdb.UnitTests", "src\Debugging\Microsoft.DiaSymReader.PortablePdb.Tests\Microsoft.DiaSymReader.PortablePdb.UnitTests.csproj", "{DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CscCore", "src\Compilers\CSharp\CscCore\CscCore.csproj", "{E3CD2895-76A8-4D11-A316-EA67CB5EA42C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VbcCore", "src\Compilers\VisualBasic\VbcCore\VbcCore.csproj", "{8CE3A581-2969-4864-A803-013E9D977C3A}" @@ -133,31 +127,31 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xUnit.net", "src\Dependenci EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution - src\Test\Utilities\Shared\TestUtilities.projitems*{76c6f005-c89d-4348-bb4a-391898dbeb52}*SharedItemsImports = 4 - src\Compilers\Server\ServerShared\ServerShared.projitems*{32691768-af9c-4cae-9d0f-10721091b9aa}*SharedItemsImports = 13 - src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d87f0e46-dd1b-46ea-8425-9e185d9b602e}*SharedItemsImports = 13 - src\Test\Utilities\Shared\TestUtilities.projitems*{ccbd3438-3e84-40a9-83ad-533f23bcfca5}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{8ce3a581-2969-4864-a803-013e9d977c3a}*SharedItemsImports = 4 - src\Test\Utilities\Shared\TestUtilities.projitems*{6ff42825-5464-4151-ac55-ed828168c192}*SharedItemsImports = 13 - src\Compilers\Core\CommandLine\CommandLine.projitems*{ad6f474e-e6d4-4217-91f3-b7af1be31ccc}*SharedItemsImports = 13 - src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13 - src\Compilers\Server\ServerShared\ServerShared.projitems*{06b26dcb-7a12-48ef-ae50-708593abd05f}*SharedItemsImports = 4 src\Compilers\Core\CommandLine\CommandLine.projitems*{06b26dcb-7a12-48ef-ae50-708593abd05f}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 4 - src\Compilers\Server\ServerShared\ServerShared.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 - src\Compilers\Core\SharedCollections\SharedCollections.projitems*{afde6bea-5038-4a4a-a88e-dbd2e4088eed}*SharedItemsImports = 4 + src\Compilers\Server\ServerShared\ServerShared.projitems*{06b26dcb-7a12-48ef-ae50-708593abd05f}*SharedItemsImports = 4 src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 src\Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 + src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4 + src\Compilers\Server\ServerShared\ServerShared.projitems*{32691768-af9c-4cae-9d0f-10721091b9aa}*SharedItemsImports = 13 + src\Compilers\Core\CommandLine\CommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 4 + src\Test\Utilities\Shared\TestUtilities.projitems*{6ff42825-5464-4151-ac55-ed828168c192}*SharedItemsImports = 13 + src\Test\Utilities\Shared\TestUtilities.projitems*{76c6f005-c89d-4348-bb4a-391898dbeb52}*SharedItemsImports = 4 src\Compilers\Core\CommandLine\CommandLine.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 4 src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{8ce3a581-2969-4864-a803-013e9d977c3a}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 + src\Compilers\Server\ServerShared\ServerShared.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{ad6f474e-e6d4-4217-91f3-b7af1be31ccc}*SharedItemsImports = 13 + src\Compilers\Core\SharedCollections\SharedCollections.projitems*{afde6bea-5038-4a4a-a88e-dbd2e4088eed}*SharedItemsImports = 4 src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 4 - src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 4 src\Compilers\Core\SharedCollections\SharedCollections.projitems*{c1930979-c824-496b-a630-70f5369a636f}*SharedItemsImports = 13 + src\Test\Utilities\Shared\TestUtilities.projitems*{ccbd3438-3e84-40a9-83ad-533f23bcfca5}*SharedItemsImports = 4 + src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13 src\Compilers\Core\CommandLine\CommandLine.projitems*{d874349c-8bb3-4bdc-8535-2d52ccca1198}*SharedItemsImports = 4 src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d874349c-8bb3-4bdc-8535-2d52ccca1198}*SharedItemsImports = 4 + src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d87f0e46-dd1b-46ea-8425-9e185d9b602e}*SharedItemsImports = 13 src\Compilers\Core\CommandLine\CommandLine.projitems*{e3cd2895-76a8-4d11-a316-ea67cb5ea42c}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -768,45 +762,6 @@ Global {E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}.Release|x64.Build.0 = Release|Any CPU {E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}.Release|x86.ActiveCfg = Release|Any CPU {E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}.Release|x86.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x64.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x64.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x86.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x86.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Any CPU.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|ARM.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|ARM.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x64.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x64.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x86.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x86.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|ARM.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|ARM.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|x64.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|x64.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|x86.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|Any CPU.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|ARM.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|ARM.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|x64.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|x64.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|x86.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|x86.Build.0 = Release|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -1180,8 +1135,6 @@ Global {C1930979-C824-496B-A630-70F5369A636F} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} {FCFA8808-A1B6-48CC-A1EA-0B8CA8AEDA8E} = {32A48625-F0AD-419D-828B-A50BDABA38EA} {E58EE9D7-1239-4961-A0C1-F9EC3952C4C1} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37} - {F83343BA-B4EA-451C-B6DB-5D645E6171BC} = {07ED9FF4-8027-42B7-A178-0114F26437C2} - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0} = {07ED9FF4-8027-42B7-A178-0114F26437C2} {E3CD2895-76A8-4D11-A316-EA67CB5EA42C} = {32A48625-F0AD-419D-828B-A50BDABA38EA} {8CE3A581-2969-4864-A803-013E9D977C3A} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37} {6FF42825-5464-4151-AC55-ED828168C192} = {6F016299-BA96-45BA-9BFF-6C0793979177} diff --git a/CrossPlatform.sln b/CrossPlatform.sln index 8c7ef7aac008a7d036279b4c761facf7bb578316..ce0b769497209dd706db7a0ad9c89bc5fa85722d 100644 --- a/CrossPlatform.sln +++ b/CrossPlatform.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeAnalysis", "src\Compilers\Core\Portable\CodeAnalysis.csproj", "{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}" EndProject @@ -49,10 +49,6 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "AnalyzerDriver", "src\Compi EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedCollections", "src\Compilers\Core\SharedCollections\SharedCollections.shproj", "{C1930979-C824-496B-A630-70F5369A636F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugging", "Debugging", "{5EFE4D73-9608-4E19-83A5-963B02413164}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.PortablePdb", "src\Debugging\Microsoft.DiaSymReader.PortablePdb\Microsoft.DiaSymReader.PortablePdb.csproj", "{F83343BA-B4EA-451C-B6DB-5D645E6171BC}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CscCore", "src\Compilers\CSharp\CscCore\CscCore.csproj", "{E3CD2895-76A8-4D11-A316-EA67CB5EA42C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VbcCore", "src\Compilers\VisualBasic\VbcCore\VbcCore.csproj", "{8CE3A581-2969-4864-A803-013E9D977C3A}" @@ -97,22 +93,22 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Metadata", "src\Dependencie EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiaSymReader", "src\Dependencies\DiaSymReader\DiaSymReader.csproj", "{D2B8B03E-A85D-48A2-818F-9177D89586A9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Composition", "src\Dependencies\Composition\Composition.csproj", "{02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Composition", "src\Dependencies\Composition\Composition.csproj", "{A57DDFE5-AB0E-4371-98E5-11B9218DF11C}" EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution - src\Test\Utilities\Shared\TestUtilities.projitems*{ccbd3438-3e84-40a9-83ad-533f23bcfca5}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{8ce3a581-2969-4864-a803-013e9d977c3a}*SharedItemsImports = 4 - src\Test\Utilities\Shared\TestUtilities.projitems*{6ff42825-5464-4151-ac55-ed828168c192}*SharedItemsImports = 13 + src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 + src\Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 + src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4 src\Compilers\Core\SharedCollections\SharedCollections.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 4 + src\Test\Utilities\Shared\TestUtilities.projitems*{6ff42825-5464-4151-ac55-ed828168c192}*SharedItemsImports = 13 + src\Compilers\Core\CommandLine\CommandLine.projitems*{8ce3a581-2969-4864-a803-013e9d977c3a}*SharedItemsImports = 4 src\Compilers\Core\CommandLine\CommandLine.projitems*{ad6f474e-e6d4-4217-91f3-b7af1be31ccc}*SharedItemsImports = 13 - src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13 src\Compilers\Core\SharedCollections\SharedCollections.projitems*{afde6bea-5038-4a4a-a88e-dbd2e4088eed}*SharedItemsImports = 4 - src\Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 - src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 4 - src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4 src\Compilers\Core\SharedCollections\SharedCollections.projitems*{c1930979-c824-496b-a630-70f5369a636f}*SharedItemsImports = 13 + src\Test\Utilities\Shared\TestUtilities.projitems*{ccbd3438-3e84-40a9-83ad-533f23bcfca5}*SharedItemsImports = 4 + src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13 src\Compilers\Core\CommandLine\CommandLine.projitems*{e3cd2895-76a8-4d11-a316-ea67cb5ea42c}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -428,26 +424,6 @@ Global {57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C}.Release|x64.Build.0 = Release|Any CPU {57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C}.Release|x86.ActiveCfg = Release|Any CPU {57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C}.Release|x86.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x64.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x64.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x86.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x86.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Any CPU.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|ARM.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|ARM.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x64.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x64.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x86.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x86.Build.0 = Release|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -770,26 +746,26 @@ Global {D2B8B03E-A85D-48A2-818F-9177D89586A9}.Release|x64.Build.0 = Debug|Any CPU {D2B8B03E-A85D-48A2-818F-9177D89586A9}.Release|x86.ActiveCfg = Debug|Any CPU {D2B8B03E-A85D-48A2-818F-9177D89586A9}.Release|x86.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|Any CPU.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|ARM.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|ARM.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|x64.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|x64.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|x86.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Debug|x86.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|Any CPU.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|ARM.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|ARM.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|Mixed Platforms.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|x64.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|x64.Build.0 = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|x86.ActiveCfg = Debug|Any CPU - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491}.Release|x86.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|ARM.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|ARM.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|x64.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|x64.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|x86.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Debug|x86.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|Any CPU.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|ARM.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|ARM.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|Mixed Platforms.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|x64.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|x64.Build.0 = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|x86.ActiveCfg = Debug|Any CPU + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C}.Release|x86.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -815,7 +791,6 @@ Global {57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5} {D0BC9BE7-24F6-40CA-8DC6-FCB93BD44B34} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} {C1930979-C824-496B-A630-70F5369A636F} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} - {F83343BA-B4EA-451C-B6DB-5D645E6171BC} = {5EFE4D73-9608-4E19-83A5-963B02413164} {E3CD2895-76A8-4D11-A316-EA67CB5EA42C} = {32A48625-F0AD-419D-828B-A50BDABA38EA} {8CE3A581-2969-4864-A803-013E9D977C3A} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37} {6FF42825-5464-4151-AC55-ED828168C192} = {50509463-6012-4061-99BF-6C5C8262E643} @@ -835,6 +810,6 @@ Global {8635CB8F-D210-41ED-B4FF-71502CDB475C} = {A18BACE1-BB66-4156-8E89-81429A5814C6} {E6796B97-D5C6-45B2-AE46-351D15DCFC71} = {A18BACE1-BB66-4156-8E89-81429A5814C6} {D2B8B03E-A85D-48A2-818F-9177D89586A9} = {A18BACE1-BB66-4156-8E89-81429A5814C6} - {02ABB346-3CC8-4CC2-B6E4-72A60A3E1491} = {A18BACE1-BB66-4156-8E89-81429A5814C6} + {A57DDFE5-AB0E-4371-98E5-11B9218DF11C} = {A18BACE1-BB66-4156-8E89-81429A5814C6} EndGlobalSection EndGlobal diff --git a/NuGet.Config b/NuGet.Config index 943ca8e8eee1142b51b8b9c9e74c03649a78a089..2a8d9913ea7ae77513c61d0259bb4c4f2a8959d5 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -17,10 +17,12 @@ - - - - + + + + + + diff --git a/Roslyn.sln b/Roslyn.sln index 1b8aac12e000a3304980c20f85c544d1c58e6a0a..728e4be773bb5bcda41f820d1f745c7dd869671c 100644 --- a/Roslyn.sln +++ b/Roslyn.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeAnalysisTest", "src\Compilers\Core\CodeAnalysisTest\CodeAnalysisTest.csproj", "{A4C99B85-765C-4C65-9C2A-BB609AAB09E6}" EndProject @@ -266,12 +266,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hosts", "Hosts", "{5CA5F70E EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repl", "Repl", "{81F048A1-B30A-4E74-9BD3-2655DA1DBEA6}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugging", "Debugging", "{62F787B2-1E8B-4A3C-BCC0-0EBAE50B42B7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.PortablePdb", "src\Debugging\Microsoft.DiaSymReader.PortablePdb\Microsoft.DiaSymReader.PortablePdb.csproj", "{F83343BA-B4EA-451C-B6DB-5D645E6171BC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.PortablePdb.UnitTests", "src\Debugging\Microsoft.DiaSymReader.PortablePdb.Tests\Microsoft.DiaSymReader.PortablePdb.UnitTests.csproj", "{DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CscCore", "src\Compilers\CSharp\CscCore\CscCore.csproj", "{E3CD2895-76A8-4D11-A316-EA67CB5EA42C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VbcCore", "src\Compilers\VisualBasic\VbcCore\VbcCore.csproj", "{8CE3A581-2969-4864-A803-013E9D977C3A}" @@ -378,51 +372,53 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perf.Runner", "src\Test\Per EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualStudioTelemetry", "src\VisualStudio\Telemetry\VisualStudioTelemetry.csproj", "{63FB8976-170E-4FB0-ABB8-6A7070C55DC7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiaSymReader.PortablePdb", "src\Dependencies\DiaSymReader.PortablePdb\DiaSymReader.PortablePdb.csproj", "{D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution - src\Test\Utilities\Shared\TestUtilities.projitems*{76c6f005-c89d-4348-bb4a-391898dbeb52}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{06b26dcb-7a12-48ef-ae50-708593abd05f}*SharedItemsImports = 4 + src\Compilers\Server\ServerShared\ServerShared.projitems*{06b26dcb-7a12-48ef-ae50-708593abd05f}*SharedItemsImports = 4 + src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 + src\Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 + src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4 + src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{3140fe61-0856-4367-9aa3-8081b9a80e35}*SharedItemsImports = 13 + src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpResultProvider.projitems*{3140fe61-0856-4367-9aa3-8081b9a80e36}*SharedItemsImports = 13 src\Compilers\Server\ServerShared\ServerShared.projitems*{32691768-af9c-4cae-9d0f-10721091b9aa}*SharedItemsImports = 13 - src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{edc68a0e-c68d-4a74-91b7-bf38ec909888}*SharedItemsImports = 4 - src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d87f0e46-dd1b-46ea-8425-9e185d9b602e}*SharedItemsImports = 13 - src\Test\Utilities\Shared\TestUtilities.projitems*{ccbd3438-3e84-40a9-83ad-533f23bcfca5}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{8ce3a581-2969-4864-a803-013e9d977c3a}*SharedItemsImports = 4 - src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{ace53515-482c-4c6a-e2d2-4242a687dfee}*SharedItemsImports = 4 + src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{3973b09a-4fbf-44a5-8359-3d22ceb71f71}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 4 src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{54e08bf5-f819-404f-a18d-0ab9ea81ea04}*SharedItemsImports = 13 - src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{abdbac1e-350e-4dc3-bb45-3504404545ee}*SharedItemsImports = 4 - src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{76242a2d-2600-49dd-8c15-fea07ecb1842}*SharedItemsImports = 4 - src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{76242a2d-2600-49dd-8c15-fea07ecb1843}*SharedItemsImports = 4 - src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpResultProvider.projitems*{3140fe61-0856-4367-9aa3-8081b9a80e36}*SharedItemsImports = 13 - src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{3140fe61-0856-4367-9aa3-8081b9a80e35}*SharedItemsImports = 13 + src\Compilers\Core\SharedCollections\SharedCollections.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 4 src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpResultProvider.projitems*{60db272a-21c9-4e8d-9803-ff4e132392c8}*SharedItemsImports = 4 - src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{bb3ca047-5d00-48d4-b7d3-233c1265c065}*SharedItemsImports = 13 src\Test\Utilities\Shared\TestUtilities.projitems*{6ff42825-5464-4151-ac55-ed828168c192}*SharedItemsImports = 13 - src\Compilers\Core\SharedCollections\SharedCollections.projitems*{5f8d2414-064a-4b3a-9b42-8e2a04246be5}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{ad6f474e-e6d4-4217-91f3-b7af1be31ccc}*SharedItemsImports = 13 - src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{e8f0baa5-7327-43d1-9a51-644e81ae55f1}*SharedItemsImports = 13 - src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13 - src\Compilers\Server\ServerShared\ServerShared.projitems*{06b26dcb-7a12-48ef-ae50-708593abd05f}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{06b26dcb-7a12-48ef-ae50-708593abd05f}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 4 - src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{a1bcd0ce-6c2f-4f8c-9a48-d9d93928e26d}*SharedItemsImports = 4 - src\Compilers\Server\ServerShared\ServerShared.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 + src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{76242a2d-2600-49dd-8c15-fea07ecb1842}*SharedItemsImports = 4 + src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{76242a2d-2600-49dd-8c15-fea07ecb1843}*SharedItemsImports = 4 + src\Test\Utilities\Shared\TestUtilities.projitems*{76c6f005-c89d-4348-bb4a-391898dbeb52}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 4 + src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{8ce3a581-2969-4864-a803-013e9d977c3a}*SharedItemsImports = 4 src\Compilers\Core\CommandLine\CommandLine.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 - src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpResultProvider.projitems*{bf9dac1e-3a5e-4dc3-bb44-9a64e0d4e9d4}*SharedItemsImports = 4 - src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpResultProvider.projitems*{bf9dac1e-3a5e-4dc3-bb44-9a64e0d4e9d3}*SharedItemsImports = 4 + src\Compilers\Server\ServerShared\ServerShared.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 + src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{a1bcd0ce-6c2f-4f8c-9a48-d9d93928e26d}*SharedItemsImports = 4 + src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{abdbac1e-350e-4dc3-bb45-3504404545ee}*SharedItemsImports = 4 + src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\BasicResultProvider.projitems*{ace53515-482c-4c6a-e2d2-4242a687dfee}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{ad6f474e-e6d4-4217-91f3-b7af1be31ccc}*SharedItemsImports = 13 src\Compilers\Core\SharedCollections\SharedCollections.projitems*{afde6bea-5038-4a4a-a88e-dbd2e4088eed}*SharedItemsImports = 4 - src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{fa0e905d-ec46-466d-b7b2-3b5557f9428c}*SharedItemsImports = 4 - src\Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 - src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 - src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{7ad4fe65-9a30-41a6-8004-aa8f89bcb7f3}*SharedItemsImports = 4 - src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{3973b09a-4fbf-44a5-8359-3d22ceb71f71}*SharedItemsImports = 4 - src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{bedc5a4a-809e-4017-9cfd-6c8d4e1847f0}*SharedItemsImports = 4 src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 4 - src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4 - src\Compilers\Core\CommandLine\CommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 4 + src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{bb3ca047-5d00-48d4-b7d3-233c1265c065}*SharedItemsImports = 13 + src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{bedc5a4a-809e-4017-9cfd-6c8d4e1847f0}*SharedItemsImports = 4 + src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpResultProvider.projitems*{bf9dac1e-3a5e-4dc3-bb44-9a64e0d4e9d3}*SharedItemsImports = 4 + src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpResultProvider.projitems*{bf9dac1e-3a5e-4dc3-bb44-9a64e0d4e9d4}*SharedItemsImports = 4 src\Compilers\Core\SharedCollections\SharedCollections.projitems*{c1930979-c824-496b-a630-70f5369a636f}*SharedItemsImports = 13 - src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d874349c-8bb3-4bdc-8535-2d52ccca1198}*SharedItemsImports = 4 + src\Test\Utilities\Shared\TestUtilities.projitems*{ccbd3438-3e84-40a9-83ad-533f23bcfca5}*SharedItemsImports = 4 + src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13 src\Compilers\Core\CommandLine\CommandLine.projitems*{d874349c-8bb3-4bdc-8535-2d52ccca1198}*SharedItemsImports = 4 + src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d874349c-8bb3-4bdc-8535-2d52ccca1198}*SharedItemsImports = 4 + src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d87f0e46-dd1b-46ea-8425-9e185d9b602e}*SharedItemsImports = 13 src\Compilers\Core\CommandLine\CommandLine.projitems*{e3cd2895-76a8-4d11-a316-ea67cb5ea42c}*SharedItemsImports = 4 + src\Compilers\Core\CommandLine\CommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 4 + src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{e8f0baa5-7327-43d1-9a51-644e81ae55f1}*SharedItemsImports = 13 + src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{edc68a0e-c68d-4a74-91b7-bf38ec909888}*SharedItemsImports = 4 + src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.projitems*{fa0e905d-ec46-466d-b7b2-3b5557f9428c}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2429,46 +2425,6 @@ Global {CF450DCE-D12B-4A11-8D2D-A7A125372C48}.Release|x64.Build.0 = Release|Any CPU {CF450DCE-D12B-4A11-8D2D-A7A125372C48}.Release|x86.ActiveCfg = Release|Any CPU {CF450DCE-D12B-4A11-8D2D-A7A125372C48}.Release|x86.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x64.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x64.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x86.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x86.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Any CPU.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|ARM.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|ARM.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x64.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x64.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x86.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x86.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|ARM.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|ARM.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|x64.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|x64.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|x86.ActiveCfg = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Debug|x86.Build.0 = Debug|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|Any CPU.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|ARM.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|ARM.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|x64.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|x64.Build.0 = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|x86.ActiveCfg = Release|Any CPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0}.Release|x86.Build.0 = Release|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E3CD2895-76A8-4D11-A316-EA67CB5EA42C}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -3239,6 +3195,26 @@ Global {63FB8976-170E-4FB0-ABB8-6A7070C55DC7}.Release|x64.ActiveCfg = Release|x86 {63FB8976-170E-4FB0-ABB8-6A7070C55DC7}.Release|x86.ActiveCfg = Release|x86 {63FB8976-170E-4FB0-ABB8-6A7070C55DC7}.Release|x86.Build.0 = Release|x86 + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|ARM.Build.0 = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|x64.ActiveCfg = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|x64.Build.0 = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|x86.ActiveCfg = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Debug|x86.Build.0 = Debug|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|Any CPU.Build.0 = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|ARM.ActiveCfg = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|ARM.Build.0 = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|x64.ActiveCfg = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|x64.Build.0 = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|x86.ActiveCfg = Release|Any CPU + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3362,8 +3338,6 @@ Global {2491A9B9-C0A8-49EE-9077-A32DE76E1E94} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC} {5CA5F70E-0FDB-467B-B22C-3CD5994F0087} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC} {81F048A1-B30A-4E74-9BD3-2655DA1DBEA6} = {999FBDA2-33DA-4F74-B957-03AC72CCE5EC} - {F83343BA-B4EA-451C-B6DB-5D645E6171BC} = {62F787B2-1E8B-4A3C-BCC0-0EBAE50B42B7} - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0} = {62F787B2-1E8B-4A3C-BCC0-0EBAE50B42B7} {E3CD2895-76A8-4D11-A316-EA67CB5EA42C} = {32A48625-F0AD-419D-828B-A50BDABA38EA} {8CE3A581-2969-4864-A803-013E9D977C3A} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37} {6FF42825-5464-4151-AC55-ED828168C192} = {CAD2965A-19AB-489F-BE2E-7649957F914A} @@ -3411,5 +3385,6 @@ Global {59AD474E-2A35-4E8A-A74D-E33479977FBF} = {DD13507E-D5AF-4B61-B11A-D55D6F4A73A5} {1AA6D2F0-2C40-4AF6-BB79-50AFDCC62720} = {DD13507E-D5AF-4B61-B11A-D55D6F4A73A5} {63FB8976-170E-4FB0-ABB8-6A7070C55DC7} = {8DBA5174-B0AA-4561-82B1-A46607697753} + {D06F8190-AC11-48E6-B0BF-5F17B7EB7B62} = {C2D1346B-9665-4150-B644-075CF1636BAA} EndGlobalSection EndGlobal diff --git a/build/Targets/VSL.Versions.targets b/build/Targets/VSL.Versions.targets index 1e40347b9ba8e5118e6b8b1571fe4fd51c43386f..6189a9d6196240c07c3820843d9d84d6d83c7102 100644 --- a/build/Targets/VSL.Versions.targets +++ b/build/Targets/VSL.Versions.targets @@ -17,6 +17,7 @@ 1.2.0 1.1.0-beta1-60625-03 1.4.0-rc2 + 1.2.0-beta1-60706-02 0.10.6-rc2 1.9.2 1.1.0 @@ -87,10 +88,6 @@ $(RoslynFileVersionBase) $(NuGetPreReleaseVersion)-$(BuildNumberFiveDigitDateStamp)-$(BuildNumberBuildOfTheDayPadded) - - - 1.1.0-beta1 - $(MicrosoftDiaSymReaderPortablePdbVersion)-$(BuildNumber.Split('.')[0])-$(BuildNumber.Split('.')[1].PadLeft(2,'0')) diff --git a/build/Toolset.sln b/build/Toolset.sln index f90e5273bb8be05e16a4c5a52b1f24bedff13293..4f84fb534248401dfa77f4bf2a168947ed5e11b3 100644 --- a/build/Toolset.sln +++ b/build/Toolset.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeAnalysis", "..\src\Compilers\Core\Portable\CodeAnalysis.csproj", "{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}" EndProject @@ -39,10 +39,6 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "AnalyzerDriver", "..\src\Co EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedCollections", "..\src\Compilers\Core\SharedCollections\SharedCollections.shproj", "{C1930979-C824-496B-A630-70F5369A636F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debugging", "Debugging", "{0539DC23-F553-44C6-9D9D-B0CFEB4FFE9A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.PortablePdb", "..\src\Debugging\Microsoft.DiaSymReader.PortablePdb\Microsoft.DiaSymReader.PortablePdb.csproj", "{F83343BA-B4EA-451C-B6DB-5D645E6171BC}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "csc", "..\src\Compilers\CSharp\csc\csc.csproj", "{4B45CA0C-03A0-400F-B454-3D4BCB16AF38}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vbc", "..\src\Compilers\VisualBasic\vbc\vbc.csproj", "{E58EE9D7-1239-4961-A0C1-F9EC3952C4C1}" @@ -57,19 +53,19 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeployCompilerGeneratorTool EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution - ..\src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d87f0e46-dd1b-46ea-8425-9e185d9b602e}*SharedItemsImports = 13 - ..\src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13 - ..\src\Compilers\Core\CommandLine\CommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 4 - ..\src\Compilers\Core\CommandLine\CommandLine.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 - ..\src\Compilers\Server\ServerShared\ServerShared.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 - ..\src\Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 ..\src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 - ..\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 4 + ..\src\Compilers\Core\SharedCollections\SharedCollections.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4 ..\src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4 ..\src\Compilers\Core\CommandLine\CommandLine.projitems*{4b45ca0c-03a0-400f-b454-3d4bcb16af38}*SharedItemsImports = 4 + ..\src\Compilers\Core\CommandLine\CommandLine.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 + ..\src\Compilers\Server\ServerShared\ServerShared.projitems*{9508f118-f62e-4c16-a6f4-7c3b56e166ad}*SharedItemsImports = 4 + ..\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpAnalyzerDriver.projitems*{b501a547-c911-4a05-ac6e-274a50dff30e}*SharedItemsImports = 4 ..\src\Compilers\Core\SharedCollections\SharedCollections.projitems*{c1930979-c824-496b-a630-70f5369a636f}*SharedItemsImports = 13 - ..\src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d874349c-8bb3-4bdc-8535-2d52ccca1198}*SharedItemsImports = 4 + ..\src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{d0bc9be7-24f6-40ca-8dc6-fcb93bd44b34}*SharedItemsImports = 13 ..\src\Compilers\Core\CommandLine\CommandLine.projitems*{d874349c-8bb3-4bdc-8535-2d52ccca1198}*SharedItemsImports = 4 + ..\src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d874349c-8bb3-4bdc-8535-2d52ccca1198}*SharedItemsImports = 4 + ..\src\Compilers\Core\MSBuildTask\Shared\MSBuildTask.Shared.projitems*{d87f0e46-dd1b-46ea-8425-9e185d9b602e}*SharedItemsImports = 13 + ..\src\Compilers\Core\CommandLine\CommandLine.projitems*{e58ee9d7-1239-4961-a0c1-f9ec3952c4c1}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -210,22 +206,6 @@ Global {909B656F-6095-4AC2-A5AB-C3F032315C45}.Release|Mixed Platforms.Build.0 = Release|Any CPU {909B656F-6095-4AC2-A5AB-C3F032315C45}.Release|x64.ActiveCfg = Release|Any CPU {909B656F-6095-4AC2-A5AB-C3F032315C45}.Release|x64.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|ARM.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x64.ActiveCfg = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Debug|x64.Build.0 = Debug|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Any CPU.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|ARM.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|ARM.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x64.ActiveCfg = Release|Any CPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC}.Release|x64.Build.0 = Release|Any CPU {4B45CA0C-03A0-400F-B454-3D4BCB16AF38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4B45CA0C-03A0-400F-B454-3D4BCB16AF38}.Debug|Any CPU.Build.0 = Debug|Any CPU {4B45CA0C-03A0-400F-B454-3D4BCB16AF38}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -324,7 +304,6 @@ Global {909B656F-6095-4AC2-A5AB-C3F032315C45} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC} {D0BC9BE7-24F6-40CA-8DC6-FCB93BD44B34} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} {C1930979-C824-496B-A630-70F5369A636F} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} - {F83343BA-B4EA-451C-B6DB-5D645E6171BC} = {0539DC23-F553-44C6-9D9D-B0CFEB4FFE9A} {4B45CA0C-03A0-400F-B454-3D4BCB16AF38} = {32A48625-F0AD-419D-828B-A50BDABA38EA} {E58EE9D7-1239-4961-A0C1-F9EC3952C4C1} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37} {9508F118-F62E-4C16-A6F4-7C3B56E166AD} = {A41D1B99-F489-4C43-BBDF-96D61B19A6B9} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/Microsoft.DiaSymReader.PortablePdb.Native.UnitTests.vcxproj b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/Microsoft.DiaSymReader.PortablePdb.Native.UnitTests.vcxproj deleted file mode 100644 index cdeee15e137ac88a003e1a9f55a35cf41d0b7f0d..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/Microsoft.DiaSymReader.PortablePdb.Native.UnitTests.vcxproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - Debug - Win32 - - - Release - Win32 - - - - Debug - AnyCPU - {690CACA9-9F32-47DA-B61D-55231257CBA3} - Win32Proj - NativeClientTests - - - - DynamicLibrary - true - Unicode - false - - - DynamicLibrary - false - true - Unicode - false - - - - - - - - - - - - - true - Microsoft.DiaSymReader.PortablePdb.Native.UnitTests - - - false - Microsoft.DiaSymReader.PortablePdb.Native.UnitTests - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;%(PreprocessorDefinitions) - true - $(IntermediateOutputPath);$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) - true - MultiThreadedDebug - ProgramDatabase - - - Windows - true - $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) - /ignore:4099 %(AdditionalOptions) - - - - - Level3 - MaxSpeed - true - true - $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;%(PreprocessorDefinitions) - true - MultiThreaded - - - Windows - true - true - true - $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) - /ignore:4099 %(AdditionalOptions) - - - - - - - - - - - - diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/Microsoft.DiaSymReader.PortablePdb.Native.UnitTests.vcxproj.filters b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/Microsoft.DiaSymReader.PortablePdb.Native.UnitTests.vcxproj.filters deleted file mode 100644 index 706a0546522bee78bcc927a100199bb706a64d49..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/Microsoft.DiaSymReader.PortablePdb.Native.UnitTests.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - - - - Source Files - - - \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/SymReaderTests.cpp b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/SymReaderTests.cpp deleted file mode 100644 index 525209a8de611f5a474168c621c911a78b2b6cad..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.NativeTests/SymReaderTests.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if TODO -#pragma warning( push ) -#pragma warning( disable: 4499 ) -#include "CppUnitTest.h" -#pragma warning (pop) - -#include -#include -#include - -using namespace Microsoft::VisualStudio::CppUnitTestFramework; - -namespace Microsoft_DiaSymReader_PortablePdb_UnitTests -{ - // {E4B18DEF-3B78-46AE-8F50-E67E421BDF70} - static const GUID CLSID_Factory = { 0xE4B18DEF, 0x3B78, 0x46AE, { 0x8F, 0x50, 0xE6, 0x7E, 0x42, 0x1B, 0xDF, 0x70 } }; - - // {AA544D42-28CB-11d3-BD22-0000F80849BD} - static const GUID IID_ISymUnmanagedBinder = { 0xAA544D42, 0x28CB, 0x11d3, { 0xBD, 0x22, 0x00, 0x00, 0xF8, 0x08, 0x49, 0xBD } }; - - // To run these test from command line - // vstest.console.exe Microsoft.DiaSymReader.PortablePdb.Native.UnitTests.dll - TEST_CLASS(SymReaderTests) - { - public: - TEST_METHOD(Instantiation) - { - HRESULT hr; - - hr = CoInitialize(nullptr); - Assert::IsTrue(hr == S_OK || hr == S_FALSE, L"CoInitialize"); - - LPVOID factory; - hr = CoCreateInstance(CLSID_Factory, nullptr, CLSCTX_INPROC_SERVER, IID_ISymUnmanagedBinder, &factory); - Assert::AreEqual(S_OK, hr, L"CoCreateInstance"); - - Assert::AreEqual(1, 1); - } - }; - -} -#endif \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/MethodMapTests.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/MethodMapTests.cs deleted file mode 100644 index 137dcfdf73543302aa29cfa48fd95355f678e133..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/MethodMapTests.cs +++ /dev/null @@ -1,876 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Roslyn.Test.Utilities; -using Xunit; - -namespace Microsoft.DiaSymReader.PortablePdb.UnitTests -{ - using static SymTestHelpers; - - public class MethodMapTests - { - private const int tokenCtor = 0x06000001; - private const int tokenF = 0x06000002; - private const int tokenG = 0x06000003; - private const int tokenE0 = 0x06000004; - private const int tokenE1 = 0x06000005; - private const int tokenH = 0x06000006; - private const int tokenE2 = 0x06000007; - private const int tokenE3 = 0x06000008; - private const int tokenE4 = 0x06000009; - private const int tokenJ1 = 0x0600000A; - private const int tokenI = 0x0600000B; - private const int tokenJ2 = 0x0600000C; - private const int tokenK1 = 0x0600000D; - private const int tokenK2 = 0x0600000E; - private const int tokenK3 = 0x0600000F; - private const int tokenK4 = 0x06000010; - - private static string TokenToConstantName(int token) - { - switch (token) - { - case 0: return "0"; - case tokenCtor: return nameof(tokenCtor); - case tokenF: return nameof(tokenF); - case tokenG: return nameof(tokenG); - case tokenH: return nameof(tokenH); - case tokenE0: return nameof(tokenE0); - case tokenE1: return nameof(tokenE1); - case tokenE2: return nameof(tokenE2); - case tokenE3: return nameof(tokenE3); - case tokenE4: return nameof(tokenE4); - case tokenI: return nameof(tokenI); - case tokenJ1: return nameof(tokenJ1); - case tokenJ2: return nameof(tokenJ2); - case tokenK1: return nameof(tokenK1); - case tokenK2: return nameof(tokenK2); - case tokenK3: return nameof(tokenK3); - case tokenK4: return nameof(tokenK4); - default: return token.ToString("X"); - } - } - - private static readonly Func s_tokenInspector = tokens => - tokens.Length == 0 ? "NoTokens" : "new[] { " + string.Join(", ", tokens.Select(TokenToConstantName)) + " }"; - - private static readonly Func s_ilOffsetInspector = offset => - (offset == int.MaxValue) ? "NoOffset" : (offset >= 0) ? "0x" + offset.ToString("X2") : "-0x" + (-offset).ToString("X2"); - - private static readonly Func s_rangeInspector = ranges => - ranges.Length == 0 ? "NoRange" : "new[] { " + string.Join(", ", ranges.Select(i => "0x" + i.ToString("X2"))) + " }"; - - private static readonly int[] s_noTokens = new int[0]; - private static readonly int[] s_noRange = new int[0]; - private static readonly int s_noOffset = int.MaxValue; - - [Fact] - public void GetMethodFromDocumentPosition_UsingDIA_Native() - { - var symReader = CreateSymReaderFromResource(TestResources.MethodBoundaries.DllAndPdb); - - ISymUnmanagedDocument document1, document2, document3; - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries1.cs", default(Guid), default(Guid), default(Guid), out document1)); - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries2.cs", default(Guid), default(Guid), default(Guid), out document2)); - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries3.cs", default(Guid), default(Guid), default(Guid), out document3)); - - var tokens = GetMethodTokensForEachLine(symReader, document1, 1, 29); - - AssertEx.Equal(new int[][] - { - s_noTokens, // 1 - s_noTokens, // 2 - s_noTokens, // 3 - new[] { tokenG }, // 4 - new[] { tokenCtor, tokenF, tokenG }, // 5 - new[] { tokenCtor, tokenG }, // 6 - new[] { tokenF }, // 7 - new[] { tokenF, tokenG }, // 8 - new[] { tokenCtor, tokenG }, // 9 - new[] { tokenCtor, tokenF }, // 10 - new[] { tokenCtor }, // 11 - new[] { tokenCtor }, // 12 - s_noTokens, // 13 - new[] { tokenCtor }, // 14 - s_noTokens, // 15 - s_noTokens, // 16 - new[] { tokenF }, // 17 - s_noTokens, // 18 - s_noTokens, // 19 - new[] { tokenF }, // 20 - s_noTokens, // 21 - new[] { tokenF }, // 22 - new[] { tokenF }, // 23 - s_noTokens, // 24 - s_noTokens, // 25 - s_noTokens, // 26 - s_noTokens, // 27 - s_noTokens, // 28 - s_noTokens, // 29 - }, tokens, itemInspector: s_tokenInspector, comparer: (x, y) => x.SequenceEqual(y)); - - tokens = GetMethodTokensForEachLine(symReader, document2, 1, 29); - - AssertEx.Equal(new int[][] - { - new[] { tokenF }, // 1 - s_noTokens, // 2 - s_noTokens, // 3 - new[] { tokenH }, // 4 - new[] { tokenE0, tokenH }, // 5 - new[] { tokenE2 }, // 6 - new[] { tokenE1 }, // 7 - new[] { tokenE3 }, // 8 - new[] { tokenH, tokenE4 }, // 9 - new[] { tokenH }, // 10 - new[] { tokenI }, // 11 - new[] { tokenI }, // 12 - new[] { tokenJ1 }, // 13 - new[] { tokenJ1 }, // 14 - new[] { tokenJ1 }, // 15 - new[] { tokenJ2 }, // 16 - new[] { tokenJ2 }, // 17 - s_noTokens, // 18 - s_noTokens, // 19 - s_noTokens, // 20 - s_noTokens, // 21 - new[] { tokenI }, // 22 - new[] { tokenI }, // 23 - s_noTokens, // 24 - s_noTokens, // 25 - s_noTokens, // 26 - s_noTokens, // 27 - new[] { tokenJ2 }, // 28 - s_noTokens, // 29 - }, tokens, itemInspector: s_tokenInspector, comparer: (x, y) => x.SequenceEqual(y)); - - tokens = GetMethodTokensForEachLine(symReader, document3, 1, 29); - - AssertEx.Equal(new int[][] - { - new[] { tokenK1 }, // 1 - new[] { tokenK1 }, // 2 - new[] { tokenK2 }, // 3 - new[] { tokenK2 }, // 4 - new[] { tokenK3 }, // 5 - new[] { tokenK3 }, // 6 - new[] { tokenK4 }, // 7 - new[] { tokenK4 }, // 8 - s_noTokens, // 9 - new[] { tokenK3 }, // 10 - new[] { tokenK2 }, // 11 - new[] { tokenK1 }, // 12 - s_noTokens, // 13 - s_noTokens, // 14 - s_noTokens, // 15 - s_noTokens, // 16 - s_noTokens, // 17 - s_noTokens, // 18 - s_noTokens, // 19 - s_noTokens, // 20 - s_noTokens, // 21 - s_noTokens, // 22 - s_noTokens, // 23 - s_noTokens, // 24 - s_noTokens, // 25 - s_noTokens, // 26 - s_noTokens, // 27 - s_noTokens, // 28 - s_noTokens, // 29 - }, tokens, itemInspector: s_tokenInspector, comparer: (x, y) => x.SequenceEqual(y)); - } - - [Fact] - public void GetMethodFromDocumentPosition_UsingBoundaries_Native() - { - GetMethodFromDocumentPosition_UsingBoundaries(TestResources.MethodBoundaries.DllAndPdb); - } - - [Fact] - public void GetMethodFromDocumentPosition_UsingBoundaries_Portable() - { - GetMethodFromDocumentPosition_UsingBoundaries(TestResources.MethodBoundaries.PortableDllAndPdb); - } - - private void GetMethodFromDocumentPosition_UsingBoundaries(KeyValuePair dllAndPdb) - { - var symReader = CreateSymReaderFromResource(dllAndPdb); - - ISymUnmanagedDocument document1, document2, document3; - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries1.cs", default(Guid), default(Guid), default(Guid), out document1)); - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries2.cs", default(Guid), default(Guid), default(Guid), out document2)); - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries3.cs", default(Guid), default(Guid), default(Guid), out document3)); - - // calling GetSourceExtentInDocument will flip DiaSymReader to MethodBoundaries: - ISymUnmanagedMethod methodCtor; - Assert.Equal(HResult.S_OK, symReader.GetMethod(tokenCtor, out methodCtor)); - int sl, el; - Assert.Equal(HResult.S_OK, ((ISymEncUnmanagedMethod)methodCtor).GetSourceExtentInDocument(document1, out sl, out el)); - - int[][] tokens = GetMethodTokensForEachLine(symReader, document1, 1, 29); - - AssertEx.Equal(new int[][] - { - s_noTokens, // 1 - s_noTokens, // 2 - s_noTokens, // 3 - new int[] { tokenG }, // 4 - new int[] { tokenCtor, tokenF, tokenG }, // 5 - new int[] { tokenCtor, tokenF, tokenG }, // 6 - new int[] { tokenCtor, tokenF, tokenG }, // 7 (DIA: tokenF) - new int[] { tokenCtor, tokenF, tokenG }, // 8 (DIA: tokenF, tokenG) - new int[] { tokenCtor, tokenF, tokenG }, // 9 - new int[] { tokenCtor, tokenF }, // 10 - new int[] { tokenCtor, tokenF }, // 11 - new int[] { tokenCtor, tokenF }, // 12 - new int[] { tokenCtor, tokenF }, // 13 (DIA: 0) - new int[] { tokenCtor, tokenF }, // 14 - new int[] { tokenF }, // 15 (DIA: 0) - new int[] { tokenF }, // 16 (DIA: 0) - new int[] { tokenF }, // 17 - new int[] { tokenF }, // 18 (DIA: 0) - new int[] { tokenF }, // 19 (DIA: 0) - new int[] { tokenF }, // 20 - new int[] { tokenF }, // 21 (DIA: 0) - new int[] { tokenF }, // 22 - new int[] { tokenF }, // 23 - s_noTokens, // 24 - s_noTokens, // 25 - s_noTokens, // 26 - s_noTokens, // 27 - s_noTokens, // 28 - s_noTokens, // 29 - }, tokens, itemInspector: s_tokenInspector, comparer: (x, y) => x.SequenceEqual(y)); - - tokens = GetMethodTokensForEachLine(symReader, document2, 1, 29); - - AssertEx.Equal(new int[][] - { - new int[] { tokenF }, // 1 - s_noTokens, // 2 - s_noTokens, // 3 - new int[] { tokenH }, // 4 - new int[] { tokenE0, tokenH }, // 5 - new int[] { tokenH, tokenE2 }, // 6 (DIA: tokenE2) - new int[] { tokenE1, tokenH }, // 7 - new int[] { tokenH, tokenE3 }, // 8 (DIA: tokenE3) - new int[] { tokenH, tokenE3, tokenE4 }, // 9 - new int[] { tokenH }, // 10 - new int[] { tokenI }, // 11 - new int[] { tokenI }, // 12 - new int[] { tokenJ1, tokenI }, // 13 - new int[] { tokenJ1, tokenI }, // 14 - new int[] { tokenJ1, tokenI }, // 15 - new int[] { tokenI, tokenJ2 }, // 16 (DIA: tokenJ2) (!) - new int[] { tokenI, tokenJ2 }, // 17 (DIA: tokenJ2) (!) - new int[] { tokenI, tokenJ2 }, // 18 (DIA: 0) - new int[] { tokenI, tokenJ2 }, // 19 (DIA: 0) - new int[] { tokenI, tokenJ2 }, // 20 (DIA: 0) - new int[] { tokenI, tokenJ2 }, // 21 (DIA: 0) - new int[] { tokenI, tokenJ2 }, // 22 - new int[] { tokenI, tokenJ2 }, // 23 - new int[] { tokenJ2 }, // 24 (DIA: 0) - new int[] { tokenJ2 }, // 25 (DIA: 0) - new int[] { tokenJ2 }, // 26 (DIA: 0) - new int[] { tokenJ2 }, // 27 (DIA: 0) - new int[] { tokenJ2 }, // 28 (DIA: tokenJ2) (!) - s_noTokens, // 29 - }, tokens, itemInspector: s_tokenInspector, comparer: (x, y) => x.SequenceEqual(y)); - - tokens = GetMethodTokensForEachLine(symReader, document3, 1, 29); - - AssertEx.Equal(new int[][] - { - new int[] { tokenK1 }, // 1 - new int[] { tokenK1 }, // 2 - new int[] { tokenK1, tokenK2 }, // 3 (DIA: tokenK2) - new int[] { tokenK1, tokenK2 }, // 4 (DIA: tokenK2) - new int[] { tokenK1, tokenK2, tokenK3 }, // 5 (DIA: tokenK3) - new int[] { tokenK1, tokenK2, tokenK3 }, // 6 (DIA: tokenK3) - new int[] { tokenK1, tokenK2, tokenK3, tokenK4 }, // 7 (DIA: tokenK4) - new int[] { tokenK1, tokenK2, tokenK3, tokenK4 }, // 8 (DIA: tokenK4) - new int[] { tokenK1, tokenK2, tokenK3 }, // 9 (DIA: 0) - new int[] { tokenK1, tokenK2, tokenK3 }, // 10 (DIA: tokenK3) - new int[] { tokenK1, tokenK2 }, // 11 (DIA: tokenK2) - new int[] { tokenK1 }, // 12 - s_noTokens, // 13 - s_noTokens, // 14 - s_noTokens, // 15 - s_noTokens, // 16 - s_noTokens, // 17 - s_noTokens, // 18 - s_noTokens, // 19 - s_noTokens, // 20 - s_noTokens, // 21 - s_noTokens, // 22 - s_noTokens, // 23 - s_noTokens, // 24 - s_noTokens, // 25 - s_noTokens, // 26 - s_noTokens, // 27 - s_noTokens, // 28 - s_noTokens, // 29 - }, tokens, itemInspector: s_tokenInspector, comparer: (x, y) => x.SequenceEqual(y)); - } - - [Fact] - public void GetSourceExtentInDocument_Native() - { - GetSourceExtentInDocument(TestResources.MethodBoundaries.DllAndPdb); - } - - [Fact] - public void GetSourceExtentInDocument_Portable() - { - GetSourceExtentInDocument(TestResources.MethodBoundaries.PortableDllAndPdb); - } - - private void GetSourceExtentInDocument(KeyValuePair dllAndPdb) - { - var symReader = CreateSymReaderFromResource(dllAndPdb); - - ValidateMethodExtent(symReader, tokenCtor, "MethodBoundaries1.cs", 5, 14); - ValidateNoMethodExtent(symReader, tokenCtor, "MethodBoundaries2.cs"); - ValidateNoMethodExtent(symReader, tokenCtor, "MethodBoundaries3.cs"); - - ValidateMethodExtent(symReader, tokenF, "MethodBoundaries1.cs", 5, 23); - ValidateMethodExtent(symReader, tokenF, "MethodBoundaries2.cs", 1, 1); - ValidateNoMethodExtent(symReader, tokenF, "MethodBoundaries3.cs"); - - ValidateMethodExtent(symReader, tokenG, "MethodBoundaries1.cs", 4, 9); - ValidateNoMethodExtent(symReader, tokenG, "MethodBoundaries2.cs"); - ValidateNoMethodExtent(symReader, tokenG, "MethodBoundaries3.cs"); - - ValidateMethodExtent(symReader, tokenE0, "MethodBoundaries2.cs", 5, 5); - ValidateMethodExtent(symReader, tokenE1, "MethodBoundaries2.cs", 7, 7); - ValidateMethodExtent(symReader, tokenH, "MethodBoundaries2.cs", 4, 10); - ValidateMethodExtent(symReader, tokenE2, "MethodBoundaries2.cs", 6, 6); - ValidateMethodExtent(symReader, tokenE3, "MethodBoundaries2.cs", 8, 9); - ValidateMethodExtent(symReader, tokenE4, "MethodBoundaries2.cs", 9, 9); - ValidateMethodExtent(symReader, tokenJ1, "MethodBoundaries2.cs", 13, 15); - ValidateMethodExtent(symReader, tokenI, "MethodBoundaries2.cs", 11, 23); - ValidateMethodExtent(symReader, tokenJ2, "MethodBoundaries2.cs", 16, 28); - ValidateMethodExtent(symReader, tokenK1, "MethodBoundaries3.cs", 1, 12); - ValidateMethodExtent(symReader, tokenK2, "MethodBoundaries3.cs", 3, 11); - ValidateMethodExtent(symReader, tokenK3, "MethodBoundaries3.cs", 5, 10); - ValidateMethodExtent(symReader, tokenK4, "MethodBoundaries3.cs", 7, 8); - } - - [Fact] - public void GetOffset_Native() - { - var symReader = CreateSymReaderFromResource(TestResources.MethodBoundaries.DllAndPdb); - - ISymUnmanagedDocument document1; - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries1.cs", default(Guid), default(Guid), default(Guid), out document1)); - - // GetOffsets seems to be very much broken. Not returning correct values for lines that are shared among multiple methods and - // for lines that are outside of the specified method. - - int[] offsets = GetILOffsetForEachLine(symReader, tokenCtor, document1, 1, 29); - AssertEx.Equal(new int[] - { - s_noOffset, // 1 - s_noOffset, // 2 - s_noOffset, // 3 - 0x5C, // 4 (G) - 0x00, // 5 (OK) - 0x00, // 6 (OK) - 0x38, // 7 (F) - 0x3E, // 8 (F) - 0x1C, // 9 (OK) - 0x23, // 10 (OK) - 0x24, // 11 (OK) - 0x2A, // 12 (OK) - s_noOffset, // 13 - 0x11, // 14 (OK) - s_noOffset, // 15 - s_noOffset, // 16 - 0x2B, // 17 (F) - s_noOffset, // 18 - s_noOffset, // 19 - 0x50, // 20 (F) - s_noOffset, // 21 - 0x56, // 22 (F) - 0x5A, // 23 (F) - s_noOffset, // 24 - s_noOffset, // 25 - s_noOffset, // 26 - s_noOffset, // 27 - s_noOffset, // 28 - s_noOffset // 29 - }, offsets, itemInspector: s_ilOffsetInspector); - - offsets = GetILOffsetForEachLine(symReader, tokenF, document1, 1, 29); - AssertEx.Equal(new int[] - { - s_noOffset, // 1 - s_noOffset, // 2 - s_noOffset, // 3 - 0x31, // 4 - -0x2B, // 5 - -0x2B, // 6 - 0x0D, // 7 - 0x13, // 8 - -0x0F, // 9 - -0x08, // 10 - -0x07, // 11 - -0x01, // 12 - s_noOffset, // 13 - -0x1A, // 14 - s_noOffset, // 15 - s_noOffset, // 16 - 0x00, // 17 - s_noOffset, // 18 - s_noOffset, // 19 - 0x25, // 20 - s_noOffset, // 21 - 0x2B, // 22 - 0x2F, // 23 - s_noOffset, // 24 - s_noOffset, // 25 - s_noOffset, // 26 - s_noOffset, // 27 - s_noOffset, // 28 - s_noOffset // 29 - }, offsets, itemInspector: s_ilOffsetInspector); - } - - [Fact] - public void GetOffset_Portable() - { - var symReader = CreateSymReaderFromResource(TestResources.MethodBoundaries.PortableDllAndPdb); - - ISymUnmanagedDocument document1, document3; - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries1.cs", default(Guid), default(Guid), default(Guid), out document1)); - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries3.cs", default(Guid), default(Guid), default(Guid), out document3)); - - int[] offsets = GetILOffsetForEachLine(symReader, tokenCtor, document1, 1, 29); - AssertEx.Equal(new int[] - { - s_noOffset, // 1 - s_noOffset, // 2 - s_noOffset, // 3 - s_noOffset, // 4 - 0x00, // 5 - 0x00, // 6 - 0x00, // 7 - s_noOffset, // 8 - 0x1C, // 9 - 0x23, // 10 - 0x24, // 11 - 0x2A, // 12 - s_noOffset, // 13 - 0x11, // 14 - s_noOffset, // 15 - s_noOffset, // 16 - s_noOffset, // 17 - s_noOffset, // 18 - s_noOffset, // 19 - s_noOffset, // 20 - s_noOffset, // 21 - s_noOffset, // 22 - s_noOffset, // 23 - s_noOffset, // 24 - s_noOffset, // 25 - s_noOffset, // 26 - s_noOffset, // 27 - s_noOffset, // 28 - s_noOffset // 29 - }, offsets, itemInspector: s_ilOffsetInspector); - - offsets = GetILOffsetForEachLine(symReader, tokenF, document1, 1, 29); - AssertEx.Equal(new int[] - { - s_noOffset, // 1 - s_noOffset, // 2 - s_noOffset, // 3 - s_noOffset, // 4 - 0x07, // 5 (the first IL offset) - s_noOffset, // 6 - 0x0D, // 7 - 0x13, // 8 - s_noOffset, // 9 - 0x01, // 10 - s_noOffset, // 11 - s_noOffset, // 12 - s_noOffset, // 13 - s_noOffset, // 14 - s_noOffset, // 15 - s_noOffset, // 16 - 0x00, // 17 - s_noOffset, // 18 - s_noOffset, // 19 - 0x25, // 20 - s_noOffset, // 21 - 0x2B, // 22 - 0x2F, // 23 - s_noOffset, // 24 - s_noOffset, // 25 - s_noOffset, // 26 - s_noOffset, // 27 - s_noOffset, // 28 - s_noOffset // 29 - }, offsets, itemInspector: s_ilOffsetInspector); - - offsets = GetILOffsetForEachLine(symReader, tokenK1, document3, 1, 14); - AssertEx.Equal(new int[] - { - 0x00, // 1 - 0x01, // 2 - 0x01, // 3 - 0x01, // 4 - 0x01, // 5 - 0x01, // 6 - 0x01, // 7 - 0x01, // 8 - 0x01, // 9 - 0x01, // 10 - 0x01, // 11 - 0x07, // 12 - s_noOffset, // 13 - s_noOffset, // 14 - }, offsets, itemInspector: s_ilOffsetInspector); - } - - [Fact] - public void GetRanges_Portable() - { - GetRanges(TestResources.MethodBoundaries.PortableDllAndPdb); - } - - [Fact] - public void GetRanges_Native() - { - GetRanges(TestResources.MethodBoundaries.DllAndPdb); - } - - public void GetRanges(KeyValuePair dllAndPdb) - { - var symReader = CreateSymReaderFromResource(dllAndPdb); - bool isPortable = (symReader as SymReader) != null; - - ISymUnmanagedDocument document1, document3; - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries1.cs", default(Guid), default(Guid), default(Guid), out document1)); - Assert.Equal(HResult.S_OK, symReader.GetDocument("MethodBoundaries3.cs", default(Guid), default(Guid), default(Guid), out document3)); - - var ranges = GetILOffsetRangesForEachLine(symReader, tokenCtor, document1, 1, 29); - - AssertEx.Equal(new int[][] - { - s_noRange, // 1 - s_noRange, // 2 - s_noRange, // 3 - s_noRange, // 4 - new[] { 0x00, 0x11 }, // 5 - new[] { 0x00, 0x11 }, // 6 - isPortable ? new[] { 0x00, 0x11 } : s_noRange, // 7 (bug in DSR) - s_noRange, // 8 - new[] { 0x1C, 0x23 }, // 9 - new[] { 0x23, 0x24 }, // 10 - new[] { 0x24, 0x2A }, // 11 - new[] { 0x2A, 0x2B }, // 12 - s_noRange, // 13 - new[] { 0x11, 0x1C }, // 14 - s_noRange, // 15 - s_noRange, // 16 - s_noRange, // 17 - s_noRange, // 18 - s_noRange, // 19 - s_noRange, // 20 - s_noRange, // 21 - s_noRange, // 22 - s_noRange, // 23 - s_noRange, // 24 - s_noRange, // 25 - s_noRange, // 26 - s_noRange, // 27 - s_noRange, // 28 - s_noRange // 29 - }, ranges, itemInspector: s_rangeInspector, comparer: (x, y) => x.SequenceEqual(y)); - - ranges = GetILOffsetRangesForEachLine(symReader, tokenF, document1, 1, 29); - - AssertEx.Equal(new int[][] - { - s_noRange, // 1 - s_noRange, // 2 - s_noRange, // 3 - s_noRange, // 4 - new[] { 0x07, 0x0D, 0x19, 0x1F }, // 5 - s_noRange, // 6 - new[] { 0x0D, 0x13 }, // 7 - new[] { 0x13, 0x19 }, // 8 - s_noRange, // 9 - new[] { 0x01, 0x07 }, // 10 - s_noRange, // 11 - s_noRange, // 12 - s_noRange, // 13 - s_noRange, // 14 - s_noRange, // 15 - s_noRange, // 16 - new[] { 0x00, 0x01 }, // 17 - s_noRange, // 18 - s_noRange, // 19 - new[] { 0x25, 0x2B }, // 20 - s_noRange, // 21 - new[] { 0x2B, 0x2F }, // 22 - new[] { 0x2F, 0x31 }, // 23 - s_noRange, // 24 - s_noRange, // 25 - s_noRange, // 26 - s_noRange, // 27 - s_noRange, // 28 - s_noRange // 29 - }, ranges, itemInspector: s_rangeInspector, comparer: (x, y) => x.SequenceEqual(y)); - } - - [Fact] - public void GetRangesHiddenSP_Portable() - { - GetRangesHiddenSP(TestResources.Async.PortableDllAndPdb); - } - - [Fact] - public void GetRangesHiddenSP_Native() - { - GetRangesHiddenSP(TestResources.Async.DllAndPdb); - } - - public void GetRangesHiddenSP(KeyValuePair dllAndPdb) - { - var symReader = CreateSymReaderFromResource(dllAndPdb); - - const int M1_MoveNext = 0x06000005; - - ISymUnmanagedDocument document; - Assert.Equal(HResult.S_OK, symReader.GetDocument(@"C:\Async.cs", default(Guid), default(Guid), default(Guid), out document)); - - var ranges = GetILOffsetRangesForEachLine(symReader, M1_MoveNext, document, 6, 16); - - AssertEx.Equal(new int[][] - { - s_noRange, // 6 - s_noRange, // 7 - new[] { 0x27, 0x28 }, // 8 - new[] { 0x28, 0x34 }, // 9 - new[] { 0x90, 0x9D }, // 10 - new[] { 0xFB, 0x108 }, // 11 - s_noRange, // 12 - new[] { 0x163, 0x167 }, // 13 - new[] { 0x181, 0x189 }, // 14 - s_noRange, // 15 - s_noRange // 16 - }, ranges, itemInspector: s_rangeInspector, comparer: (x, y) => x.SequenceEqual(y)); - } - - [Fact] - public void FindClosestLine1_Portable() - { - FindClosestLine1(TestResources.MethodBoundaries.PortableDllAndPdb); - } - - [Fact] - public void FindClosestLine1_Native() - { - FindClosestLine1(TestResources.MethodBoundaries.DllAndPdb); - } - - private void FindClosestLine1(KeyValuePair dllAndPdb) - { - var symReader = CreateSymReaderFromResource(dllAndPdb); - - ISymUnmanagedDocument document1, document2, document3; - Assert.Equal(HResult.S_OK, symReader.GetDocument(@"MethodBoundaries1.cs", default(Guid), default(Guid), default(Guid), out document1)); - Assert.Equal(HResult.S_OK, symReader.GetDocument(@"MethodBoundaries2.cs", default(Guid), default(Guid), default(Guid), out document2)); - Assert.Equal(HResult.S_OK, symReader.GetDocument(@"MethodBoundaries3.cs", default(Guid), default(Guid), default(Guid), out document3)); - - var closestLines = FindClosestLineForEachLine(document1, 1, 29); - AssertEx.Equal(new int[] - { - 4, // 1 - 4, // 2 - 4, // 3 - 4, // 4 - 5, // 5 - 7, // 6 - 7, // 7 - 8, // 8 - 9, // 9 - 10, // 10 - 11, // 11 - 12, // 12 - 14, // 13 - 14, // 14 - 17, // 15 - 17, // 16 - 17, // 17 - 20, // 18 - 20, // 19 - 20, // 20 - 22, // 21 - 22, // 22 - 23, // 23 - 0, // 24 - 0, // 25 - 0, // 26 - 0, // 27 - 0, // 28 - 0 // 29 - }, closestLines); - - closestLines = FindClosestLineForEachLine(document2, 1, 29); - AssertEx.Equal(new int[] - { - 1, // 1 - 4, // 2 - 4, // 3 - 4, // 4 - 5, // 5 - 6, // 6 - 7, // 7 - 8, // 8 - 9, // 9 - 10, // 10 - 11, // 11 - 12, // 12 - 13, // 13 - 14, // 14 - 15, // 15 - 16, // 16 - 17, // 17 - 22, // 18 - 22, // 19 - 22, // 20 - 22, // 21 - 22, // 22 - 23, // 23 - 28, // 24 - 28, // 25 - 28, // 26 - 28, // 27 - 28, // 28 - 0 // 29 - }, closestLines); - - closestLines = FindClosestLineForEachLine(document3, 1, 29); - AssertEx.Equal(new int[] - { - 1, // 1 - 2, // 2 - 3, // 3 - 4, // 4 - 5, // 5 - 6, // 6 - 7, // 7 - 10, // 8 - 10, // 9 - 10, // 10 - 11, // 11 - 12, // 12 - 0, // 13 - 0, // 14 - 0, // 15 - 0, // 16 - 0, // 17 - 0, // 18 - 0, // 19 - 0, // 20 - 0, // 21 - 0, // 22 - 0, // 23 - 0, // 24 - 0, // 25 - 0, // 26 - 0, // 27 - 0, // 28 - 0 // 29 - }, closestLines); - } - - [Fact] - public void FindClosestLine2_Portable() - { - var symReader = CreateSymReaderFromResource(TestResources.Documents.PortableDllAndPdb); - - ISymUnmanagedDocument document1, document2; - Assert.Equal(HResult.S_OK, symReader.GetDocument(@"C:\a\b\X.cs", default(Guid), default(Guid), default(Guid), out document1)); - Assert.Equal(HResult.S_OK, symReader.GetDocument(@"C:\a\B\x.cs", default(Guid), default(Guid), default(Guid), out document2)); - - var closestLines = FindClosestLineForEachLine(document1, 120, 135); - AssertEx.Equal(new int[] - { - 120, // 120 - 0, // 121 - 0, // 122 - 0, // 123 - 0, // 124 - 0, // 125 - 0, // 126 - 0, // 127 - 0, // 128 - 0, // 129 - 0, // 130 - 0, // 131 - 0, // 132 - 0, // 133 - 0, // 134 - 0, // 135 - }, closestLines); - - closestLines = FindClosestLineForEachLine(document2, 120, 135); - AssertEx.Equal(new int[] - { - 130, // 120 - 130, // 121 - 130, // 122 - 130, // 123 - 130, // 124 - 130, // 125 - 130, // 126 - 130, // 127 - 130, // 128 - 130, // 129 - 130, // 130 - 131, // 131 - 0, // 132 - 0, // 133 - 0, // 134 - 0 // 135 - }, closestLines); - } - - [Fact] - public void FindClosestLine2_Native() - { - var symReader = CreateSymReaderFromResource(TestResources.Documents.DllAndPdb); - - ISymUnmanagedDocument document1; - Assert.Equal(HResult.S_OK, symReader.GetDocument(@"C:\a\b\X.cs", default(Guid), default(Guid), default(Guid), out document1)); - - var closestLines = FindClosestLineForEachLine(document1, 120, 135); - AssertEx.Equal(new int[] - { - 120, // 120 - 130, // 121 - 130, // 122 - 130, // 123 - 130, // 124 - 130, // 125 - 130, // 126 - 130, // 127 - 130, // 128 - 130, // 129 - 130, // 130 - 131, // 131 - 0, // 132 - 0, // 133 - 0, // 134 - 0, // 135 - }, closestLines); - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Microsoft.DiaSymReader.PortablePdb.UnitTests.csproj b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Microsoft.DiaSymReader.PortablePdb.UnitTests.csproj deleted file mode 100644 index abc7df89183303a9d12ee81205eb49e591e6e3b5..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Microsoft.DiaSymReader.PortablePdb.UnitTests.csproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - true - Debug - AnyCPU - {DEB3D675-5A3C-46DA-8945-F2EFAB135EA0} - Library - Microsoft.DiaSymReader.PortablePdb.UnitTests - Microsoft.DiaSymReader.PortablePdb.UnitTests - true - ..\..\..\..\ - true - v5.0 - - - .NETPortable - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - - - - {8635cb8f-d210-41ed-b4ff-71502cdb475c} - xUnit.net - - - {f83343ba-b4ea-451c-b6db-5d645e6171bc} - Microsoft.DiaSymReader.PortablePdb - - - - - Async.dll - - - Async.pdb - - - Async.dllx - - - Async.pdbx - - - Documents.dllx - - - Documents.pdbx - - - Documents.dll - - - Documents.pdb - - - Scopes.dll - - - Scopes.pdbx - - - MethodBoundaries.dll - - - MethodBoundaries.pdb - - - MethodBoundaries.dllx - - - MethodBoundaries.pdbx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/ResourceLoader.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/ResourceLoader.cs deleted file mode 100644 index 011005dde01adb60d0fe7ed442eb7a941fdae79c..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/ResourceLoader.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.IO; -using System.Reflection; - -namespace TestResources -{ - internal static class ResourceLoader - { - private static Stream GetResourceStream(string name) - { - var assembly = typeof(ResourceLoader).GetTypeInfo().Assembly; - - var stream = assembly.GetManifestResourceStream(name); - if (stream == null) - { - throw new InvalidOperationException($"Resource '{name}' not found in {assembly.FullName}."); - } - - return stream; - } - - private static byte[] GetResourceBlob(string name) - { - using (var stream = GetResourceStream(name)) - { - var bytes = new byte[stream.Length]; - using (var memoryStream = new MemoryStream(bytes)) - { - stream.CopyTo(memoryStream); - } - - return bytes; - } - } - - public static byte[] GetOrCreateResource(ref byte[] resource, string name) - { - if (resource == null) - { - resource = GetResourceBlob(name); - } - - return resource; - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.cmd b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.cmd deleted file mode 100644 index f773ea39118c84c0b18ca50ede7b76a3790267a2..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.cmd +++ /dev/null @@ -1,7 +0,0 @@ -csc /target:library /debug:portable /optimize- /deterministic Async.cs -copy /y Async.pdb Async.pdbx -copy /y Async.dll Async.dllx - -csc /target:library /debug+ /optimize- /deterministic Async.cs - - diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.cs deleted file mode 100644 index 1b573a36dfcc9bb48268dff3234b24c676908edc..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.cs +++ /dev/null @@ -1,21 +0,0 @@ -#line 1 "C:\Async.cs" -#pragma checksum "C:\Async.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "DBEB2A067B2F0E0D678A002C587A2806056C3DCE" - -using System.Threading.Tasks; - -public class C -{ - public async Task M1() - { - await Task.FromResult(0); - await Task.FromResult(1); - await Task.FromResult(2); - - return 1; - } - - public async void M2() - { - await Task.FromResult(0); - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.dll b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.dll deleted file mode 100644 index e2df3122a9575c1d6ff8efaffa11f4dfa78955ac..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.dll and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.dllx b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.dllx deleted file mode 100644 index 23cbc33f484888654e6dc2179f269f9716951a12..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.dllx and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.pdb b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.pdb deleted file mode 100644 index 75f8f105b89a564a65cfceb885d474b05f61ab74..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.pdb and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.pdbx b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.pdbx deleted file mode 100644 index f5442e6ab32cc98351d5341985b17bf93bec6956..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Async.pdbx and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.cmd b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.cmd deleted file mode 100644 index 5dca31c302ab69fde1ff182680e7246bc94ffbb6..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.cmd +++ /dev/null @@ -1,7 +0,0 @@ -csc /target:library /debug:portable /optimize- /deterministic Documents.cs -copy /y Documents.pdb Documents.pdbx -copy /y Documents.dll Documents.dllx - -csc /target:library /debug+ /optimize- /deterministic Documents.cs - - diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.cs deleted file mode 100644 index 65217012c1068627302daf4612b9b479b84f3a69..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.cs +++ /dev/null @@ -1,38 +0,0 @@ -#line 1 "C:\Documents.cs" -#pragma checksum "C:\Documents.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "DBEB2A067B2F0E0D678A002C587A2806056C3DCE" -using System; - -class C -{ - public void M() - { -#line 10 "C:\a\b\c\d\1.cs" - Console.WriteLine(1); -#line 20 "C:\a\b\c\D\2.cs" - Console.WriteLine(2); -#line 30 "C:\a\b\C\d\3.cs" - Console.WriteLine(3); -#line 40 - Console.WriteLine(4); -#line hidden - Console.WriteLine(); -#line 50 "C:\a\b\c\d\x.cs" - Console.WriteLine(5); -#line 60 "C:\A\b\c\x.cs" - Console.WriteLine(5); -#line 70 "C:\a\b\x.cs" - Console.WriteLine(5); -#line 80 "C:\a\B\3.cs" - Console.WriteLine(3); -#line 90 "C:\a\B\c/4.cs" - Console.WriteLine(4); -#line 100 "C:\*\5.cs" - Console.WriteLine(5); -#line 110 ":6.cs" - Console.WriteLine(6); -#line 120 "C:\a\b\X.cs" - Console.WriteLine(7); -#line 130 "C:\a\B\x.cs" - Console.WriteLine(8); - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.dll b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.dll deleted file mode 100644 index dddd2912bb0f33670ffa697f246fe57868fecb40..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.dll and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.dllx b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.dllx deleted file mode 100644 index d8b871512c14db63971cc3d86cd9952ad89f9dfe..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.dllx and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.pdb b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.pdb deleted file mode 100644 index 4e9d3eb195de1bb22a1de8e9139288dde2c98f1d..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.pdb and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.pdbx b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.pdbx deleted file mode 100644 index ee0a1421085feeebf829e4f3b0ad972cc2e9c22c..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Documents.pdbx and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.cmd b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.cmd deleted file mode 100644 index e1309f2e78289efaba5c3acfd240421726dafad3..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.cmd +++ /dev/null @@ -1,7 +0,0 @@ -csc /target:library /debug:portable /optimize- /deterministic MethodBoundaries.cs -copy /y MethodBoundaries.pdb MethodBoundaries.pdbx -copy /y MethodBoundaries.dll MethodBoundaries.dllx - -csc /target:library /debug+ /optimize- /deterministic MethodBoundaries.cs - - diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.cs deleted file mode 100644 index b22366448bf541ec5e21440bcf28f83733800a07..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.cs +++ /dev/null @@ -1,147 +0,0 @@ -#line 1 "C:\MethodBoundaries1.cs" -#pragma checksum "C:\MethodBoundaries1.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "DBEB2A067B2F0E0D678A002C587A2806056C3DCE" - -partial class C -{ - int i = F() // 5 - + // (6) - F(); // (7) - - public C() // 9 - { // 10 - F(); // 11 - } // 12 - - int j = F(); // 14 - - public static int F() - { // 17 -#line 10 "C:\MethodBoundaries1.cs" - F(); // 10 -#line 5 "C:\MethodBoundaries1.cs" - F(); // 5 - - F(); // 7 - F(); // 8 - -#line 5 "C:\MethodBoundaries1.cs" - F(); // 5 - -#line 1 "C:\MethodBoundaries2.cs" - F(); // 2-1 - -#line 20 "C:\MethodBoundaries1.cs" - F(); // 20 - - return 1; // 22 - } // 23 - - public static int G() -#line 4 "C:\MethodBoundaries1.cs" - { // 4 - F( // 5 - // (6) - ); // (7) - return 1; // 8 - } // 9 - -#line 5 "C:\MethodBoundaries2.cs" - public static int E0() => F(); // 5 - -#line 7 "C:\MethodBoundaries2.cs" - public static int E1() => F(); // 7 - - public static int H() -#line 4 "C:\MethodBoundaries2.cs" - { // 4 - F( // 5 - // (6) - // (7) - ); // (8) - return 1; // 9 - } // 10 - -#line 6 "C:\MethodBoundaries2.cs" - public static int E2() => F(); // 6 - - public static int E3() => -#line 8 "C:\MethodBoundaries2.cs" - F() + // 8 - F(); // (9) - - public static int E4() => -#line 9 "C:\MethodBoundaries2.cs" - F(); // 9 - - // Overlapping sequence point spans from different methods. - - public static void J1() -#line 13 "C:\MethodBoundaries2.cs" - { // 13 - F(); // 14 - } // 15 - - public static int I() -#line 11 "C:\MethodBoundaries2.cs" - { // 11 - F( // 12 - // (13) overlaps with J1 - // (14) overlaps with J1 - // (15) overlaps with J1 - // (16) overlaps with J2 - // (17) overlaps with J2 - // (18) - // (19) - // (20) - ); // (21) - return 1; // 22 - } // 23 - - public static void J2() -#line 16 "C:\MethodBoundaries2.cs" - { // 16 - F(); // 17 -#line 28 "C:\MethodBoundaries2.cs" - } // 28 - - public static void K1() -#line 1 "C:\MethodBoundaries3.cs" - { // 1 K1 - F( // 2 K1 - // (3) K1, K2 - // (4) K1, K2 - // (5) K1, K2, K3 - // (6) K1, K2, K3 - // (7) K1, K2, K3, K4 - // (8) K1, K2, K3, K4 - // (9) K1, K2, K3 - // (10) K1, K2, K3 - ); // (11) K1, K2 - } // 12 K1 - - public static void K2() -#line 3 "C:\MethodBoundaries3.cs" - { // 3 - F( // 4 - // (5) - // (6) - // (7) - // (8) - // (9) - ); // (10) - } // 11 - - public static void K3() -#line 5 "C:\MethodBoundaries3.cs" - { // 5 - F( // 6 - // (7) - // (8) - ); // (9) - } // 10 - - public static void K4() => -#line 7 "C:\MethodBoundaries3.cs" - F( // 7 - ); // (8) -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.dll b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.dll deleted file mode 100644 index 7d2b1474059128aec5761d26fac4a983e1b8b490..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.dll and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.dllx b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.dllx deleted file mode 100644 index 70bde6eb10c16de5d6bfaae85a60fc67a82604fd..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.dllx and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.pdb b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.pdb deleted file mode 100644 index 0f01476d40ceec599c72415be495cfa1d21faf92..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.pdb and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.pdbx b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.pdbx deleted file mode 100644 index c1e50006f5705220d1aa6d083eaa9289e88a2da2..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/MethodBoundaries.pdbx and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.cmd b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.cmd deleted file mode 100644 index 998b7d2aaf0938c0fbcda701e626ddc2b25f9ef2..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.cmd +++ /dev/null @@ -1,4 +0,0 @@ -csc /target:library /debug:portable /optimize- /deterministic Scopes.cs -copy /y Scopes.pdb Scopes.pdbx -del Scopes.pdb - diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.cs deleted file mode 100644 index dd238eda2c0ddf237cbf6a06d9222f538a61e9b4..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.cs +++ /dev/null @@ -1,75 +0,0 @@ -#line 1 "C:\Scopes.cs" -#pragma checksum "C:\Scopes.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "DBEB2A067B2F0E0D678A002C587A2806056C3DCE" -#pragma warning disable 219 // unused const - -using System; -using System.Collections.Generic; - -class X { } - -public class C -{ - enum EnumI1 : sbyte { A = 1 } - enum EnumU1 : byte { A = 2 } - enum EnumI2 : short { A = 3 } - enum EnumU2 : ushort { A = 4 } - enum EnumI4 : int { A = 5 } - enum EnumU4 : uint { A = 6 } - enum EnumI8 : long { A = 7 } - enum EnumU8 : ulong { A = 8 } - - public static void F() - { - const bool B = false; - const char C = '\0'; - const sbyte I1 = 1; - const byte U1 = 2; - const short I2 = 3; - const ushort U2 = 4; - const int I4 = 5; - const uint U4 = 6; - const long I8 = 7; - const ulong U8 = 8; - const float R4 = (float)9.1; - const double R8 = 10.2; - - const C.EnumI1 EI1 = C.EnumI1.A; - const C.EnumU1 EU1 = C.EnumU1.A; - const C.EnumI2 EI2 = C.EnumI2.A; - const C.EnumU2 EU2 = C.EnumU2.A; - const C.EnumI4 EI4 = C.EnumI4.A; - const C.EnumU4 EU4 = C.EnumU4.A; - const C.EnumI8 EI8 = C.EnumI8.A; - const C.EnumU8 EU8 = C.EnumU8.A; - - const string StrWithNul = "\0"; - const string EmptyStr = ""; - const string NullStr = null; - const object NullObject = null; - const dynamic NullDynamic = null; - const X NullTypeDef = null; - const Action NullTypeRef = null; - const Func>, dynamic, T, List> NullTypeSpec = null; - - const decimal D = 123456.78M; - } - - public static void NestedScopes() - { - int x0 = 0; - { - const int c1 = 11; - int x1 = 1; - } - - int y0 = 0; - { - int y1 = 1; - { - const string c2 = nameof(c2); - const string d2 = nameof(d2); - int y2 = 2; - } - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.dll b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.dll deleted file mode 100644 index aa016a71460f4080586f5710c0e0f3947581f282..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.dll and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.pdbx b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.pdbx deleted file mode 100644 index 041a18763a952684cd33c50a482a96057d1e98bb..0000000000000000000000000000000000000000 Binary files a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Resources/Scopes.pdbx and /dev/null differ diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/SymBinderTests.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/SymBinderTests.cs deleted file mode 100644 index 2185c0a19e054b7e3bb600e6fd1857f1d53564b1..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/SymBinderTests.cs +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.IO; -using Roslyn.Test.Utilities; -using Roslyn.Utilities; -using Xunit; - -namespace Microsoft.DiaSymReader.PortablePdb.UnitTests -{ - using static SymTestHelpers; - - public class SymBinderTests - { - private static ISymUnmanagedBinder4 SymBinder => new SymBinder(); - - private sealed class NotImplementedMetadataProvider : IMetadataImportProvider - { - public static readonly IMetadataImportProvider Instance = new NotImplementedMetadataProvider(); - - public object GetMetadataImport() - { - throw new NotImplementedException(); - } - } - - private sealed class TestMetadataProvider : IMetadataImportProvider - { - private readonly Func _importProvider; - - public TestMetadataProvider(Func importProvider) - { - _importProvider = importProvider; - } - - public object GetMetadataImport() => _importProvider(); - } - - [Fact] - public void GetReaderForFile_NextToPE() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - - string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString()); - string peFilePath = Path.Combine(tempDir, "Documents.dll"); - string pdbFilePath = Path.Combine(tempDir, "Documents.pdb"); - - Directory.CreateDirectory(tempDir); - File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll); - File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb); - - string searchPath = null; - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.S_OK, SymBinder.GetReaderForFile(importer, peFilePath, searchPath, out symReader)); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - ((ISymUnmanagedDispose)symReader).Destroy(); - - Directory.Delete(tempDir, recursive: true); - } - - [Fact] - public void GetReaderForFile_SearchPaths() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - - string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString()); - string searchDir = Path.Combine(tempDir, "Dir"); - string peFilePath = Path.Combine(tempDir, "Documents.dll"); - string pdbFilePath = Path.Combine(searchDir, "Documents.pdb"); - - Directory.CreateDirectory(tempDir); - Directory.CreateDirectory(searchDir); - File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll); - File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb); - - string searchPath = searchDir; - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.S_OK, SymBinder.GetReaderForFile(importer, peFilePath, searchPath, out symReader)); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - ((ISymUnmanagedDispose)symReader).Destroy(); - - Directory.Delete(tempDir, recursive: true); - } - - [Fact] - public void GetReaderForFile_SearchPaths_SubDir1() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - - string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString()); - string searchDir = Path.Combine(tempDir, "Dir"); - string peFilePath = Path.Combine(tempDir, "Documents.dll"); - string pdbFilePath = Path.Combine(searchDir, "dll", "Documents.pdb"); - - Directory.CreateDirectory(tempDir); - Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath)); - File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll); - File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb); - - string searchPath = searchDir; - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.S_OK, SymBinder.GetReaderForFile(importer, peFilePath, searchPath, out symReader)); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - ((ISymUnmanagedDispose)symReader).Destroy(); - - Directory.Delete(tempDir, recursive: true); - } - - [Fact] - public void GetReaderForFile_SearchPaths_SubDir2() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - - string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString()); - string searchDir = Path.Combine(tempDir, "Dir"); - string peFilePath = Path.Combine(tempDir, "Documents.dll"); - string pdbFilePath = Path.Combine(searchDir, "symbols", "dll", "Documents.pdb"); - - Directory.CreateDirectory(tempDir); - Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath)); - File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll); - File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb); - - string searchPath = searchDir; - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.S_OK, SymBinder.GetReaderForFile(importer, peFilePath, searchPath, out symReader)); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - ((ISymUnmanagedDispose)symReader).Destroy(); - - Directory.Delete(tempDir, recursive: true); - } - - // TODO: test Environment, Registry (need test hooks) - - [Fact] - public void GetReaderForFile_SkipNative1() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - - string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString()); - string searchDir = Path.Combine(tempDir, "Dir"); - string peFilePath = Path.Combine(tempDir, "Documents.dll"); - string pdbFilePath = Path.Combine(searchDir, "Documents.pdb"); - string nativePdbFilePath = Path.Combine(searchDir, "symbols", "dll", "Documents.pdb"); - - Directory.CreateDirectory(tempDir); - Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath)); - Directory.CreateDirectory(Path.GetDirectoryName(nativePdbFilePath)); - File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll); - File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb); - File.WriteAllBytes(nativePdbFilePath, TestResources.Documents.Pdb); - - string searchPath = searchDir; - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.S_OK, SymBinder.GetReaderForFile(importer, peFilePath, searchPath, out symReader)); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - ((ISymUnmanagedDispose)symReader).Destroy(); - - Directory.Delete(tempDir, recursive: true); - } - - [Fact] - public void GetReaderForFile_SkipNative2() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - - string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString()); - string searchDir1 = Path.Combine(tempDir, "Dir1"); - string searchDir2 = Path.Combine(tempDir, "Dir2"); - string peFilePath = Path.Combine(tempDir, "Documents.dll"); - string nativePdbFilePath = Path.Combine(searchDir1, "Documents.pdb"); - string pdbFilePath = Path.Combine(searchDir2, "Documents.pdb"); - - Directory.CreateDirectory(tempDir); - Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath)); - Directory.CreateDirectory(Path.GetDirectoryName(nativePdbFilePath)); - File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll); - File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb); - File.WriteAllBytes(nativePdbFilePath, TestResources.Documents.Pdb); - - string searchPath = searchDir1 + ";" + searchDir2; - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.S_OK, SymBinder.GetReaderForFile(importer, peFilePath, searchPath, out symReader)); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - ((ISymUnmanagedDispose)symReader).Destroy(); - - Directory.Delete(tempDir, recursive: true); - } - - [Fact] - public void GetReaderForFile_SkipNonMatching() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - - string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString()); - string searchDir = Path.Combine(tempDir, "Dir"); - string peFilePath = Path.Combine(tempDir, "Documents.dll"); - string pdbFilePath = Path.Combine(searchDir, "Documents.pdb"); - string anotherPdbFilePath = Path.Combine(searchDir, "symbols", "dll", "Documents.pdb"); - - Directory.CreateDirectory(tempDir); - Directory.CreateDirectory(Path.GetDirectoryName(pdbFilePath)); - Directory.CreateDirectory(Path.GetDirectoryName(anotherPdbFilePath)); - File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll); - File.WriteAllBytes(pdbFilePath, TestResources.Documents.PortablePdb); - File.WriteAllBytes(anotherPdbFilePath, TestResources.Async.PortablePdb); - - string searchPath = searchDir; - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.S_OK, SymBinder.GetReaderForFile(importer, peFilePath, searchPath, out symReader)); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - ((ISymUnmanagedDispose)symReader).Destroy(); - - Directory.Delete(tempDir, recursive: true); - } - - [Fact] - public void GetReaderForFile_MatchingNotFound() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - - string tempDir = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), Guid.NewGuid().ToString()); - string searchDir = Path.Combine(tempDir, "Dir"); - string peFilePath = Path.Combine(tempDir, "Documents.dll"); - string anotherPdbFilePath = Path.Combine(searchDir, "symbols", "dll", "Documents.pdb"); - - Directory.CreateDirectory(tempDir); - Directory.CreateDirectory(Path.GetDirectoryName(anotherPdbFilePath)); - File.WriteAllBytes(peFilePath, TestResources.Documents.PortableDll); - File.WriteAllBytes(anotherPdbFilePath, TestResources.Async.PortablePdb); - - string searchPath = searchDir; - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.E_PDB_NOT_FOUND, SymBinder.GetReaderForFile(importer, peFilePath, searchPath, out symReader)); - Assert.Null(symReader); - - Directory.Delete(tempDir, recursive: true); - } - - [Fact] - public void GetReaderFromPdbFile() - { - string filePath = Path.GetTempFileName(); - File.WriteAllBytes(filePath, TestResources.Documents.PortablePdb); - - ISymUnmanagedReader symReader; - Assert.Equal(HResult.S_OK, SymBinder.GetReaderFromPdbFile(NotImplementedMetadataProvider.Instance, filePath, out symReader)); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - Assert.Equal(HResult.S_FALSE, ((ISymUnmanagedDispose)symReader).Destroy()); - Assert.Equal(HResult.S_OK, ((ISymUnmanagedDispose)symReader).Destroy()); - - Assert.Throws(() => symReader.GetDocuments(0, out actualCount, null)); - - File.Delete(filePath); - } - - [Fact] - public void GetReaderFromStream() - { - var importer = new SymMetadataImport(new MemoryStream(TestResources.Documents.PortableDll)); - var stream = new MemoryStream(TestResources.Documents.PortablePdb); - - ISymUnmanagedReader symReader = SymBinder.GetReaderFromStream(stream, importer); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - Assert.Equal(HResult.S_FALSE, ((ISymUnmanagedDispose)symReader).Destroy()); - Assert.Equal(HResult.S_OK, ((ISymUnmanagedDispose)symReader).Destroy()); - - Assert.Throws(() => symReader.GetDocuments(0, out actualCount, null)); - } - - [Fact] - public void GetReaderFromPdbStream() - { - var stream = new MemoryStream(TestResources.Documents.PortablePdb); - - ISymUnmanagedReader symReader = SymBinder.GetReaderFromPdbStream(stream, NotImplementedMetadataProvider.Instance); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - Assert.Equal(HResult.S_FALSE, ((ISymUnmanagedDispose)symReader).Destroy()); - Assert.Equal(HResult.S_OK, ((ISymUnmanagedDispose)symReader).Destroy()); - - Assert.Throws(() => symReader.GetDocuments(0, out actualCount, null)); - } - - [Fact] - public void LazyMetadataImport() - { - bool importCreated = false; - ISymUnmanagedReader symReader = SymBinder.GetReaderFromPdbStream( - new MemoryStream(TestResources.Scopes.Pdb), - new TestMetadataProvider(() => - { - importCreated = true; - return new SymMetadataImport(new MemoryStream(TestResources.Scopes.Dll)); - })); - - int count; - - // - // C.F - // - - ISymUnmanagedMethod mF; - Assert.Equal(HResult.S_OK, symReader.GetMethod(0x06000002, out mF)); - - // root scope: - ISymUnmanagedScope rootScope; - Assert.Equal(HResult.S_OK, mF.GetRootScope(out rootScope)); - - // child scope: - var children = GetAndValidateChildScopes(rootScope, expectedCount: 1); - - var child = children[0]; - Assert.Equal(HResult.S_OK, child.GetLocals(0, out count, null)); - Assert.Equal(0, count); - - ISymUnmanagedScope parent; - Assert.Equal(HResult.S_OK, child.GetParent(out parent)); - Assert.NotSame(rootScope, parent); // a new instance should be created - ValidateRootScope(parent); - ValidateRange(parent, 0, 2); - - var constants = GetAndValidateConstants(child, expectedCount: 29); - - Assert.False(importCreated); - ValidateConstant(constants[28], "D", 123456.78M, new byte[] { 0x11, 0x2D }); - Assert.True(importCreated); - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/SymReaderTests.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/SymReaderTests.cs deleted file mode 100644 index 8d4e18c3e1bc82b5500db30a78aa3f42584b79de..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/SymReaderTests.cs +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Roslyn.Test.Utilities; -using System; -using System.Reflection.Metadata; -using Xunit; - -namespace Microsoft.DiaSymReader.PortablePdb.UnitTests -{ - using System.Runtime.InteropServices; - using static SymTestHelpers; - - public class SymReaderTests - { - [Fact] - public unsafe void TestMetadataHeaders1() - { - fixed (byte* pdbPtr = TestResources.Documents.PortablePdb) - { - var pdbReader = new MetadataReader(pdbPtr, TestResources.Documents.PortablePdb.Length); - Assert.Equal("PDB v1.0", pdbReader.MetadataVersion); - Assert.Equal(MetadataKind.Ecma335, pdbReader.MetadataKind); - Assert.False(pdbReader.IsAssembly); - Assert.True(pdbReader.DebugMetadataHeader.EntryPoint.IsNil); - - AssertEx.Equal(new byte[] - { - 0x89, 0x03, 0x86, 0xAD, 0xFF, 0x27, 0x56, 0x46, 0x9F, 0x3F, 0xE2, 0x18, 0x4B, 0xEF, 0xFC, 0xC0, 0xBE, 0x0C, 0x52, 0xA0 - }, pdbReader.DebugMetadataHeader.Id); - } - } - - [Fact] - public void MatchesModule() - { - var symReader = (ISymUnmanagedReader4)CreateSymReaderFromResource(TestResources.Documents.PortableDllAndPdb); - - var expectedGuid = new Guid(new byte[] { 0x89, 0x03, 0x86, 0xAD, 0xFF, 0x27, 0x56, 0x46, 0x9F, 0x3F, 0xE2, 0x18, 0x4B, 0xEF, 0xFC, 0xC0 }); - uint expectedStamp = 0xA0520CBE; - - var anotherGuid = new Guid(new byte[] { 0x88, 0x03, 0x86, 0xAD, 0xFF, 0x27, 0x56, 0x46, 0x9F, 0x3F, 0xE2, 0x18, 0x4B, 0xEF, 0xFC, 0xC0 }); - var anotherStamp = 0xA0520CBF; - - bool matches; - Assert.Equal(HResult.S_OK, symReader.MatchesModule(expectedGuid, expectedStamp, 1, out matches)); - Assert.True(matches); - Assert.Equal(HResult.S_OK, symReader.MatchesModule(expectedGuid, expectedStamp, -1, out matches)); - Assert.False(matches); - Assert.Equal(HResult.S_OK, symReader.MatchesModule(expectedGuid, expectedStamp, 2, out matches)); - Assert.False(matches); - Assert.Equal(HResult.S_OK, symReader.MatchesModule(anotherGuid, expectedStamp, 1, out matches)); - Assert.False(matches); - Assert.Equal(HResult.S_OK, symReader.MatchesModule(expectedGuid, anotherStamp, 1, out matches)); - Assert.False(matches); - } - - [Fact] - public unsafe void GetPortableDebugMetadata() - { - var symReader = (ISymUnmanagedReader4)CreateSymReaderFromResource(TestResources.Documents.PortableDllAndPdb); - byte* ptr; - int size; - Assert.Equal(HResult.S_OK, symReader.GetPortableDebugMetadata(out ptr, out size)); - Assert.Equal(size, TestResources.Documents.PortablePdb.Length); - byte[] actual = new byte[size]; - Marshal.Copy((IntPtr)ptr, actual, 0, size); - AssertEx.Equal(TestResources.Documents.PortablePdb, actual); - } - - [Fact] - public unsafe void GetSourceServerData() - { - var symReader = (ISymUnmanagedReader4)CreateSymReaderFromResource(TestResources.Documents.PortableDllAndPdb); - byte* ptr; - int size; - Assert.Equal(HResult.S_OK, symReader.GetSourceServerData(out ptr, out size)); - Assert.Equal(size, 0); - Assert.Equal(IntPtr.Zero, (IntPtr)ptr); - } - - [Fact] - public void TestGetDocuments1() - { - var symReader = CreateSymReaderFromResource(TestResources.Documents.PortableDllAndPdb); - - int actualCount; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(0, out actualCount, null)); - Assert.Equal(13, actualCount); - - var actualDocuments = new ISymUnmanagedDocument[actualCount]; - int actualCount2; - Assert.Equal(HResult.S_OK, symReader.GetDocuments(actualCount, out actualCount2, actualDocuments)); - Assert.Equal(13, actualCount2); - - ValidateDocument(actualDocuments[0], - url: @"C:\Documents.cs", - algorithmId: "ff1816ec-aa5e-4d10-87f7-6f4963833460", - checksum: new byte[] { 0xDB, 0xEB, 0x2A, 0x06, 0x7B, 0x2F, 0x0E, 0x0D, 0x67, 0x8A, 0x00, 0x2C, 0x58, 0x7A, 0x28, 0x06, 0x05, 0x6C, 0x3D, 0xCE }); - - ValidateDocument(actualDocuments[1], url: @"C:\a\b\c\d\1.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[2], url: @"C:\a\b\c\D\2.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[3], url: @"C:\a\b\C\d\3.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[4], url: @"C:\a\b\c\d\x.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[5], url: @"C:\A\b\c\x.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[6], url: @"C:\a\b\x.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[7], url: @"C:\a\B\3.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[8], url: @"C:\a\B\c\4.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[9], url: @"C:\*\5.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[10], url: @":6.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[11], url: @"C:\a\b\X.cs", algorithmId: null, checksum: null); - ValidateDocument(actualDocuments[12], url: @"C:\a\B\x.cs", algorithmId: null, checksum: null); - } - - [Fact] - public void TestGetDocument1() - { - var symReader = CreateSymReaderFromResource(TestResources.Documents.PortableDllAndPdb); - TestGetDocument(symReader, @"x.cs", expectedUrl: @"C:\a\b\c\d\x.cs"); - TestGetDocument(symReader, @"X.CS", expectedUrl: @"C:\a\b\c\d\x.cs"); - TestGetDocument(symReader, @"X.cs", expectedUrl: @"C:\a\b\X.cs"); - TestGetDocument(symReader, @"1.cs", expectedUrl: @"C:\a\b\c\d\1.cs"); - TestGetDocument(symReader, @"2.cs", expectedUrl: @"C:\a\b\c\D\2.cs"); - TestGetDocument(symReader, @"3.cs", expectedUrl: @"C:\a\b\C\d\3.cs"); - TestGetDocument(symReader, @"C:\A\b\c\x.cs", expectedUrl: @"C:\A\b\c\x.cs"); - TestGetDocument(symReader, @"C:\a\b\x.cs", expectedUrl: @"C:\a\b\x.cs"); - TestGetDocument(symReader, @"C:\*\5.cs", expectedUrl: @"C:\*\5.cs"); - TestGetDocument(symReader, @"5.cs", expectedUrl: @"C:\*\5.cs"); - TestGetDocument(symReader, @":6.cs", expectedUrl: @":6.cs"); - TestGetDocument(symReader, @"C:\a\B\x.cs", expectedUrl: @"C:\a\B\x.cs"); - TestGetDocument(symReader, @"C:\a\b\X.cs", expectedUrl: @"C:\a\b\X.cs"); - } - - private void TestGetDocument(ISymUnmanagedReader symReader, string name, string expectedUrl) - { - ISymUnmanagedDocument document; - if (expectedUrl != null) - { - // guids are ignored - Assert.Equal(HResult.S_OK, symReader.GetDocument(name, Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), out document)); - ValidateDocumentUrl(document, expectedUrl); - } - else - { - // guids are ignored - Assert.Equal(HResult.S_FALSE, symReader.GetDocument(name, Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), out document)); - Assert.Null(document); - } - } - - [Fact] - public void TestSymGetAttribute() - { - var symReader = CreateSymReaderFromResource(TestResources.Documents.PortableDllAndPdb); - - int actualCount; - int actualCount2; - Assert.Equal(HResult.S_FALSE, symReader.GetSymAttribute(0, "", 0, out actualCount, null)); - - byte[] image = new byte[actualCount]; - Assert.Equal(HResult.S_OK, symReader.GetSymAttribute(0, "", actualCount, out actualCount2, image)); - Assert.Equal(actualCount, actualCount2); - - AssertEx.Equal(TestResources.Documents.PortablePdb, image); - } - - [Fact] - public void TestMethods1() - { - var symReader = CreateSymReaderFromResource(TestResources.Scopes.DllAndPdb); - int count; - - // - // C.F - // - - ISymUnmanagedMethod mF; - Assert.Equal(HResult.S_OK, symReader.GetMethod(0x06000002, out mF)); - - // root scope: - ISymUnmanagedScope rootScope, rootScopeCopy; - Assert.Equal(HResult.S_OK, mF.GetRootScope(out rootScope)); - Assert.Equal(HResult.S_OK, mF.GetRootScope(out rootScopeCopy)); - Assert.NotSame(rootScope, rootScopeCopy); - - ValidateRange(rootScope, 0, 2); - ValidateRootScope(rootScope); - - // child scope: - var children = GetAndValidateChildScopes(rootScope, expectedCount: 1); - - var child = children[0]; - Assert.Equal(HResult.S_OK, child.GetLocals(0, out count, null)); - Assert.Equal(0, count); - - ISymUnmanagedScope parent; - Assert.Equal(HResult.S_OK, child.GetParent(out parent)); - Assert.NotSame(rootScope, parent); // a new instance should be created - ValidateRootScope(parent); - ValidateRange(parent, 0, 2); - - var constants = GetAndValidateConstants(child, expectedCount: 29); - - ValidateConstant(constants[0], "B", (short)0, new byte[] { 0x02 }); - ValidateConstant(constants[1], "C", (ushort)'\0', new byte[] { 0x03 }); - ValidateConstant(constants[2], "I1", (short)1, new byte[] { 0x04 }); - ValidateConstant(constants[3], "U1", (short)2, new byte[] { 0x05 }); - ValidateConstant(constants[4], "I2", (short)3, new byte[] { 0x06 }); - ValidateConstant(constants[5], "U2", (ushort)4, new byte[] { 0x07 }); - ValidateConstant(constants[6], "I4", 5, new byte[] { 0x08 }); - ValidateConstant(constants[7], "U4", (uint)6, new byte[] { 0x09 }); - ValidateConstant(constants[8], "I8", (long)7, new byte[] { 0x0A }); - ValidateConstant(constants[9], "U8", (ulong)8, new byte[] { 0x0B }); - ValidateConstant(constants[10], "R4", (float)9.1, new byte[] { 0x0C }); - ValidateConstant(constants[11], "R8", 10.2, new byte[] { 0x0D }); - - ValidateConstant(constants[12], "EI1", (short)1, new byte[] { 0x11, 0x06 }); - ValidateConstant(constants[13], "EU1", (short)2, new byte[] { 0x11, 0x0A }); - ValidateConstant(constants[14], "EI2", (short)3, new byte[] { 0x11, 0x0E }); - ValidateConstant(constants[15], "EU2", (ushort)4, new byte[] { 0x11, 0x12 }); - ValidateConstant(constants[16], "EI4", 5, new byte[] { 0x11, 0x16 }); - ValidateConstant(constants[17], "EU4", (uint)6, new byte[] { 0x11, 0x1A }); - ValidateConstant(constants[18], "EI8", (long)7, new byte[] { 0x11, 0x1E }); - ValidateConstant(constants[19], "EU8", (ulong)8, new byte[] { 0x11, 0x22 }); - - ValidateConstant(constants[20], "StrWithNul", "\0", new byte[] { 0x0e }); - ValidateConstant(constants[21], "EmptyStr", "", new byte[] { 0x0e }); - ValidateConstant(constants[22], "NullStr", 0, new byte[] { 0x0e }); - ValidateConstant(constants[23], "NullObject", 0, new byte[] { 0x1c }); - ValidateConstant(constants[24], "NullDynamic", 0, new byte[] { 0x1c }); - - // Note: Native PDBs produce expanded form of the signature stored as StandAloneSig. - // In Portable PDBs we produce a TypeSpec. Since a StandAlongSig can also contain a TypeSpec - // the consumers should be able to resolve it. If we find a case where that's not true we can - // potentially expand the TypeSpec signature in ISymUnmanagedConstant.GetValue. - ValidateConstant(constants[25], "NullTypeDef", 0, new byte[] { 0x12, 0x08 }); - ValidateConstant(constants[26], "NullTypeRef", 0, new byte[] { 0x12, 0x1D }); - ValidateConstant(constants[27], "NullTypeSpec", 0, new byte[] { 0x12, 0x26 }); - - ValidateConstant(constants[28], "D", 123456.78M, new byte[] { 0x11, 0x2D }); - - // - // C.NestedScopes - // - - ISymUnmanagedMethod mNestedScopes; - Assert.Equal(HResult.S_OK, symReader.GetMethod(0x06000003, out mNestedScopes)); - - // root scope: - Assert.Equal(HResult.S_OK, mNestedScopes.GetRootScope(out rootScope)); - ValidateRootScope(rootScope); - - var main = GetAndValidateChildScopes(rootScope, expectedCount: 1)[0]; - constants = GetAndValidateConstants(main, expectedCount: 0); - var variables = GetAndValidateVariables(main, expectedCount: 2); - - ValidateVariable(variables[0], "x0", 0, LocalVariableAttributes.None, new byte[] { 0x08 }); - ValidateVariable(variables[1], "y0", 1, LocalVariableAttributes.None, new byte[] { 0x08 }); - - children = GetAndValidateChildScopes(main, expectedCount: 2); - var first = children[0]; - GetAndValidateChildScopes(first, expectedCount: 0); - var second = children[1]; - var third = GetAndValidateChildScopes(second, expectedCount: 1)[0]; - GetAndValidateChildScopes(third, expectedCount: 0); - - constants = GetAndValidateConstants(first, expectedCount: 1); - variables = GetAndValidateVariables(first, expectedCount: 1); - ValidateConstant(constants[0], "c1", 11, new byte[] { 0x08 }); - ValidateVariable(variables[0], "x1", 2, LocalVariableAttributes.None, new byte[] { 0x08 }); - - constants = GetAndValidateConstants(second, expectedCount: 0); - variables = GetAndValidateVariables(second, expectedCount: 1); - ValidateVariable(variables[0], "y1", 3, LocalVariableAttributes.None, new byte[] { 0x08 }); - - constants = GetAndValidateConstants(third, expectedCount: 2); - variables = GetAndValidateVariables(third, expectedCount: 1); - ValidateConstant(constants[0], "c2", "c2", new byte[] { 0x0e }); - ValidateConstant(constants[1], "d2", "d2", new byte[] { 0x0e }); - ValidateVariable(variables[0], "y2", 4, LocalVariableAttributes.None, new byte[] { 0x08 }); - - // TODO: - // f.GetOffset(); - // f.GetRanges(); - - ISymUnmanagedNamespace ns; - ISymUnmanagedVariable[] ps = null; - Assert.Equal(HResult.E_NOTIMPL, mF.GetNamespace(out ns)); - Assert.Equal(HResult.E_NOTIMPL, mF.GetParameters(0, out count, ps)); - // TODO: - // f.GetScopeFromOffset() - } - - [Fact] - public void TestAsyncMethods() - { - var symReader = CreateSymReaderFromResource(TestResources.Async.DllAndPdb); - - ValidateAsyncMethod( - symReader, - moveNextMethodToken: 0x06000005, - kickoffMethodToken: 0x06000001, - catchHandlerOffset: -1, - yieldOffsets: new[] { 0x46, 0xAF, 0x11A }, - resumeOffsets: new[] { 0x64, 0xCE, 0x136 }); - - ValidateAsyncMethod( - symReader, - moveNextMethodToken: 0x06000008, - kickoffMethodToken: 0x06000002, - catchHandlerOffset: 0x76, - yieldOffsets: new[] { 0x2D }, - resumeOffsets: new[] { 0x48 }); - } - - [Fact] - public void TestAsyncMethods_GetAsyncStepInfo() - { - var symReader = CreateSymReaderFromResource(TestResources.Async.DllAndPdb); - - ISymUnmanagedMethod method; - Assert.Equal(HResult.S_OK, symReader.GetMethod(0x06000005, out method)); - - var asyncMethod = (ISymUnmanagedAsyncMethod)method; - - var actualYieldOffsets = new int[1]; - var actualResumeOffsets = new int[1]; - var actualResumeMethods = new int[1]; - - int count2; - Assert.Equal(HResult.S_OK, asyncMethod.GetAsyncStepInfo(1, out count2, actualYieldOffsets, actualResumeOffsets, actualResumeMethods)); - - Assert.Equal(1, count2); - Assert.NotEqual(0, actualYieldOffsets[0]); - Assert.NotEqual(0, actualResumeOffsets[0]); - Assert.NotEqual(0, actualResumeMethods[0]); - - actualYieldOffsets = new int[5]; - actualResumeOffsets = new int[5]; - actualResumeMethods = new int[5]; - - Assert.Equal(HResult.S_OK, asyncMethod.GetAsyncStepInfo(4, out count2, actualYieldOffsets, actualResumeOffsets, actualResumeMethods)); - - Assert.Equal(3, count2); - - for (int i = 0; i < 3; i++) - { - Assert.NotEqual(0, actualYieldOffsets[i]); - Assert.NotEqual(0, actualResumeOffsets[i]); - Assert.NotEqual(0, actualResumeMethods[i]); - } - - for (int i = 3; i < 5; i++) - { - Assert.Equal(0, actualYieldOffsets[i]); - Assert.Equal(0, actualResumeOffsets[i]); - Assert.Equal(0, actualResumeMethods[i]); - } - } - - [Fact] - public void TestAsyncMethods_Errors() - { - var symReader = CreateSymReaderFromResource(TestResources.Scopes.DllAndPdb); - - ISymUnmanagedMethod method; - Assert.Equal(HResult.S_OK, symReader.GetMethod(0x06000002, out method)); - - var asyncMethod = (ISymUnmanagedAsyncMethod)method; - - bool isAsync; - Assert.Equal(HResult.S_OK, asyncMethod.IsAsyncMethod(out isAsync)); - Assert.False(isAsync); - - int actualKickoffMethodToken; - Assert.Equal(HResult.E_UNEXPECTED, asyncMethod.GetKickoffMethod(out actualKickoffMethodToken)); - - bool hasCatchHandlerILOffset; - Assert.Equal(HResult.E_UNEXPECTED, asyncMethod.HasCatchHandlerILOffset(out hasCatchHandlerILOffset)); - - int actualCatchHandlerOffset; - Assert.Equal(HResult.E_UNEXPECTED, asyncMethod.GetCatchHandlerILOffset(out actualCatchHandlerOffset)); - - int count, count2; - Assert.Equal(HResult.E_UNEXPECTED, asyncMethod.GetAsyncStepInfoCount(out count)); - Assert.Equal(HResult.E_UNEXPECTED, asyncMethod.GetAsyncStepInfo(count, out count2, null, null, null)); - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestHelpers/AssertEx.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestHelpers/AssertEx.cs deleted file mode 100644 index 853397c9cea0e59acc9c7e0e00b72f0083a9df18..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestHelpers/AssertEx.cs +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Text; -using Roslyn.Utilities; -using Xunit; - -namespace Roslyn.Test.Utilities -{ - /// - /// Assert style type to deal with the lack of features in xUnit's Assert type - /// - public static class AssertEx - { - #region AssertEqualityComparer - - private class AssertEqualityComparer : IEqualityComparer - { - private static readonly IEqualityComparer s_instance = new AssertEqualityComparer(); - - private static bool CanBeNull() - { - var type = typeof(T); - return !type.GetTypeInfo().IsValueType || - (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)); - } - - public static bool IsNull(T @object) - { - if (!CanBeNull()) - { - return false; - } - - return object.Equals(@object, default(T)); - } - - public static bool Equals(T left, T right) - { - return s_instance.Equals(left, right); - } - - bool IEqualityComparer.Equals(T x, T y) - { - if (CanBeNull()) - { - if (object.Equals(x, default(T))) - { - return object.Equals(y, default(T)); - } - - if (object.Equals(y, default(T))) - { - return false; - } - } - - if (x.GetType() != y.GetType()) - { - return false; - } - - var equatable = x as IEquatable; - if (equatable != null) - { - return equatable.Equals(y); - } - - var comparableT = x as IComparable; - if (comparableT != null) - { - return comparableT.CompareTo(y) == 0; - } - - var comparable = x as IComparable; - if (comparable != null) - { - return comparable.CompareTo(y) == 0; - } - - var enumerableX = x as IEnumerable; - var enumerableY = y as IEnumerable; - - if (enumerableX != null && enumerableY != null) - { - var enumeratorX = enumerableX.GetEnumerator(); - var enumeratorY = enumerableY.GetEnumerator(); - - while (true) - { - bool hasNextX = enumeratorX.MoveNext(); - bool hasNextY = enumeratorY.MoveNext(); - - if (!hasNextX || !hasNextY) - { - return hasNextX == hasNextY; - } - - if (!Equals(enumeratorX.Current, enumeratorY.Current)) - { - return false; - } - } - } - - return object.Equals(x, y); - } - - int IEqualityComparer.GetHashCode(T obj) - { - throw new NotImplementedException(); - } - } - - #endregion - - public static void AreEqual(T expected, T actual, string message = null, IEqualityComparer comparer = null) - { - if (ReferenceEquals(expected, actual)) - { - return; - } - - if (expected == null) - { - Fail("expected was null, but actual wasn't\r\n" + message); - } - else if (actual == null) - { - Fail("actual was null, but expected wasn't\r\n" + message); - } - else - { - if (!(comparer != null ? - comparer.Equals(expected, actual) : - AssertEqualityComparer.Equals(expected, actual))) - { - Fail("Expected and actual were different.\r\n" + - "Expected: " + expected + "\r\n" + - "Actual: " + actual + "\r\n" + - message); - } - } - } - - public static void Equal(ImmutableArray expected, IEnumerable actual, Func comparer = null, string message = null) - { - if (actual == null || expected.IsDefault) - { - Assert.True((actual == null) == expected.IsDefault, message); - } - else - { - Equal((IEnumerable)expected, actual, comparer, message); - } - } - - public static void Equal(IEnumerable expected, ImmutableArray actual, Func comparer = null, string message = null, string itemSeparator = null) - { - if (expected == null || actual.IsDefault) - { - Assert.True((expected == null) == actual.IsDefault, message); - } - else - { - Equal(expected, (IEnumerable)actual, comparer, message, itemSeparator); - } - } - - public static void Equal(ImmutableArray expected, ImmutableArray actual, Func comparer = null, string message = null, string itemSeparator = null) - { - Equal(expected, (IEnumerable)actual, comparer, message, itemSeparator); - } - - public static void Equal(IEnumerable expected, IEnumerable actual, Func comparer = null, string message = null, - string itemSeparator = null, Func itemInspector = null) - { - if (ReferenceEquals(expected, actual)) - { - return; - } - - if (expected == null) - { - Fail("expected was null, but actual wasn't\r\n" + message); - } - else if (actual == null) - { - Fail("actual was null, but expected wasn't\r\n" + message); - } - else if (!SequenceEqual(expected, actual, comparer)) - { - string assertMessage = GetAssertMessage(expected, actual, comparer, itemInspector, itemSeparator); - - if (message != null) - { - assertMessage = message + "\r\n" + assertMessage; - } - - Assert.True(false, assertMessage); - } - } - - private static bool SequenceEqual(IEnumerable expected, IEnumerable actual, Func comparer = null) - { - var enumerator1 = expected.GetEnumerator(); - var enumerator2 = actual.GetEnumerator(); - - while (true) - { - var hasNext1 = enumerator1.MoveNext(); - var hasNext2 = enumerator2.MoveNext(); - - if (hasNext1 != hasNext2) - { - return false; - } - - if (!hasNext1) - { - break; - } - - var value1 = enumerator1.Current; - var value2 = enumerator2.Current; - - if (!(comparer != null ? comparer(value1, value2) : AssertEqualityComparer.Equals(value1, value2))) - { - return false; - } - } - - return true; - } - - public static void SetEqual(IEnumerable expected, IEnumerable actual, IEqualityComparer comparer = null, string message = null, string itemSeparator = "\r\n") - { - var expectedSet = new HashSet(expected, comparer); - var result = expected.Count() == actual.Count() && expectedSet.SetEquals(actual); - if (!result) - { - if (string.IsNullOrEmpty(message)) - { - message = GetAssertMessage(expected, actual); - } - - Assert.True(result, message); - } - } - - public static void SetEqual(IEnumerable actual, params T[] expected) - { - var expectedSet = new HashSet(expected); - Assert.True(expectedSet.SetEquals(actual), string.Format("Expected: {0}\nActual: {1}", ToString(expected), ToString(actual))); - } - - public static void None(IEnumerable actual, Func predicate) - { - var none = !actual.Any(predicate); - if (!none) - { - Assert.True(none, string.Format( - "Unexpected item found among existing items: {0}\nExisting items: {1}", - ToString(actual.First(predicate)), - ToString(actual))); - } - } - - public static void Any(IEnumerable actual, Func predicate) - { - var any = actual.Any(predicate); - Assert.True(any, string.Format("No expected item was found.\nExisting items: {0}", ToString(actual))); - } - - public static void All(IEnumerable actual, Func predicate) - { - var all = actual.All(predicate); - if (!all) - { - Assert.True(all, string.Format( - "Not all items satisfy condition:\n{0}", - ToString(actual.Where(i => !predicate(i))))); - } - } - - public static string ToString(object o) - { - return Convert.ToString(o); - } - - public static string ToString(IEnumerable list, string separator = ", ", Func itemInspector = null) - { - if (itemInspector == null) - { - itemInspector = i => Convert.ToString(i); - } - - return string.Join(separator, list.Select(itemInspector)); - } - - public static void Fail(string message) - { - Assert.False(true, message); - } - - public static void Fail(string format, params object[] args) - { - Assert.False(true, string.Format(format, args)); - } - - public static void Null(T @object, string message = null) - { - Assert.True(AssertEqualityComparer.IsNull(@object), message); - } - - public static void NotNull(T @object, string message = null) - { - Assert.False(AssertEqualityComparer.IsNull(@object), message); - } - - public static void ThrowsArgumentNull(string parameterName, Action del) - { - try - { - del(); - } - catch (ArgumentNullException e) - { - Assert.Equal(parameterName, e.ParamName); - } - } - - public static void ThrowsArgumentException(string parameterName, Action del) - { - try - { - del(); - } - catch (ArgumentException e) - { - Assert.Equal(parameterName, e.ParamName); - } - } - - public static T Throws(Action del, bool allowDerived = false) where T : Exception - { - try - { - del(); - } - catch (Exception ex) - { - var type = ex.GetType(); - if (type.Equals(typeof(T))) - { - // We got exactly the type we wanted - return (T)ex; - } - - if (allowDerived && typeof(T).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) - { - // We got a derived type - return (T)ex; - } - - // We got some other type. We know that type != typeof(T), and so we'll use Assert.Equal since Xunit - // will give a nice Expected/Actual output for this - Assert.Equal(typeof(T), type); - } - - throw new Exception("No exception was thrown."); - } - - internal static string NormalizeWhitespace(string input) - { - var output = new StringBuilder(); - var inputLines = input.Split('\n', '\r'); - foreach (var line in inputLines) - { - var trimmedLine = line.Trim(); - if (trimmedLine.Length > 0) - { - if (!(trimmedLine[0] == '{' || trimmedLine[0] == '}')) - { - output.Append(" "); - } - - output.AppendLine(trimmedLine); - } - } - - return output.ToString(); - } - - public static string GetAssertMessage(IEnumerable expected, IEnumerable actual, bool escapeQuotes, string expectedValueSourcePath = null, int expectedValueSourceLine = 0) - { - Func itemInspector = escapeQuotes ? new Func(t => t.ToString().Replace("\"", "\"\"")) : null; - return GetAssertMessage(expected, actual, itemInspector: itemInspector, itemSeparator: "\r\n", expectedValueSourcePath: expectedValueSourcePath, expectedValueSourceLine: expectedValueSourceLine); - } - - public static string GetAssertMessage( - IEnumerable expected, - IEnumerable actual, - Func comparer = null, - Func itemInspector = null, - string itemSeparator = null, - string expectedValueSourcePath = null, - int expectedValueSourceLine = 0) - { - if (itemInspector == null) - { - if (expected is IEnumerable) - { - itemInspector = b => $"0x{b:X2}"; - } - else - { - itemInspector = new Func(obj => (obj != null) ? obj.ToString() : ""); - } - } - - if (itemSeparator == null) - { - if (expected is IEnumerable) - { - itemSeparator = ", "; - } - else - { - itemSeparator = ",\r\n"; - } - } - - var actualString = string.Join(itemSeparator, actual.Select(itemInspector)); - - var message = new StringBuilder(); - message.AppendLine(); - message.AppendLine("Actual:"); - message.AppendLine(actualString); - - return message.ToString(); - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestHelpers/SymTestHelpers.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestHelpers/SymTestHelpers.cs deleted file mode 100644 index 8eb9bee3d1fa88682da4393dd793a165f94fe80e..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestHelpers/SymTestHelpers.cs +++ /dev/null @@ -1,456 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection.Metadata; -using System.Runtime.InteropServices; -using Roslyn.Test.Utilities; -using Xunit; - -namespace Microsoft.DiaSymReader.PortablePdb.UnitTests -{ - internal static class SymTestHelpers - { - [DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)] - [DllImport("Microsoft.DiaSymReader.Native.x86.dll", EntryPoint = "CreateSymReader")] - private extern static void CreateSymReader32(ref Guid id, [MarshalAs(UnmanagedType.IUnknown)]out object symReader); - - [DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)] - [DllImport("Microsoft.DiaSymReader.Native.amd64.dll", EntryPoint = "CreateSymReader")] - private extern static void CreateSymReader64(ref Guid id, [MarshalAs(UnmanagedType.IUnknown)]out object symReader); - - private static ISymUnmanagedReader3 CreateNativeSymReader(Stream pdbStream, object metadataImporter) - { - object symReader = null; - - var guid = default(Guid); - if (IntPtr.Size == 4) - { - CreateSymReader32(ref guid, out symReader); - } - else - { - CreateSymReader64(ref guid, out symReader); - } - - var reader = (ISymUnmanagedReader3)symReader; - reader.Initialize(pdbStream, metadataImporter); - return reader; - } - - private static ISymUnmanagedReader3 CreatePortableSymReader(Stream pdbStream, object metadataImporter) - { - return (ISymUnmanagedReader3)new SymBinder().GetReaderFromStream(pdbStream, metadataImporter); - } - - public static ISymUnmanagedReader3 CreateReader(Stream pdbStream, object metadataImporter) - { - pdbStream.Position = 0; - bool isPortable = pdbStream.ReadByte() == 'B' && pdbStream.ReadByte() == 'S' && pdbStream.ReadByte() == 'J' && pdbStream.ReadByte() == 'B'; - pdbStream.Position = 0; - - if (isPortable) - { - return CreatePortableSymReader(pdbStream, metadataImporter); - } - else - { - return CreateNativeSymReader(pdbStream, metadataImporter); - } - } - - public static ISymUnmanagedReader CreateSymReaderFromResource(KeyValuePair peAndPdb) - { - return CreateReader(new MemoryStream(peAndPdb.Value), metadataImporter: new SymMetadataImport(new MemoryStream(peAndPdb.Key))); - } - - public static void ValidateDocumentUrl(ISymUnmanagedDocument document, string url) - { - int actualCount, actualCount2; - Assert.Equal(HResult.S_OK, document.GetUrl(0, out actualCount, null)); - - char[] actualUrl = new char[actualCount]; - Assert.Equal(HResult.S_OK, document.GetUrl(actualCount, out actualCount2, actualUrl)); - Assert.Equal(url, new string(actualUrl, 0, actualUrl.Length - 1)); - } - - public static void ValidateDocument(ISymUnmanagedDocument document, string url, string algorithmId, byte[] checksum) - { - ValidateDocumentUrl(document, url); - - int actualCount, actualCount2; - - if (checksum != null) - { - Assert.Equal(HResult.S_OK, document.GetChecksum(0, out actualCount, null)); - byte[] actualChecksum = new byte[actualCount]; - Assert.Equal(HResult.S_OK, document.GetChecksum(actualCount, out actualCount2, actualChecksum)); - Assert.Equal(actualCount, actualCount2); - AssertEx.Equal(checksum, actualChecksum); - } - else - { - Assert.Equal(HResult.S_FALSE, document.GetChecksum(0, out actualCount, null)); - Assert.Equal(0, actualCount); - } - - var guid = Guid.NewGuid(); - - Assert.Equal(HResult.S_OK, document.GetChecksumAlgorithmId(ref guid)); - Assert.Equal(algorithmId != null ? new Guid(algorithmId) : default(Guid), guid); - - guid = Guid.NewGuid(); - Assert.Equal(HResult.S_OK, document.GetLanguageVendor(ref guid)); - Assert.Equal(new Guid("994b45c4-e6e9-11d2-903f-00c04fa302a1"), guid); - - guid = Guid.NewGuid(); - Assert.Equal(HResult.S_OK, document.GetDocumentType(ref guid)); - Assert.Equal(new Guid("5a869d0b-6611-11d3-bd2a-0000f80849bd"), guid); - } - - public static void ValidateRange(ISymUnmanagedScope scope, int expectedStartOffset, int expectedLength) - { - int actualOffset; - Assert.Equal(HResult.S_OK, scope.GetStartOffset(out actualOffset)); - Assert.Equal(expectedStartOffset, actualOffset); - - Assert.Equal(HResult.S_OK, scope.GetEndOffset(out actualOffset)); - Assert.Equal(expectedStartOffset + expectedLength, 2); - } - - public static void ValidateConstant(ISymUnmanagedConstant constant, string name, object value, byte[] signature) - { - int length, length2; - - // name: - Assert.Equal(HResult.S_OK, constant.GetName(0, out length, null)); - Assert.Equal(name.Length + 1, length); - var actualName = new char[length]; - Assert.Equal(HResult.S_OK, constant.GetName(length, out length2, actualName)); - Assert.Equal(length, length2); - Assert.Equal(name + "\0", new string(actualName)); - - // value: - object actualValue; - Assert.Equal(HResult.S_OK, constant.GetValue(out actualValue)); - Assert.Equal(value, actualValue); - - // signature: - Assert.Equal(HResult.S_OK, constant.GetSignature(0, out length, null)); - var actualSignature = new byte[length]; - Assert.Equal(HResult.S_OK, constant.GetSignature(length, out length2, actualSignature)); - Assert.Equal(length, length2); - AssertEx.Equal(signature, actualSignature); - } - - public static void ValidateVariable(ISymUnmanagedVariable variable, string name, int slot, LocalVariableAttributes attributes, byte[] signature) - { - int length, length2; - - // name: - Assert.Equal(HResult.S_OK, variable.GetName(0, out length, null)); - Assert.Equal(name.Length + 1, length); - var actualName = new char[length]; - Assert.Equal(HResult.S_OK, variable.GetName(length, out length2, actualName)); - Assert.Equal(length, length2); - Assert.Equal(name + "\0", new string(actualName)); - - int value; - Assert.Equal(HResult.S_OK, variable.GetAddressField1(out value)); - Assert.Equal(slot, value); - - Assert.Equal(HResult.E_NOTIMPL, variable.GetAddressField2(out value)); - Assert.Equal(HResult.E_NOTIMPL, variable.GetAddressField3(out value)); - Assert.Equal(HResult.E_NOTIMPL, variable.GetStartOffset(out value)); - Assert.Equal(HResult.E_NOTIMPL, variable.GetEndOffset(out value)); - - Assert.Equal(HResult.S_OK, variable.GetAttributes(out value)); - Assert.Equal(attributes, (LocalVariableAttributes)value); - - Assert.Equal(HResult.S_OK, variable.GetAddressKind(out value)); - Assert.Equal(1, value); - - Assert.Equal(HResult.S_OK, variable.GetSignature(0, out length, null)); - var actualSignature = new byte[length]; - Assert.Equal(HResult.S_OK, variable.GetSignature(length, out length2, actualSignature)); - Assert.Equal(length, length2); - AssertEx.Equal(signature, actualSignature); - } - - public static void ValidateRootScope(ISymUnmanagedScope scope) - { - int count; - Assert.Equal(HResult.S_OK, scope.GetLocalCount(out count)); - Assert.Equal(0, count); - - Assert.Equal(HResult.S_OK, ((ISymUnmanagedScope2)scope).GetConstantCount(out count)); - Assert.Equal(0, count); - - Assert.Equal(HResult.S_OK, ((ISymUnmanagedScope2)scope).GetNamespaces(0, out count, null)); - Assert.Equal(0, count); - - ISymUnmanagedScope parent; - Assert.Equal(HResult.S_OK, scope.GetParent(out parent)); - Assert.Null(parent); - } - - public static ISymUnmanagedScope[] GetAndValidateChildScopes(ISymUnmanagedScope scope, int expectedCount) - { - int count, count2; - Assert.Equal(HResult.S_OK, scope.GetChildren(0, out count, null)); - Assert.Equal(expectedCount, count); - var children = new ISymUnmanagedScope[count]; - Assert.Equal(HResult.S_OK, scope.GetChildren(count, out count2, children)); - Assert.Equal(count, count2); - return children; - } - - public static ISymUnmanagedConstant[] GetAndValidateConstants(ISymUnmanagedScope scope, int expectedCount) - { - int count, count2; - Assert.Equal(HResult.S_OK, ((ISymUnmanagedScope2)scope).GetConstants(0, out count, null)); - Assert.Equal(expectedCount, count); - var constants = new ISymUnmanagedConstant[count]; - Assert.Equal(HResult.S_OK, ((ISymUnmanagedScope2)scope).GetConstants(count, out count2, constants)); - Assert.Equal(count, count2); - return constants; - } - - public static ISymUnmanagedVariable[] GetAndValidateVariables(ISymUnmanagedScope scope, int expectedCount) - { - int count, count2, count3; - Assert.Equal(HResult.S_OK, scope.GetLocalCount(out count)); - Assert.Equal(expectedCount, count); - Assert.Equal(HResult.S_OK, scope.GetLocals(0, out count2, null)); - Assert.Equal(expectedCount, count2); - var variables = new ISymUnmanagedVariable[count]; - Assert.Equal(HResult.S_OK, scope.GetLocals(count, out count3, variables)); - Assert.Equal(count, count3); - return variables; - } - - public static void ValidateAsyncMethod(ISymUnmanagedReader symReader, int moveNextMethodToken, int kickoffMethodToken, int catchHandlerOffset, int[] yieldOffsets, int[] resumeOffsets) - { - ISymUnmanagedMethod method; - Assert.Equal(HResult.S_OK, symReader.GetMethod(moveNextMethodToken, out method)); - - var asyncMethod = (ISymUnmanagedAsyncMethod)method; - - bool isAsync; - Assert.Equal(HResult.S_OK, asyncMethod.IsAsyncMethod(out isAsync)); - Assert.True(isAsync); - - int actualKickoffMethodToken; - Assert.Equal(HResult.S_OK, asyncMethod.GetKickoffMethod(out actualKickoffMethodToken)); - Assert.Equal(kickoffMethodToken, actualKickoffMethodToken); - - bool hasCatchHandlerILOffset; - Assert.Equal(HResult.S_OK, asyncMethod.HasCatchHandlerILOffset(out hasCatchHandlerILOffset)); - Assert.Equal(catchHandlerOffset >= 0, hasCatchHandlerILOffset); - - int actualCatchHandlerOffset; - if (hasCatchHandlerILOffset) - { - Assert.Equal(HResult.S_OK, asyncMethod.GetCatchHandlerILOffset(out actualCatchHandlerOffset)); - Assert.Equal(catchHandlerOffset, actualCatchHandlerOffset); - } - else - { - Assert.Equal(HResult.E_UNEXPECTED, asyncMethod.GetCatchHandlerILOffset(out actualCatchHandlerOffset)); - } - - int count, count2; - Assert.Equal(HResult.S_OK, asyncMethod.GetAsyncStepInfoCount(out count)); - Assert.Equal(yieldOffsets.Length, count); - Assert.Equal(resumeOffsets.Length, count); - - var actualYieldOffsets = new int[count]; - var actualResumeOffsets = new int[count]; - var actualResumeMethods = new int[count]; - - Assert.Equal(HResult.S_OK, asyncMethod.GetAsyncStepInfo(count, out count2, actualYieldOffsets, actualResumeOffsets, actualResumeMethods)); - - AssertEx.Equal(yieldOffsets, actualYieldOffsets); - AssertEx.Equal(resumeOffsets, actualResumeOffsets); - - foreach (int actualResumeMethod in actualResumeMethods) - { - Assert.Equal(moveNextMethodToken, actualResumeMethod); - } - } - - internal static int[] GetMethodTokensFromDocumentPosition( - ISymUnmanagedReader symReader, - ISymUnmanagedDocument symDocument, - int line, - int column) - { - Assert.True(line >= 1); - Assert.True(column >= 0); - - int count; - Assert.Equal(HResult.S_OK, symReader.GetMethodsFromDocumentPosition(symDocument, line, column, 0, out count, null)); - - var methods = new ISymUnmanagedMethod[count]; - int count2; - Assert.Equal(HResult.S_OK, symReader.GetMethodsFromDocumentPosition(symDocument, line, column, count, out count2, methods)); - Assert.Equal(count, count2); - - return methods.Select(m => - { - int token; - Assert.Equal(HResult.S_OK, m.GetToken(out token)); - return token; - }).ToArray(); - } - - internal static int[][] GetMethodTokensForEachLine(ISymUnmanagedReader symReader, ISymUnmanagedDocument symDocument, int minLine, int maxLine) - { - Assert.True(minLine >= 1); - Assert.True(maxLine >= minLine); - - var result = new List(); - - for (int line = minLine; line <= maxLine; line++) - { - int[] allMethodTokens = GetMethodTokensFromDocumentPosition(symReader, symDocument, line, 0); - - ISymUnmanagedMethod method; - int hr = symReader.GetMethodFromDocumentPosition(symDocument, line, 1, out method); - - if (hr != HResult.S_OK) - { - Assert.Equal(HResult.E_FAIL, hr); - Assert.Equal(0, allMethodTokens.Length); - } - else - { - int primaryToken; - Assert.Equal(HResult.S_OK, method.GetToken(out primaryToken)); - Assert.Equal(primaryToken, allMethodTokens.First()); - } - - result.Add(allMethodTokens); - } - - return result.ToArray(); - } - - public static int[] GetILOffsetForEachLine( - ISymUnmanagedReader symReader, - int methodToken, - ISymUnmanagedDocument document, - int minLine, int maxLine) - { - Assert.True(minLine >= 1); - Assert.True(maxLine >= minLine); - - var result = new List(); - - ISymUnmanagedMethod method; - Assert.Equal(HResult.S_OK, symReader.GetMethod(methodToken, out method)); - - for (int line = minLine; line <= maxLine; line++) - { - int offset; - int hr = method.GetOffset(document, line, 0, out offset); - - if (hr != HResult.S_OK) - { - Assert.Equal(HResult.E_FAIL, hr); - offset = int.MaxValue; - } - - result.Add(offset); - } - - return result.ToArray(); - } - - public static int[][] GetILOffsetRangesForEachLine( - ISymUnmanagedReader symReader, - int methodToken, - ISymUnmanagedDocument document, - int minLine, int maxLine) - { - Assert.True(minLine >= 1); - Assert.True(maxLine >= minLine); - - var result = new List(); - - ISymUnmanagedMethod method; - Assert.Equal(HResult.S_OK, symReader.GetMethod(methodToken, out method)); - - for (int line = minLine; line <= maxLine; line++) - { - int count; - Assert.Equal(HResult.S_OK, method.GetRanges(document, line, 0, 0, out count, null)); - - int count2; - int[] ranges = new int[count]; - Assert.Equal(HResult.S_OK, method.GetRanges(document, line, 0, count, out count2, ranges)); - Assert.Equal(count, count2); - - result.Add(ranges); - } - - return result.ToArray(); - } - - public static void ValidateMethodExtent(ISymUnmanagedReader symReader, int methodDef, string documentName, int minLine, int maxLine) - { - Assert.True(minLine >= 1); - Assert.True(maxLine >= minLine); - - ISymUnmanagedMethod method; - Assert.Equal(HResult.S_OK, symReader.GetMethod(methodDef, out method)); - - ISymUnmanagedDocument document; - Assert.Equal(HResult.S_OK, symReader.GetDocument(documentName, default(Guid), default(Guid), default(Guid), out document)); - - int actualMinLine, actualMaxLine; - Assert.Equal(HResult.S_OK, ((ISymEncUnmanagedMethod)method).GetSourceExtentInDocument(document, out actualMinLine, out actualMaxLine)); - - Assert.Equal(minLine, actualMinLine); - Assert.Equal(maxLine, actualMaxLine); - } - - public static void ValidateNoMethodExtent(ISymUnmanagedReader symReader, int methodDef, string documentName) - { - ISymUnmanagedMethod method; - Assert.Equal(HResult.S_OK, symReader.GetMethod(methodDef, out method)); - - ISymUnmanagedDocument document; - Assert.Equal(HResult.S_OK, symReader.GetDocument(documentName, default(Guid), default(Guid), default(Guid), out document)); - - int actualMinLine, actualMaxLine; - Assert.Equal(HResult.E_FAIL, ((ISymEncUnmanagedMethod)method).GetSourceExtentInDocument(document, out actualMinLine, out actualMaxLine)); - } - - public static int[] FindClosestLineForEachLine(ISymUnmanagedDocument document, int minLine, int maxLine) - { - Assert.True(minLine >= 1); - Assert.True(maxLine >= minLine); - - var result = new List(); - - for (int line = minLine; line <= maxLine; line++) - { - int closestLine; - int hr = document.FindClosestLine(line, out closestLine); - - if (hr != HResult.S_OK) - { - Assert.Equal(HResult.E_FAIL, hr); - closestLine = 0; - } - - result.Add(closestLine); - } - - return result.ToArray(); - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestResources.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestResources.cs deleted file mode 100644 index c751499ed1e914aad46132506c738e8947a96776..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/TestResources.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.Collections.Generic; - -namespace TestResources -{ - public static class Documents - { - private static byte[] s_portableDll; - public static byte[] PortableDll => ResourceLoader.GetOrCreateResource(ref s_portableDll, nameof(Documents) + ".dllx"); - - private static byte[] s_portablePdb; - public static byte[] PortablePdb => ResourceLoader.GetOrCreateResource(ref s_portablePdb, nameof(Documents) + ".pdbx"); - - private static byte[] s_dll; - public static byte[] Dll => ResourceLoader.GetOrCreateResource(ref s_dll, nameof(Documents) + ".dll"); - - private static byte[] s_pdb; - public static byte[] Pdb => ResourceLoader.GetOrCreateResource(ref s_pdb, nameof(Documents) + ".pdb"); - - public static KeyValuePair PortableDllAndPdb => new KeyValuePair(PortableDll, PortablePdb); - public static KeyValuePair DllAndPdb => new KeyValuePair(Dll, Pdb); - } - - public static class Scopes - { - private static byte[] s_dll; - public static byte[] Dll => ResourceLoader.GetOrCreateResource(ref s_dll, nameof(Scopes) + ".dll"); - - private static byte[] s_pdb; - public static byte[] Pdb => ResourceLoader.GetOrCreateResource(ref s_pdb, nameof(Scopes) + ".pdbx"); - - public static KeyValuePair DllAndPdb => new KeyValuePair(Dll, Pdb); - } - - public static class Async - { - private static byte[] s_portableDll; - public static byte[] PortableDll => ResourceLoader.GetOrCreateResource(ref s_portableDll, nameof(Async) + ".dllx"); - - private static byte[] s_portablePdb; - public static byte[] PortablePdb => ResourceLoader.GetOrCreateResource(ref s_portablePdb, nameof(Async) + ".pdbx"); - - private static byte[] s_dll; - public static byte[] Dll => ResourceLoader.GetOrCreateResource(ref s_dll, nameof(Async) + ".dll"); - - private static byte[] s_pdb; - public static byte[] Pdb => ResourceLoader.GetOrCreateResource(ref s_pdb, nameof(Async) + ".pdb"); - - public static KeyValuePair PortableDllAndPdb => new KeyValuePair(PortableDll, PortablePdb); - public static KeyValuePair DllAndPdb => new KeyValuePair(Dll, Pdb); - } - - public static class MethodBoundaries - { - private static byte[] s_portableDll; - public static byte[] PortableDll => ResourceLoader.GetOrCreateResource(ref s_portableDll, nameof(MethodBoundaries) + ".dllx"); - - private static byte[] s_portablePdb; - public static byte[] PortablePdb => ResourceLoader.GetOrCreateResource(ref s_portablePdb, nameof(MethodBoundaries) + ".pdbx"); - - private static byte[] s_dll; - public static byte[] Dll => ResourceLoader.GetOrCreateResource(ref s_dll, nameof(MethodBoundaries) + ".dll"); - - private static byte[] s_pdb; - public static byte[] Pdb => ResourceLoader.GetOrCreateResource(ref s_pdb, nameof(MethodBoundaries) + ".pdb"); - - public static KeyValuePair PortableDllAndPdb => new KeyValuePair(PortableDll, PortablePdb); - public static KeyValuePair DllAndPdb => new KeyValuePair(Dll, Pdb); - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Utilities/EnumerableHelpersTests.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Utilities/EnumerableHelpersTests.cs deleted file mode 100644 index f4b6c5e5aa7c210010ad36dda5cf1d2e2d3bb05c..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Utilities/EnumerableHelpersTests.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using Roslyn.Test.Utilities; -using Xunit; - -namespace Microsoft.DiaSymReader.PortablePdb.UnitTests -{ - public class EnumerableHelpersTests - { - [Fact] - public void GroupBy1() - { - var pairs = new[] - { - KeyValuePair.Create("A", 1), - KeyValuePair.Create("B", 2), - KeyValuePair.Create("C", 3), - KeyValuePair.Create("a", 4), - KeyValuePair.Create("B", 5), - KeyValuePair.Create("A", 6), - KeyValuePair.Create("d", 7), - }; - - var groups = pairs.GroupBy(StringComparer.OrdinalIgnoreCase); - AssertEx.SetEqual(new[] { "A", "B", "C", "d" }, groups.Keys); - - Assert.Equal(0, groups["A"].Key); - AssertEx.Equal(new[] { 1, 4, 6 }, groups["A"].Value); - - Assert.Equal(0, groups["B"].Key); - AssertEx.Equal(new[] { 2, 5 }, groups["B"].Value); - - Assert.Equal(3, groups["C"].Key); - Assert.True(groups["C"].Value.IsDefault); - - Assert.Equal(7, groups["d"].Key); - Assert.True(groups["d"].Value.IsDefault); - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Utilities/SymMetadataImport.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Utilities/SymMetadataImport.cs deleted file mode 100644 index 2e8dd02806612ac50b77b3425fef22fa4693687d..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/Utilities/SymMetadataImport.cs +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.IO; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Reflection.PortableExecutable; -using System.Runtime.InteropServices; -using System.Text; - -namespace Microsoft.DiaSymReader.PortablePdb.UnitTests -{ - internal sealed class SymMetadataImport : IMetadataImport, IDisposable - { - private readonly PEReader _peReader; - public readonly MetadataReader MetadataReader; - - public SymMetadataImport(Stream peStream) - { - _peReader = new PEReader(peStream); - MetadataReader = _peReader.GetMetadataReader(); - } - - public void Dispose() - { - _peReader.Dispose(); - } - - public unsafe int GetSigFromToken(int tkSignature, out byte* ppvSig, out int pcbSig) - { - var signatureHandle = (StandaloneSignatureHandle)MetadataTokens.Handle(tkSignature); - var bytes = MetadataReader.GetBlobBytes(MetadataReader.GetStandaloneSignature(signatureHandle).Signature); - - var pinned = GCHandle.Alloc(bytes, GCHandleType.Pinned); - ppvSig = (byte*)pinned.AddrOfPinnedObject(); - pcbSig = bytes.Length; - return HResult.S_OK; - } - - public void GetTypeDefProps( - int typeDefinition, - [MarshalAs(UnmanagedType.LPWStr), Out]StringBuilder qualifiedName, - int qualifiedNameBufferLength, - out int qualifiedNameLength, - [MarshalAs(UnmanagedType.U4)]out TypeAttributes attributes, - out int baseType) - { - var handle = (TypeDefinitionHandle)MetadataTokens.Handle(typeDefinition); - var typeDef = MetadataReader.GetTypeDefinition(handle); - - if (qualifiedName != null) - { - qualifiedName.Clear(); - - if (!typeDef.Namespace.IsNil) - { - qualifiedName.Append(MetadataReader.GetString(typeDef.Namespace)); - qualifiedName.Append('.'); - } - - qualifiedName.Append(MetadataReader.GetString(typeDef.Name)); - qualifiedNameLength = qualifiedName.Length; - } - else - { - qualifiedNameLength = - (typeDef.Namespace.IsNil ? 0 : MetadataReader.GetString(typeDef.Namespace).Length + 1) + - MetadataReader.GetString(typeDef.Name).Length; - } - - baseType = MetadataTokens.GetToken(typeDef.BaseType); - attributes = typeDef.Attributes; - } - - public void GetTypeRefProps( - int typeReference, - out int resolutionScope, - [MarshalAs(UnmanagedType.LPWStr), Out]StringBuilder qualifiedName, - int qualifiedNameBufferLength, - out int qualifiedNameLength) - { - var handle = (TypeReferenceHandle)MetadataTokens.Handle(typeReference); - var typeRef = MetadataReader.GetTypeReference(handle); - - if (qualifiedName != null) - { - qualifiedName.Clear(); - - if (!typeRef.Namespace.IsNil) - { - qualifiedName.Append(MetadataReader.GetString(typeRef.Namespace)); - qualifiedName.Append('.'); - } - - qualifiedName.Append(MetadataReader.GetString(typeRef.Name)); - qualifiedNameLength = qualifiedName.Length; - } - else - { - qualifiedNameLength = - (typeRef.Namespace.IsNil ? 0 : MetadataReader.GetString(typeRef.Namespace).Length + 1) + - MetadataReader.GetString(typeRef.Name).Length; - } - - resolutionScope = MetadataTokens.GetToken(typeRef.ResolutionScope); - } - - #region Not Implemented - - public void CloseEnum(uint handleEnum) - { - throw new NotImplementedException(); - } - - public uint CountEnum(uint handleEnum) - { - throw new NotImplementedException(); - } - - public uint EnumCustomAttributes(ref uint handlePointerEnum, uint tk, uint tokenType, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)]uint[] arrayCustomAttributes, uint countMax) - { - throw new NotImplementedException(); - } - - public unsafe uint EnumEvents(ref uint handlePointerEnum, uint td, uint* arrayEvents, uint countMax) - { - throw new NotImplementedException(); - } - - public unsafe uint EnumFields(ref uint handlePointerEnum, uint cl, uint* arrayFields, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumFieldsWithName(ref uint handlePointerEnum, uint cl, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)]uint[] arrayFields, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumInterfaceImpls(ref uint handlePointerEnum, uint td, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]uint[] arrayImpls, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumMemberRefs(ref uint handlePointerEnum, uint tokenParent, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]uint[] arrayMemberRefs, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumMembers(ref uint handlePointerEnum, uint cl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]uint[] arrayMembers, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumMembersWithName(ref uint handlePointerEnum, uint cl, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)]uint[] arrayMembers, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumMethodImpls(ref uint handlePointerEnum, uint td, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)]uint[] arrayMethodBody, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)]uint[] arrayMethodDecl, uint countMax) - { - throw new NotImplementedException(); - } - - public unsafe uint EnumMethods(ref uint handlePointerEnum, uint cl, uint* arrayMethods, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumMethodSemantics(ref uint handlePointerEnum, uint mb, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]uint[] arrayEventProp, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumMethodsWithName(ref uint handlePointerEnum, uint cl, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)]uint[] arrayMethods, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumModuleRefs(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]uint[] arrayModuleRefs, uint cmax) - { - throw new NotImplementedException(); - } - - public uint EnumParams(ref uint handlePointerEnum, uint mb, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]uint[] arrayParams, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumPermissionSets(ref uint handlePointerEnum, uint tk, uint dwordActions, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)]uint[] arrayPermission, uint countMax) - { - throw new NotImplementedException(); - } - - public unsafe uint EnumProperties(ref uint handlePointerEnum, uint td, uint* arrayProperties, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumSignatures(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]uint[] arraySignatures, uint cmax) - { - throw new NotImplementedException(); - } - - public uint EnumTypeDefs(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]uint[] arrayTypeDefs, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumTypeRefs(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]uint[] arrayTypeRefs, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumTypeSpecs(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]uint[] arrayTypeSpecs, uint cmax) - { - throw new NotImplementedException(); - } - - public uint EnumUnresolvedMethods(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]uint[] arrayMethods, uint countMax) - { - throw new NotImplementedException(); - } - - public uint EnumUserStrings(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]uint[] arrayStrings, uint cmax) - { - throw new NotImplementedException(); - } - - public uint FindField(uint td, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]byte[] voidPointerSigBlob, uint byteCountSigBlob) - { - throw new NotImplementedException(); - } - - public uint FindMember(uint td, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]byte[] voidPointerSigBlob, uint byteCountSigBlob) - { - throw new NotImplementedException(); - } - - public uint FindMemberRef(uint td, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]byte[] voidPointerSigBlob, uint byteCountSigBlob) - { - throw new NotImplementedException(); - } - - public uint FindMethod(uint td, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]byte[] voidPointerSigBlob, uint byteCountSigBlob) - { - throw new NotImplementedException(); - } - - public uint FindTypeDefByName(string stringTypeDef, uint tokenEnclosingClass) - { - throw new NotImplementedException(); - } - - public uint FindTypeRef(uint tokenResolutionScope, string stringName) - { - throw new NotImplementedException(); - } - - public uint GetClassLayout(uint td, out uint pdwPackSize, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)]ulong[] arrayFieldOffset, uint countMax, out uint countPointerFieldOffset) - { - throw new NotImplementedException(); - } - - public unsafe uint GetCustomAttributeByName(uint tokenObj, string stringName, out void* ppData) - { - throw new NotImplementedException(); - } - - public unsafe uint GetCustomAttributeProps(uint cv, out uint ptkObj, out uint ptkType, out void* ppBlob) - { - throw new NotImplementedException(); - } - - public uint GetEventProps(uint ev, out uint pointerClass, StringBuilder stringEvent, uint cchEvent, out uint pchEvent, out uint pdwEventFlags, out uint ptkEventType, out uint pmdAddOn, out uint pmdRemoveOn, out uint pmdFire, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 11)]uint[] rmdOtherMethod, uint countMax) - { - throw new NotImplementedException(); - } - - public unsafe uint GetFieldMarshal(uint tk, out byte* ppvNativeType) - { - throw new NotImplementedException(); - } - - public unsafe uint GetFieldProps(uint mb, out uint pointerClass, StringBuilder stringField, uint cchField, out uint pchField, out uint pdwAttr, out byte* ppvSigBlob, out uint pcbSigBlob, out uint pdwCPlusTypeFlag, out void* ppValue) - { - throw new NotImplementedException(); - } - - public uint GetInterfaceImplProps(uint impl, out uint pointerClass) - { - throw new NotImplementedException(); - } - - public unsafe uint GetMemberProps(uint mb, out uint pointerClass, StringBuilder stringMember, uint cchMember, out uint pchMember, out uint pdwAttr, out byte* ppvSigBlob, out uint pcbSigBlob, out uint pulCodeRVA, out uint pdwImplFlags, out uint pdwCPlusTypeFlag, out void* ppValue) - { - throw new NotImplementedException(); - } - - public unsafe uint GetMemberRefProps(uint mr, ref uint ptk, StringBuilder stringMember, uint cchMember, out uint pchMember, out byte* ppvSigBlob) - { - throw new NotImplementedException(); - } - - public uint GetMethodProps(uint mb, out uint pointerClass, IntPtr stringMethod, uint cchMethod, out uint pchMethod, IntPtr pdwAttr, IntPtr ppvSigBlob, IntPtr pcbSigBlob, IntPtr pulCodeRVA) - { - throw new NotImplementedException(); - } - - public uint GetMethodSemantics(uint mb, uint tokenEventProp) - { - throw new NotImplementedException(); - } - - public uint GetModuleFromScope() - { - throw new NotImplementedException(); - } - - public uint GetModuleRefProps(uint mur, StringBuilder stringName, uint cchName) - { - throw new NotImplementedException(); - } - - public uint GetNameFromToken(uint tk) - { - throw new NotImplementedException(); - } - - public unsafe uint GetNativeCallConvFromSig(void* voidPointerSig, uint byteCountSig) - { - throw new NotImplementedException(); - } - - public uint GetNestedClassProps(uint typeDefNestedClass) - { - throw new NotImplementedException(); - } - - public int GetParamForMethodIndex(uint md, uint ulongParamSeq, out uint pointerParam) - { - throw new NotImplementedException(); - } - - public unsafe uint GetParamProps(uint tk, out uint pmd, out uint pulSequence, StringBuilder stringName, uint cchName, out uint pchName, out uint pdwAttr, out uint pdwCPlusTypeFlag, out void* ppValue) - { - throw new NotImplementedException(); - } - - public unsafe uint GetPermissionSetProps(uint pm, out uint pdwAction, out void* ppvPermission) - { - throw new NotImplementedException(); - } - - public uint GetPinvokeMap(uint tk, out uint pdwMappingFlags, StringBuilder stringImportName, uint cchImportName, out uint pchImportName) - { - throw new NotImplementedException(); - } - - public unsafe uint GetPropertyProps(uint prop, out uint pointerClass, StringBuilder stringProperty, uint cchProperty, out uint pchProperty, out uint pdwPropFlags, out byte* ppvSig, out uint bytePointerSig, out uint pdwCPlusTypeFlag, out void* ppDefaultValue, out uint pcchDefaultValue, out uint pmdSetter, out uint pmdGetter, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 14)]uint[] rmdOtherMethod, uint countMax) - { - throw new NotImplementedException(); - } - - public uint GetRVA(uint tk, out uint pulCodeRVA) - { - throw new NotImplementedException(); - } - - public Guid GetScopeProps(StringBuilder stringName, uint cchName, out uint pchName) - { - throw new NotImplementedException(); - } - - public unsafe uint GetTypeSpecFromToken(uint typespec, out byte* ppvSig) - { - throw new NotImplementedException(); - } - - public uint GetUserString(uint stk, StringBuilder stringString, uint cchString) - { - throw new NotImplementedException(); - } - - public int IsGlobal(uint pd) - { - throw new NotImplementedException(); - } - - [return: MarshalAs(UnmanagedType.Bool)] - public bool IsValidToken(uint tk) - { - throw new NotImplementedException(); - } - - public void ResetEnum(uint handleEnum, uint ulongPos) - { - throw new NotImplementedException(); - } - - public uint ResolveTypeRef(uint tr, [In]ref Guid riid, [MarshalAs(UnmanagedType.Interface)]out object ppIScope) - { - throw new NotImplementedException(); - } - - #endregion - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/project.json b/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/project.json deleted file mode 100644 index f0e279df1198f15dd1f6befdb491a0f285146c6b..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb.Tests/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Portable.Compatibility": "1.0.1", - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Runtime.InteropServices": "4.1.0", - "System.IO.FileSystem": "4.0.1" - }, - "frameworks": { - "netstandard1.3": { - "imports": [ "portable-net452", "dotnet5.4" ] - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/AsyncMethodData.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/AsyncMethodData.cs deleted file mode 100644 index 526eb233ead1d6ad52ec4bb85a4b03a163dcf53f..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/AsyncMethodData.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Immutable; -using System.Diagnostics; -using System.Reflection.Metadata; -using System.Runtime.InteropServices; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal sealed class AsyncMethodData - { - public static readonly AsyncMethodData None = new AsyncMethodData(); - - public readonly MethodDefinitionHandle KickoffMethod; - public readonly int CatchHandlerOffset; - public readonly ImmutableArray YieldOffsets; - public readonly ImmutableArray ResumeOffsets; - public readonly ImmutableArray ResumeMethods; - - private AsyncMethodData() - { - } - - public AsyncMethodData( - MethodDefinitionHandle kickoffMethod, - int catchHandlerOffset, - ImmutableArray yieldOffsets, - ImmutableArray resumeOffsets, - ImmutableArray resumeMethods) - { - Debug.Assert(!kickoffMethod.IsNil); - Debug.Assert(catchHandlerOffset >= -1); - - Debug.Assert(yieldOffsets.Length == resumeOffsets.Length); - Debug.Assert(yieldOffsets.Length == resumeMethods.Length); - - KickoffMethod = kickoffMethod; - CatchHandlerOffset = catchHandlerOffset; - YieldOffsets = yieldOffsets; - ResumeOffsets = resumeOffsets; - ResumeMethods = resumeMethods; - } - - public bool IsNone => ReferenceEquals(this, None); - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/ChildScopeData.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/ChildScopeData.cs deleted file mode 100644 index 9c452203ad59390a8ca00516786f271caa85a4be..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/ChildScopeData.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Immutable; -using System.Diagnostics; -using System.Reflection.Metadata; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal sealed class ChildScopeData : ScopeData - { - private readonly LocalScopeHandle _handle; - private readonly ScopeData _parent; - - internal ChildScopeData(SymMethod symMethod, ScopeData parent, LocalScopeHandle handle) - : base(symMethod) - { - Debug.Assert(parent != null); - Debug.Assert(!handle.IsNil); - - _handle = handle; - _parent = parent; - } - - internal override ScopeData Parent => _parent; - - internal override int StartOffset - { - get - { - return SymMethod.MetadataReader.GetLocalScope(_handle).StartOffset; - } - } - - internal override int EndOffset - { - get - { - return AdjustEndOffset(SymMethod.MetadataReader.GetLocalScope(_handle).EndOffset); - } - } - - protected override ImmutableArray CreateChildren() - { - // TODO: pool? - var builder = ImmutableArray.CreateBuilder(); - - var children = SymMethod.MetadataReader.GetLocalScope(_handle).GetChildren(); - while (children.MoveNext()) - { - builder.Add(new ChildScopeData(SymMethod, this, children.Current)); - } - - return builder.ToImmutable(); - } - - internal override int GetConstants(int bufferLength, out int count, ISymUnmanagedConstant[] constants) - { - var symReader = SymMethod.SymReader; - var mdReader = symReader.MetadataReader; - var scope = mdReader.GetLocalScope(_handle); - - var handles = scope.GetLocalConstants(); - - int i = 0; - foreach (var handle in handles) - { - if (i >= bufferLength) - { - break; - } - - constants[i++] = new SymConstant(symReader, handle); - } - - count = (bufferLength == 0) ? handles.Count : i; - return HResult.S_OK; - } - - internal override int GetLocals(int bufferLength, out int count, ISymUnmanagedVariable[] locals) - { - var mdReader = SymMethod.MetadataReader; - var scope = mdReader.GetLocalScope(_handle); - - var handles = scope.GetLocalVariables(); - - int i = 0; - foreach (var handle in handles) - { - if (i >= bufferLength) - { - break; - } - - locals[i++] = new SymVariable(SymMethod, handle); - } - - count = (bufferLength == 0) ? handles.Count : i; - return HResult.S_OK; - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/DocumentMap.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/DocumentMap.cs deleted file mode 100644 index 48c980c1b979329ad96f46598ac8c6958abeb95b..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/DocumentMap.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Diagnostics; -using System.Reflection.Metadata; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal sealed class DocumentMap - { - private struct DocumentNameAndHandle - { - public readonly DocumentHandle Handle; - public readonly string FileName; - - public DocumentNameAndHandle(DocumentHandle handle, string fileName) - { - Handle = handle; - FileName = fileName; - } - } - - private readonly MetadataReader _reader; - - // { last part of document name -> one or many document handles that have the part in common } - private readonly IReadOnlyDictionary>> _map; - - public DocumentMap(MetadataReader reader) - { - _reader = reader; - - // group ignoring case, we will match the case within the group - _map = GetDocumentsByFileName(reader).GroupBy(StringComparer.OrdinalIgnoreCase); - } - - private static IEnumerable> GetDocumentsByFileName(MetadataReader reader) - { - foreach (var documentHandle in reader.Documents) - { - string fileName = GetFileName(reader, documentHandle); - - // invalid metadata: document doesn't have a name - if (fileName == null) - { - continue; - } - - yield return new KeyValuePair(fileName, new DocumentNameAndHandle(documentHandle, fileName)); - } - } - - private static string GetFileName(MetadataReader reader, DocumentHandle documentHandle) - { - var document = reader.GetDocument(documentHandle); - - if (document.Name.IsNil) - { - return null; - } - - var nameReader = reader.GetBlobReader(document.Name); - - int separator = nameReader.ReadByte(); - if (!FileNameUtilities.IsDirectorySeparator((char)separator)) - { - return FileNameUtilities.GetFileName(reader.GetString(document.Name)); - } - - // find the last part handle: - BlobHandle partHandle = default(BlobHandle); - while (nameReader.RemainingBytes > 0) - { - partHandle = nameReader.ReadBlobHandle(); - } - - if (partHandle.IsNil) - { - return string.Empty; - } - - var partReader = reader.GetBlobReader(partHandle); - var part = partReader.ReadUTF8(partReader.Length); - if (part.IndexOf('\0') >= 0) - { - // bad metadata - return null; - } - - // it is valid to encode document name so that the parts contain directory separators: - return FileNameUtilities.GetFileName(part); - } - - internal bool TryGetDocument(string fullPath, out DocumentHandle documentHandle) - { - var fileName = FileNameUtilities.GetFileName(fullPath); - - KeyValuePair> documents; - if (!_map.TryGetValue(fileName, out documents)) - { - documentHandle = default(DocumentHandle); - return false; - } - - // SymReader first attempts to find the document by the full path, then by file name with extension. - - if (documents.Key.FileName != null) - { - // There is only one document with the specified file name. - // SymReader returns the document regardless of whether the path matches the name. - documentHandle = documents.Key.Handle; - return true; - } - - Debug.Assert(documents.Value.Length > 1); - - // We have multiple candidates with the same file name. Find the one whose name matches the specified full path. - // If none does return the first one. It will be the one with the smallest handle, due to the multi-map construction implementation. - - // First try to find candidate whose full name is exactly matching. - foreach (DocumentNameAndHandle candidate in documents.Value) - { - if (_reader.StringComparer.Equals(_reader.GetDocument(candidate.Handle).Name, fullPath, ignoreCase: false)) - { - documentHandle = candidate.Handle; - return true; - } - } - - // Then try to find candidate whose full name is matching ignoring case. - foreach (DocumentNameAndHandle candidate in documents.Value) - { - if (_reader.StringComparer.Equals(_reader.GetDocument(candidate.Handle).Name, fullPath, ignoreCase: true)) - { - documentHandle = candidate.Handle; - return true; - } - } - - // Then try to find candidate whose file name is matching exactly. - foreach (DocumentNameAndHandle candidate in documents.Value) - { - if (candidate.FileName == fileName) - { - documentHandle = candidate.Handle; - return true; - } - } - - documentHandle = documents.Value[0].Handle; - return true; - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/IMetadataImport.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/IMetadataImport.cs deleted file mode 100644 index f53cd65933152ff27ec5faf967f69a824ef70df4..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/IMetadataImport.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Reflection; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Runtime.InteropServices; -using System.Text; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal static class IMetadataImportExtensions - { - public static string GetQualifiedTypeName(this IMetadataImport importer, Handle typeDefOrRef) - { - string qualifiedName; - if (typeDefOrRef.Kind == HandleKind.TypeDefinition) - { - TypeAttributes attributes; - int baseType; - importer.GetTypeDefProps(MetadataTokens.GetToken(typeDefOrRef), out qualifiedName, out attributes, out baseType); - } - else if (typeDefOrRef.Kind == HandleKind.TypeReference) - { - int resolutionScope; - importer.GetTypeRefProps(MetadataTokens.GetToken(typeDefOrRef), out resolutionScope, out qualifiedName); - } - else - { - qualifiedName = null; - } - - return qualifiedName; - } - - public static void GetTypeDefProps(this IMetadataImport importer, int typeDefinition, out string qualifiedName, out TypeAttributes attributes, out int baseType) - { - int bufferLength; - importer.GetTypeDefProps(typeDefinition, null, 0, out bufferLength, out attributes, out baseType); - - var buffer = new StringBuilder(bufferLength); - importer.GetTypeDefProps(typeDefinition, buffer, buffer.Capacity, out bufferLength, out attributes, out baseType); - qualifiedName = buffer.ToString(); - } - - public static void GetTypeRefProps(this IMetadataImport importer, int typeReference, out int resolutionScope, out string qualifiedName) - { - int bufferLength; - importer.GetTypeRefProps(typeReference, out resolutionScope, null, 0, out bufferLength); - - var buffer = new StringBuilder(bufferLength); - importer.GetTypeRefProps(typeReference, out resolutionScope, buffer, buffer.Capacity, out bufferLength); - qualifiedName = buffer.ToString(); - } - } - - [ComVisible(false)] - [ComImport] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [Guid("7DAC8207-D3AE-4c75-9B67-92801A497D44")] - public unsafe interface IMetadataImport - { - [PreserveSig] - void CloseEnum(uint handleEnum); - uint CountEnum(uint handleEnum); - void ResetEnum(uint handleEnum, uint ulongPos); - uint EnumTypeDefs(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] uint[] arrayTypeDefs, uint countMax); - uint EnumInterfaceImpls(ref uint handlePointerEnum, uint td, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] uint[] arrayImpls, uint countMax); - uint EnumTypeRefs(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] uint[] arrayTypeRefs, uint countMax); - uint FindTypeDefByName(string stringTypeDef, uint tokenEnclosingClass); - Guid GetScopeProps(StringBuilder stringName, uint cchName, out uint pchName); - uint GetModuleFromScope(); - - void GetTypeDefProps( - int typeDefinition, - [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder qualifiedName, - int qualifiedNameBufferLength, - out int qualifiedNameLength, - [MarshalAs(UnmanagedType.U4)] out TypeAttributes attributes, - out int baseType); - - uint GetInterfaceImplProps(uint impl, out uint pointerClass); - - void GetTypeRefProps( - int typeReference, - out int resolutionScope, - [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder qualifiedName, - int qualifiedNameBufferLength, - out int qualifiedNameLength); - - uint ResolveTypeRef(uint tr, [In] ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out object ppIScope); - uint EnumMembers(ref uint handlePointerEnum, uint cl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] uint[] arrayMembers, uint countMax); - uint EnumMembersWithName(ref uint handlePointerEnum, uint cl, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] uint[] arrayMembers, uint countMax); - uint EnumMethods(ref uint handlePointerEnum, uint cl, uint* arrayMethods, uint countMax); - uint EnumMethodsWithName(ref uint handlePointerEnum, uint cl, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] uint[] arrayMethods, uint countMax); - uint EnumFields(ref uint handlePointerEnum, uint cl, uint* arrayFields, uint countMax); - uint EnumFieldsWithName(ref uint handlePointerEnum, uint cl, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] uint[] arrayFields, uint countMax); - uint EnumParams(ref uint handlePointerEnum, uint mb, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] uint[] arrayParams, uint countMax); - uint EnumMemberRefs(ref uint handlePointerEnum, uint tokenParent, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] uint[] arrayMemberRefs, uint countMax); - uint EnumMethodImpls(ref uint handlePointerEnum, uint td, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] uint[] arrayMethodBody, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] uint[] arrayMethodDecl, uint countMax); - uint EnumPermissionSets(ref uint handlePointerEnum, uint tk, uint dwordActions, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] uint[] arrayPermission, - uint countMax); - uint FindMember(uint td, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] byte[] voidPointerSigBlob, uint byteCountSigBlob); - uint FindMethod(uint td, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] byte[] voidPointerSigBlob, uint byteCountSigBlob); - uint FindField(uint td, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] byte[] voidPointerSigBlob, uint byteCountSigBlob); - uint FindMemberRef(uint td, string stringName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] byte[] voidPointerSigBlob, uint byteCountSigBlob); - uint GetMethodProps(uint mb, out uint pointerClass, IntPtr stringMethod, uint cchMethod, out uint pchMethod, IntPtr pdwAttr, - IntPtr ppvSigBlob, IntPtr pcbSigBlob, IntPtr pulCodeRVA); - unsafe uint GetMemberRefProps(uint mr, ref uint ptk, StringBuilder stringMember, uint cchMember, out uint pchMember, out byte* ppvSigBlob); - uint EnumProperties(ref uint handlePointerEnum, uint td, uint* arrayProperties, uint countMax); - uint EnumEvents(ref uint handlePointerEnum, uint td, uint* arrayEvents, uint countMax); - uint GetEventProps(uint ev, out uint pointerClass, StringBuilder stringEvent, uint cchEvent, out uint pchEvent, out uint pdwEventFlags, - out uint ptkEventType, out uint pmdAddOn, out uint pmdRemoveOn, out uint pmdFire, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 11)] uint[] rmdOtherMethod, uint countMax); - uint EnumMethodSemantics(ref uint handlePointerEnum, uint mb, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] uint[] arrayEventProp, uint countMax); - uint GetMethodSemantics(uint mb, uint tokenEventProp); - uint GetClassLayout(uint td, out uint pdwPackSize, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] ulong[] arrayFieldOffset, uint countMax, out uint countPointerFieldOffset); - unsafe uint GetFieldMarshal(uint tk, out byte* ppvNativeType); - uint GetRVA(uint tk, out uint pulCodeRVA); - unsafe uint GetPermissionSetProps(uint pm, out uint pdwAction, out void* ppvPermission); - - [PreserveSig] - unsafe int GetSigFromToken( - int tkSignature, // Signature token. - out byte* ppvSig, // return pointer to signature blob - out int pcbSig); // return size of signature - - uint GetModuleRefProps(uint mur, StringBuilder stringName, uint cchName); - uint EnumModuleRefs(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] uint[] arrayModuleRefs, uint cmax); - unsafe uint GetTypeSpecFromToken(uint typespec, out byte* ppvSig); - uint GetNameFromToken(uint tk); - uint EnumUnresolvedMethods(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] uint[] arrayMethods, uint countMax); - uint GetUserString(uint stk, StringBuilder stringString, uint cchString); - uint GetPinvokeMap(uint tk, out uint pdwMappingFlags, StringBuilder stringImportName, uint cchImportName, out uint pchImportName); - uint EnumSignatures(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] uint[] arraySignatures, uint cmax); - uint EnumTypeSpecs(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] uint[] arrayTypeSpecs, uint cmax); - uint EnumUserStrings(ref uint handlePointerEnum, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] uint[] arrayStrings, uint cmax); - [PreserveSig] - int GetParamForMethodIndex(uint md, uint ulongParamSeq, out uint pointerParam); - uint EnumCustomAttributes(ref uint handlePointerEnum, uint tk, uint tokenType, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] uint[] arrayCustomAttributes, uint countMax); - uint GetCustomAttributeProps(uint cv, out uint ptkObj, out uint ptkType, out void* ppBlob); - uint FindTypeRef(uint tokenResolutionScope, string stringName); - uint GetMemberProps(uint mb, out uint pointerClass, StringBuilder stringMember, uint cchMember, out uint pchMember, out uint pdwAttr, - out byte* ppvSigBlob, out uint pcbSigBlob, out uint pulCodeRVA, out uint pdwImplFlags, out uint pdwCPlusTypeFlag, out void* ppValue); - uint GetFieldProps(uint mb, out uint pointerClass, StringBuilder stringField, uint cchField, out uint pchField, out uint pdwAttr, - out byte* ppvSigBlob, out uint pcbSigBlob, out uint pdwCPlusTypeFlag, out void* ppValue); - uint GetPropertyProps(uint prop, out uint pointerClass, StringBuilder stringProperty, uint cchProperty, out uint pchProperty, out uint pdwPropFlags, - out byte* ppvSig, out uint bytePointerSig, out uint pdwCPlusTypeFlag, out void* ppDefaultValue, out uint pcchDefaultValue, out uint pmdSetter, - out uint pmdGetter, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 14)] uint[] rmdOtherMethod, uint countMax); - uint GetParamProps(uint tk, out uint pmd, out uint pulSequence, StringBuilder stringName, uint cchName, out uint pchName, - out uint pdwAttr, out uint pdwCPlusTypeFlag, out void* ppValue); - uint GetCustomAttributeByName(uint tokenObj, string stringName, out void* ppData); - [PreserveSig] - [return: MarshalAs(UnmanagedType.Bool)] - bool IsValidToken(uint tk); - uint GetNestedClassProps(uint typeDefNestedClass); - uint GetNativeCallConvFromSig(void* voidPointerSig, uint byteCountSig); - int IsGlobal(uint pd); - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/MethodMap.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/MethodMap.cs deleted file mode 100644 index a728a77c64922763db440c7eaa75caeda9d438e3..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/MethodMap.cs +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Diagnostics; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using Roslyn.Utilities; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal sealed class MethodMap - { - [DebuggerDisplay("{GetDebuggerDisplay(),nq}")] - internal struct MethodLineExtent - { - internal sealed class MethodComparer : IComparer - { - public static readonly MethodComparer Instance = new MethodComparer(); - public int Compare(MethodLineExtent x, MethodLineExtent y) => HandleComparer.Default.Compare(x.Method, y.Method); - } - - internal sealed class MinLineComparer : IComparer - { - public static readonly MinLineComparer Instance = new MinLineComparer(); - public int Compare(MethodLineExtent x, MethodLineExtent y) => x.MinLine - y.MinLine; - } - - public readonly MethodDebugInformationHandle Method; - public readonly int MinLine; - public readonly int MaxLine; - - public MethodLineExtent(MethodDebugInformationHandle method, int minLine, int maxLine) - { - Method = method; - MinLine = minLine; - MaxLine = maxLine; - } - - private string GetDebuggerDisplay() => $"{MetadataTokens.GetRowNumber(Method)}: [{MinLine}-{MaxLine}]"; - } - - private struct MethodsInDocument - { - // Consider: we could remove the MaxLine from this list and look it up in ExtensByMinLine - public readonly ImmutableArray ExtentsByMethod; - - // Represents method extents partitioned into non-overlapping subsequences, each sorted by min line. - public readonly ImmutableArray> ExtentsByMinLine; - - public MethodsInDocument(ImmutableArray extentsByMethod, ImmutableArray> extentsByMinLine) - { - ExtentsByMethod = extentsByMethod; - ExtentsByMinLine = extentsByMinLine; - } - } - - private readonly IReadOnlyDictionary _methodsByDocument; - - public MethodMap(MetadataReader reader) - { - _methodsByDocument = GroupMethods(GetMethodExtents(reader)); - } - - private static IReadOnlyDictionary GroupMethods(IEnumerable> methodExtents) - { - var builder = new Dictionary.Builder>(); - - foreach (var entry in methodExtents) - { - ImmutableArray.Builder existing; - if (!builder.TryGetValue(entry.Key, out existing)) - { - builder[entry.Key] = existing = ImmutableArray.CreateBuilder(); - } - - existing.Add(entry.Value); - } - - var result = new Dictionary(builder.Count); - - foreach (var entry in builder) - { - var extents = entry.Value; - Debug.Assert(extents.Count > 0); - - // sort by method handle: - extents.Sort(MethodLineExtent.MethodComparer.Instance); - - // merge spans belonging to a single method: - int j = 0; - for (int i = 1; i < extents.Count; i++) - { - if (extents[i].Method == extents[j].Method) - { - extents[j] = new MethodLineExtent(extents[i].Method, Math.Min(extents[i].MinLine, extents[j].MinLine), Math.Max(extents[i].MaxLine, extents[j].MaxLine)); - } - else - { - j++; - - if (j < i) - { - extents[j] = extents[i]; - } - } - } - - Debug.Assert(j < extents.Count); - extents.Count = j + 1; - - var extentsByMethod = extents.ToImmutable(); - - // sort by start line: - extents.Sort(MethodLineExtent.MinLineComparer.Instance); - - result.Add(entry.Key, new MethodsInDocument(extentsByMethod, PartitionToNonOverlappingSubsequences(extents))); - } - - return result; - } - - private static ImmutableArray> PartitionToNonOverlappingSubsequences(ImmutableArray.Builder extentsOrderedByMinLine) - { - // Most of the time method extents are non-overlapping. Only extents of anonymous methods and queries overlap methods and other lambdas. - // The number of subsequences created below will be the max nesting level of lambdas. - - var subsequences = ImmutableArray.CreateBuilder.Builder>(); - - foreach (var extent in extentsOrderedByMinLine) - { - bool placed = false; - foreach (var subsequence in subsequences) - { - if (subsequence.Count == 0 || extent.MinLine > subsequence[subsequence.Count - 1].MaxLine) - { - subsequence.Add(extent); - placed = true; - break; - } - } - - if (!placed) - { - var newRun = ImmutableArray.CreateBuilder(); - newRun.Add(extent); - subsequences.Add(newRun); - } - } - - // make all subsequences immutable: - - var result = ImmutableArray.CreateBuilder>(); - foreach (var run in subsequences) - { - result.Add(run.ToImmutable()); - } - - return result.ToImmutable(); - } - - private static IEnumerable> GetMethodExtents(MetadataReader reader) - { - // Perf consideration: - // We read and decode all sequence points in the file, which might be megabytes of data that need to be paged in. - // If we stored the primary document of single-document methods in a field of MethodBody table we would only need to decode - // sequence point of methods that span multiple documents to build a map from Document -> Methods. - // We can then defer decoding sequence points of methods contained in a specified document until requested. - - foreach (var methodDebugHandle in reader.MethodDebugInformation) - { - var methodBody = reader.GetMethodDebugInformation(methodDebugHandle); - - // no debug info for the method - if (methodBody.SequencePointsBlob.IsNil) - { - continue; - } - - // sequence points: - DocumentHandle currentDocument = methodBody.Document; - - int minLine = int.MaxValue; - int maxLine = int.MinValue; - foreach (var sequencePoint in methodBody.GetSequencePoints()) - { - if (sequencePoint.IsHidden) - { - continue; - } - - int startLine = sequencePoint.StartLine; - int endLine = sequencePoint.EndLine; - - if (sequencePoint.Document != currentDocument) - { - yield return KeyValuePair.Create(currentDocument, new MethodLineExtent(methodDebugHandle, minLine, maxLine)); - - currentDocument = sequencePoint.Document; - minLine = startLine; - maxLine = endLine; - } - else - { - if (startLine < minLine) - { - minLine = startLine; - } - - if (endLine > maxLine) - { - maxLine = endLine; - } - } - } - - yield return KeyValuePair.Create(currentDocument, new MethodLineExtent(methodDebugHandle, minLine, maxLine)); - } - } - - public IEnumerable GetMethodsContainingLine(DocumentHandle documentHandle, int line) - { - MethodsInDocument methodsInDocument; - if (!_methodsByDocument.TryGetValue(documentHandle, out methodsInDocument)) - { - return null; - } - - return EnumerateMethodsContainingLine(methodsInDocument.ExtentsByMinLine, line); - } - - private static IEnumerable EnumerateMethodsContainingLine(ImmutableArray> extents, int line) - { - foreach (var subsequence in extents) - { - int closestFollowingExtent; - int index = IndexOfContainingExtent(subsequence, line, out closestFollowingExtent); - if (index >= 0) - { - yield return subsequence[index].Method; - } - } - } - - private static int IndexOfContainingExtent(ImmutableArray orderedNonOverlappingExtents, int startLine, out int closestFollowingExtent) - { - closestFollowingExtent = -1; - - int index = orderedNonOverlappingExtents.BinarySearch(startLine, (extent, line) => extent.MinLine - line); - if (index >= 0) - { - return index; - } - - int preceding = ~index - 1; - if (preceding >= 0 && startLine <= orderedNonOverlappingExtents[preceding].MaxLine) - { - return preceding; - } - - closestFollowingExtent = ~index; - return -1; - } - - internal ImmutableArray GetMethodExtents(DocumentHandle documentHandle) - { - MethodsInDocument methodsInDocument; - if (!_methodsByDocument.TryGetValue(documentHandle, out methodsInDocument)) - { - return ImmutableArray.Empty; - } - - return methodsInDocument.ExtentsByMethod; - } - - internal bool TryGetMethodSourceExtent(DocumentHandle documentHandle, MethodDebugInformationHandle methodHandle, out int startLine, out int endLine) - { - MethodsInDocument methodsInDocument; - if (!_methodsByDocument.TryGetValue(documentHandle, out methodsInDocument)) - { - startLine = endLine = 0; - return false; - } - - int index = methodsInDocument.ExtentsByMethod.BinarySearch(methodHandle, (ext, handle) => HandleComparer.Default.Compare(ext.Method, handle)); - if (index < 0) - { - startLine = endLine = 0; - return false; - } - - var extent = methodsInDocument.ExtentsByMethod[index]; - startLine = extent.MinLine; - endLine = extent.MaxLine; - return true; - } - - internal IEnumerable EnumerateContainingOrClosestFollowingMethodExtents(DocumentHandle documentHandle, int line) - { - MethodsInDocument methodsInDocument; - if (!_methodsByDocument.TryGetValue(documentHandle, out methodsInDocument)) - { - yield break; - } - - foreach (var subsequence in methodsInDocument.ExtentsByMinLine) - { - int closestFollowingExtent; - int index = IndexOfContainingExtent(subsequence, line, out closestFollowingExtent); - if (index >= 0) - { - yield return subsequence[index]; - } - else if (closestFollowingExtent < subsequence.Length) - { - yield return subsequence[closestFollowingExtent]; - } - } - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.csproj b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.csproj deleted file mode 100644 index 8353577145ddb0ecbdb50c9e124353a931b545c3..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - Debug - AnyCPU - {F83343BA-B4EA-451C-B6DB-5D645E6171BC} - Library - Microsoft.DiaSymReader.PortablePdb - Microsoft.DiaSymReader.PortablePdb - true - ..\..\..\ - v4.5 - Profile7 - .NETPortable - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - - - - Utilities\ImmutableArrayExtensions.cs - - - Utilities\ReflectionUtilities.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {27b7a354-80cc-4bac-abf5-d4081056cea9} - DiaSymReader - - - {030f8ab1-d06d-4526-adec-8e6010899c71} - Immutable - - - {b36c94c7-f34c-43bc-8834-0b9eea6dd4df} - Metadata - - - - - - \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.nuget.proj b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.nuget.proj deleted file mode 100644 index 4941b41141a33d28d2741b8903e64755e76aef03..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.nuget.proj +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - -prop binaries=$(OutDir) -prop currentVersion="$(NuGetVersion)" - $(OutDir)NuGet\$(NuGetVersionType) - - - - - - - - - - - - diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.nuspec b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.nuspec deleted file mode 100644 index 4d3ff6e0c9b395878814b6879a15db6f61f3c3f4..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Microsoft.DiaSymReader.PortablePdb.nuspec +++ /dev/null @@ -1,51 +0,0 @@ - - - - Microsoft.DiaSymReader.PortablePdb - Implementation of Microsoft DiaSymReader interfaces that reads debug information from Portable PDB format - - Implementation of Microsoft DiaSymReader interfaces that reads debug information from Portable PDB format. - - - - - - - - - - - - - - - - - - - - - - - - - - - en-US - true - $currentVersion$ - Microsoft - http://go.microsoft.com/fwlink/?LinkId=394369 - http://msdn.com/roslyn - Implementation of Microsoft DiaSymReader interfaces that reads debug information from Portable PDB format - DiaSymReader ISymUnmanagedReader Portable PDB COM interop debugging - - - - - - - - - - diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/PortablePdbReader.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/PortablePdbReader.cs deleted file mode 100644 index 49b78821454a3992771f934cb14324dea007bfd9..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/PortablePdbReader.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Immutable; -using System.Diagnostics; -using System.Reflection.Metadata; -using System.Runtime.InteropServices; -using System.Threading; -using Roslyn.Utilities; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal sealed class PortablePdbReader : IDisposable - { - private readonly MetadataReader _metadataReader; - private readonly GCHandle _pinnedImage; - private LazyMetadataImport _lazyMetadataImport; - - internal IntPtr ImagePtr => _pinnedImage.AddrOfPinnedObject(); - internal int ImageSize { get; } - - internal PortablePdbReader(byte[] buffer, int size, LazyMetadataImport metadataImport) - { - Debug.Assert(metadataImport != null); - - _metadataReader = CreateMetadataReader(buffer, size, out _pinnedImage); - _lazyMetadataImport = metadataImport; - ImageSize = size; - } - - internal unsafe static MetadataReader CreateMetadataReader(byte[] buffer, int size, out GCHandle pinnedImage) - { - Debug.Assert(buffer != null); - Debug.Assert(size >= 0 && size <= buffer.Length); - - pinnedImage = GCHandle.Alloc(buffer, GCHandleType.Pinned); - return new MetadataReader((byte*)pinnedImage.AddrOfPinnedObject(), size); - } - - internal bool MatchesModule(Guid guid, uint stamp, int age) - { - return age == 1 && IdEquals(MetadataReader.DebugMetadataHeader.Id, guid, stamp); - } - - internal static bool IdEquals(ImmutableArray left, Guid rightGuid, uint rightStamp) - { - if (left.Length != 20) - { - // invalid id - return false; - } - - byte[] guidBytes = rightGuid.ToByteArray(); - for (int i = 0; i < guidBytes.Length; i++) - { - if (guidBytes[i] != left[i]) - { - return false; - } - } - - byte[] stampBytes = BitConverter.GetBytes(rightStamp); - for (int i = 0; i < stampBytes.Length; i++) - { - if (stampBytes[i] != left[guidBytes.Length + i]) - { - return false; - } - } - - return true; - } - - internal IMetadataImport GetMetadataImport() - { - if (IsDisposed) - { - throw new ObjectDisposedException(nameof(SymReader)); - } - - return _lazyMetadataImport.GetMetadataImport(); - } - - internal MetadataReader MetadataReader - { - get - { - if (IsDisposed) - { - throw new ObjectDisposedException(nameof(SymReader)); - } - - return _metadataReader; - } - } - - internal bool IsDisposed - { - get - { - return _lazyMetadataImport == null; - } - } - - public void Dispose() - { - if (!IsDisposed) - { - _pinnedImage.Free(); - _lazyMetadataImport.Dispose(); - _lazyMetadataImport = null; - } - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/RootScopeData.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/RootScopeData.cs deleted file mode 100644 index 62481cf97c838cbc78d1208bf9f50f532ab48f8e..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/RootScopeData.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Immutable; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal sealed class RootScopeData : ScopeData - { - internal RootScopeData(SymMethod symMethod) - : base(symMethod) - { - } - - internal override ScopeData Parent => null; - internal override int StartOffset => 0; - - internal override int EndOffset - { - get - { - var mdReader = SymMethod.MetadataReader; - var allScopes = mdReader.GetLocalScopes(SymMethod.DebugHandle); - - foreach (var handle in allScopes) - { - // the first scope spans the entire body - return AdjustEndOffset(mdReader.GetLocalScope(handle).EndOffset); - } - - // method has no body - return 0; - } - } - - protected override ImmutableArray CreateChildren() - { - foreach (var handle in SymMethod.MetadataReader.GetLocalScopes(SymMethod.DebugHandle)) - { - // The root scope has only a single child scope, - // which is the first scope in the scopes belonging to the method: - return ImmutableArray.Create(new ChildScopeData(SymMethod, this, handle)); - } - - // method has no body - return ImmutableArray.Empty; - } - - internal override int GetConstants(int bufferLength, out int count, ISymUnmanagedConstant[] constants) - { - // C# and VB never define any constants in the root scope - count = 0; - return HResult.S_OK; - } - - internal override int GetLocals(int bufferLength, out int count, ISymUnmanagedVariable[] locals) - { - // C# and VB never define any locals in the root scope - count = 0; - return HResult.S_OK; - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/ScopeData.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/ScopeData.cs deleted file mode 100644 index 3f4c33aa884343f08a4301834334a3c4cc774138..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/ScopeData.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Immutable; -using System.Diagnostics; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal abstract class ScopeData - { - internal readonly SymMethod SymMethod; - - private ImmutableArray _lazyChildren; - - internal ScopeData(SymMethod symMethod) - { - Debug.Assert(symMethod != null); - SymMethod = symMethod; - } - - internal ImmutableArray GetChildren() - { - if (_lazyChildren.IsDefault) - { - _lazyChildren = CreateChildren(); - } - - return _lazyChildren; - } - - public int AdjustEndOffset(int value) - { - // Portable PDB uses edge-exclusive semantics like C#. - // VB end offset is inclusive. - return SymMethod.SymReader.VbSemantics.Value && !(Parent is RootScopeData) ? value - 1 : value; - } - - protected abstract ImmutableArray CreateChildren(); - - internal abstract int StartOffset { get; } - internal abstract int EndOffset { get; } - internal abstract ScopeData Parent { get; } - internal abstract int GetConstants(int bufferLength, out int count, ISymUnmanagedConstant[] constants); - internal abstract int GetLocals(int bufferLength, out int count, ISymUnmanagedVariable[] locals); - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymBinder.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymBinder.cs deleted file mode 100644 index 0b4048fccd99e36a3fa1a75bbf475cab1b56a242..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymBinder.cs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Roslyn.Utilities; -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.ComTypes; -using System.Reflection.Metadata; -using System.Collections.Immutable; -using System.Reflection.PortableExecutable; -using System.Linq; -using System.Collections; -using System.Collections.Generic; - -[assembly: Guid("CA89ACD1-A1D5-43DE-890A-5FDF50BC1F93")] - -namespace Microsoft.DiaSymReader.PortablePdb -{ - [Guid("E4B18DEF-3B78-46AE-8F50-E67E421BDF70")] - [ComVisible(true)] - public sealed class SymBinder : ISymUnmanagedBinder4 - { - [PreserveSig] - public unsafe int GetReaderForFile( - [MarshalAs(UnmanagedType.Interface)]object metadataImport, - [MarshalAs(UnmanagedType.LPWStr)]string fileName, - [MarshalAs(UnmanagedType.LPWStr)]string searchPath, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader) - { - return GetReaderForFile2( - metadataImport, - fileName, - searchPath, - SymUnmanagedSearchPolicy.AllowReferencePathAccess, - out reader); - } - - /// - /// Given a metadata interface and a file name, returns the - /// interface that will read the debugging symbols associated - /// with the module. - /// - /// - /// This version of the function can search for the PDB in areas other than - /// right next to the module. - /// The search policy can be controlled by combining CorSymSearchPolicyAttributes - /// e.g AllowReferencePathAccess|AllowSymbolServerAccess will look for the pdb next - /// to the PE file and on a symbol server, but won't query the registry or use the path - /// in the PE file. - /// If a searchPath is provided, those directories will always be searched. - /// - [PreserveSig] - public int GetReaderForFile2( - [MarshalAs(UnmanagedType.Interface)]object metadataImport, - [MarshalAs(UnmanagedType.LPWStr)]string fileName, - [MarshalAs(UnmanagedType.LPWStr)]string searchPath, - SymUnmanagedSearchPolicy searchPolicy, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader) - { - reader = null; - try - { - var mdImport = metadataImport as IMetadataImport; - if (mdImport == null || string.IsNullOrEmpty(fileName)) - { - return HResult.E_INVALIDARG; - } - - // See DIA: FLocatePdbDefault, FLocateCvFilePathHelper, FLocatePdbSymsrv, FLocateCvFilePathHelper - // - // 1) Try open Combine(, ) (unless RestrictReferencePath) - // 2) Try open PDB path (unless RestrictOriginalPath) - // 3) Search Paths - semicolon separated paths - // a) searchPath parameter - // b) registry (unless RestrictRegistry) - // Use search paths from registry Software\Microsoft\VisualStudio\MSPDB, value SymbolSearchPath - // with environment variables expanded (ExpandEnvironmentStrings) - // i) try USER - // ii) try MACHINE - // c) environment vars - // i) _NT_ALT_SYMBOL_PATH - // ii) _NT_SYMBOL_PATH - // ii) SystemRoot (unless RestrictSystemRoot) - // - // for each search path: - // special paths: SRV*, SYMSRV*SYMSRV.DLL* => symbol server (unless RestrictSymsrv) - // CACHE* => sym cache (unless RestrictSymsrv) - // - // A) try open \symbols\\ - // B) try open \\ - // C) try open \ - // - // Each attempt checks if PDB ID matches. - // - // Search policy: all is restricted unless explicitly allowed. - // After opened store to cache if CACHE* given (only the first cache?) - - CodeViewDebugDirectoryData codeViewData; - uint stamp; - if (!TryReadCodeViewData(fileName, out codeViewData, out stamp)) - { - return HResult.E_FAIL; // TODO: specific error code (ecToHresult)? - } - - Guid guid = codeViewData.Guid; - int age = codeViewData.Age; - string pdbFileName = Path.GetFileName(codeViewData.Path); - var lazyImport = new LazyMetadataImport(mdImport); - - // 1) next to the PE file - if ((searchPolicy & SymUnmanagedSearchPolicy.AllowReferencePathAccess) != 0) - { - string peDirectory = Path.GetDirectoryName(fileName); - string pdbFilePath = Path.Combine(peDirectory, pdbFileName); - - if (TryCreateReaderForMatchingPdb(pdbFilePath, guid, stamp, age, lazyImport, out reader)) - { - return HResult.S_OK; - } - } - - // 2) PDB path as specified in Debug Directory - if ((searchPolicy & SymUnmanagedSearchPolicy.AllowOriginalPathAccess) != 0) - { - if (TryCreateReaderForMatchingPdb(codeViewData.Path, guid, stamp, age, lazyImport, out reader)) - { - return HResult.S_OK; - } - } - - // 3) Search Paths - string peFileExtension = Path.GetExtension(fileName).TrimStart('.'); - - foreach (var searchPaths in GetSearchPathsSequence(searchPath, searchPolicy)) - { - if (TryFindMatchingPdb(searchPaths, peFileExtension, pdbFileName, guid, stamp, age, lazyImport, searchPolicy, out reader)) - { - return HResult.S_OK; - } - } - - return HResult.E_PDB_NOT_FOUND; - } - finally - { - InteropUtilities.TransferOwnershipOrRelease(ref metadataImport, reader); - } - } - - private static IEnumerable GetSearchPathsSequence(string searchPath, SymUnmanagedSearchPolicy searchPolicy) - { - // 3a) parameter - yield return searchPath; - - // 4b) registry - if ((searchPolicy & SymUnmanagedSearchPolicy.AllowRegistryAccess) != 0) - { - // TODO - } - - // 5c) environment variables: - yield return PortableShim.Environment.GetEnvironmentVariable("_NT_ALT_SYMBOL_PATH"); - yield return PortableShim.Environment.GetEnvironmentVariable("_NT_SYMBOL_PATH"); - yield return PortableShim.Environment.GetEnvironmentVariable("SystemRoot"); - } - - private static IEnumerable GetSearchPathSubdirectories(string searchPath, string peFileExtension) - { - yield return Path.Combine(searchPath, "symbols", peFileExtension); - yield return Path.Combine(searchPath, peFileExtension); - - if (peFileExtension.Length > 0) - { - yield return Path.Combine(searchPath); - } - } - - private static readonly char[] s_searchPathSeparators = { ';' }; - - private bool TryFindMatchingPdb( - string searchPaths, - string peFileExtension, // with no leading . - string pdbFileName, - Guid guid, - uint stamp, - int age, - LazyMetadataImport metadataImport, - SymUnmanagedSearchPolicy searchPolicy, - out ISymUnmanagedReader reader) - { - if (searchPaths == null) - { - reader = null; - return false; - } - - foreach (var searchPath in searchPaths.Split(s_searchPathSeparators, StringSplitOptions.RemoveEmptyEntries)) - { - // TODO: check symsrv policy - if (searchPath.StartsWith("SRV*", StringComparison.OrdinalIgnoreCase)) - { - // TODO: - continue; - } - - if (searchPath.StartsWith("SYMSRV*", StringComparison.OrdinalIgnoreCase)) - { - // TODO: - continue; - } - - if (searchPath.StartsWith("CACHE*", StringComparison.OrdinalIgnoreCase)) - { - // TODO: - continue; - } - - foreach (var subdir in GetSearchPathSubdirectories(searchPath, peFileExtension)) - { - if (TryCreateReaderForMatchingPdb(Path.Combine(subdir, pdbFileName), guid, stamp, age, metadataImport, out reader)) - { - return true; - } - } - } - - reader = null; - return false; - } - - private bool TryCreateReaderForMatchingPdb( - string pdbFilePath, - Guid guid, - uint stamp, - int age, - LazyMetadataImport metadataImport, - out ISymUnmanagedReader reader) - { - try - { - if (PortableShim.File.Exists(pdbFilePath)) - { - var symReader = SymReader.CreateFromFile(pdbFilePath, metadataImport); - reader = symReader; - return symReader.PdbReader.MatchesModule(guid, stamp, age); - } - } - catch - { - // nop - } - - reader = null; - return false; - } - - private bool TryReadCodeViewData(string peFilePath, out CodeViewDebugDirectoryData codeViewData, out uint stamp) - { - try - { - var peStream = PortableShim.File.OpenRead(peFilePath); - using (var peReader = new PEReader(peStream)) - { - foreach (var entry in peReader.ReadDebugDirectory()) - { - if (entry.Type == DebugDirectoryEntryType.CodeView) - { - codeViewData = peReader.ReadCodeViewDebugDirectoryData(entry); - stamp = entry.Stamp; - return true; - } - } - } - } - catch - { - } - - codeViewData = default(CodeViewDebugDirectoryData); - stamp = 0; - return false; - } - - [PreserveSig] - public int GetReaderFromStream( - [MarshalAs(UnmanagedType.Interface)]object metadataImport, - [MarshalAs(UnmanagedType.Interface)]object stream, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader) - { - reader = null; - - try - { - IStream comStream = stream as IStream; - var mdImport = metadataImport as IMetadataImport; - if (mdImport == null || comStream == null) - { - return HResult.E_INVALIDARG; - } - - reader = SymReader.CreateFromStream(comStream, new LazyMetadataImport(mdImport)); - return (reader != null) ? HResult.S_OK : HResult.E_FAIL; - } - finally - { - InteropUtilities.TransferOwnershipOrRelease(ref metadataImport, reader); - } - } - - [PreserveSig] - public int GetReaderFromCallback( - [In, MarshalAs(UnmanagedType.Interface)] object metadataImport, - [MarshalAs(UnmanagedType.LPWStr)]string fileName, - [MarshalAs(UnmanagedType.LPWStr)]string searchPath, - SymUnmanagedSearchPolicy searchPolicy, - [In, MarshalAs(UnmanagedType.Interface)] object callback, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader) - { - reader = null; - return HResult.E_NOTIMPL; - } - - /// - /// Creates a new for the specified PDB file. - /// - /// - /// Provider of a metadata importer for the corresponding PE file. - /// The importer is only constructed if the operation performed on the SymReader requires access - /// to the metadata. - /// - /// PDB file path. - /// The new reader instance. - /// - /// E_INVALIDARG - /// is null, or - /// is null or empty. - /// Another error code describing failure to open the file. - /// - [PreserveSig] - public int GetReaderFromPdbFile( - [MarshalAs(UnmanagedType.Interface)]IMetadataImportProvider metadataImportProvider, - [MarshalAs(UnmanagedType.LPWStr)]string pdbFilePath, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader) - { - if (metadataImportProvider == null || string.IsNullOrEmpty(pdbFilePath)) - { - reader = null; - return HResult.E_INVALIDARG; - } - - reader = SymReader.CreateFromFile(pdbFilePath, new LazyMetadataImport(metadataImportProvider)); - return (reader != null) ? HResult.S_OK : HResult.E_FAIL; - } - - /// - /// Creates a new for the specified PDB file. - /// - /// - /// Provider of a metadata importer for the corresponding PE file. - /// The importer is only constructed if the operation performed on the SymReader requires access - /// to the metadata. - /// - /// PDB stream. - /// The new reader instance. - /// - /// E_INVALIDARG - /// is null, or - /// is null. - /// Another error code describing failure to open the file. - /// - [PreserveSig] - public int GetReaderFromPdbStream( - [MarshalAs(UnmanagedType.Interface)]IMetadataImportProvider metadataImportProvider, - [MarshalAs(UnmanagedType.Interface)]object stream, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedReader reader) - { - IStream comStream = stream as IStream; - if (metadataImportProvider == null || comStream == null) - { - reader = null; - return HResult.E_INVALIDARG; - } - - reader = SymReader.CreateFromStream(comStream, new LazyMetadataImport(metadataImportProvider)); - return (reader != null) ? HResult.S_OK : HResult.E_FAIL; - } - } -} - -// regasm /codebase C:\R0\Binaries\Debug\Microsoft.DiaSymReader.PortablePdb.dll -// tlbexp C:\R0\Binaries\Debug\Microsoft.DiaSymReader.PortablePdb.dll diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymConstant.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymConstant.cs deleted file mode 100644 index 297f37007310bb4202b91358cbe8c53087b6eaa4..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymConstant.cs +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Diagnostics; -using System.Reflection.Metadata; -using System.Runtime.InteropServices; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - [ComVisible(false)] - public sealed class SymConstant : ISymUnmanagedConstant - { - private readonly SymReader _symReader; - private readonly LocalConstantHandle _handle; - - private object _lazyValue = s_uninitialized; - private byte[] _lazySignature; - - private static readonly object s_nullReferenceValue = 0; - private static readonly object s_uninitialized = new object(); - - internal SymConstant(SymReader symReader, LocalConstantHandle handle) - { - Debug.Assert(symReader != null); - _symReader = symReader; - _handle = handle; - } - - public int GetName( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]char[] name) - { - var mdReader = _symReader.MetadataReader; - var constant = mdReader.GetLocalConstant(_handle); - - var str = mdReader.GetString(constant.Name); - return InteropUtilities.StringToBuffer(str, bufferLength, out count, name); - } - - public int GetSignature( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]byte[] signature) - { - if (_lazySignature == null) - { - InitializeValueAndSignature(); - } - - return InteropUtilities.BytesToBuffer(_lazySignature, bufferLength, out count, signature); - } - - public int GetValue(out object value) - { - if (_lazyValue == s_uninitialized) - { - InitializeValueAndSignature(); - } - - value = _lazyValue; - return HResult.S_OK; - } - - private void InitializeValueAndSignature() - { - var mdReader = _symReader.MetadataReader; - var constant = mdReader.GetLocalConstant(_handle); - - var sigReader = mdReader.GetBlobReader(constant.Signature); - var sigWriter = new BlobWriter(sigReader.Length); - - // custom modifiers: - int rawTypeCode; - while (true) - { - rawTypeCode = sigReader.ReadCompressedInteger(); - if (rawTypeCode == (int)SignatureTypeCode.OptionalModifier || rawTypeCode == (int)SignatureTypeCode.RequiredModifier) - { - sigReader.ReadCompressedInteger(); - } - else - { - break; - } - } - - int customModifiersLength = sigReader.Offset - 1; - if (customModifiersLength > 0) - { - sigWriter.Write(mdReader.GetBlobBytes(constant.Signature), 0, customModifiersLength); - } - - object translatedValue; - if (rawTypeCode == (int)MetadataUtilities.SignatureTypeCode_ValueType || - rawTypeCode == (int)MetadataUtilities.SignatureTypeCode_Class) - { - var typeHandle = sigReader.ReadTypeHandle(); - - string qualifiedName = _symReader.PdbReader.GetMetadataImport().GetQualifiedTypeName(typeHandle); - if (qualifiedName == "System.Decimal") - { - translatedValue = sigReader.ReadDecimal(); - } - else if (qualifiedName == "System.DateTime") - { - translatedValue = BitConverter.Int64BitsToDouble(sigReader.ReadDateTime().Ticks); - } - else if (sigReader.RemainingBytes == 0) - { - // null reference is returned as a boxed integer 0: - translatedValue = s_nullReferenceValue; - } - else - { - // unknown (not produced by C# or VB) - translatedValue = null; - } - - sigWriter.Write((byte)rawTypeCode); - sigWriter.WriteCompressedInteger(MetadataUtilities.GetTypeDefOrRefOrSpecCodedIndex(typeHandle)); - } - else - { - bool isEnumTypeCode; - translatedValue = ReadAndTranslateValue(ref sigReader, (SignatureTypeCode)rawTypeCode, out isEnumTypeCode); - - if (sigReader.RemainingBytes == 0) - { - // primitive type code: - sigWriter.Write((byte)rawTypeCode); - } - else if (isEnumTypeCode) - { - var enumTypeHandle = sigReader.ReadTypeHandle(); - - // enum type signature: - sigWriter.Write((byte)MetadataUtilities.SignatureTypeCode_ValueType); - sigWriter.WriteCompressedInteger(MetadataUtilities.GetTypeDefOrRefOrSpecCodedIndex(enumTypeHandle)); - } - - if (sigReader.RemainingBytes > 0) - { - throw new BadImageFormatException(); - } - } - - _lazyValue = translatedValue; - _lazySignature = sigWriter.ToArray(); - } - - private object ReadAndTranslateValue(ref BlobReader sigReader, SignatureTypeCode typeCode, out bool isEnumTypeCode) - { - switch (typeCode) - { - case SignatureTypeCode.Boolean: - isEnumTypeCode = true; - return (short)(sigReader.ReadBoolean() ? 1 : 0); - - case SignatureTypeCode.Char: - isEnumTypeCode = true; - return (ushort)sigReader.ReadChar(); - - case SignatureTypeCode.SByte: - isEnumTypeCode = true; - return (short)sigReader.ReadSByte(); - - case SignatureTypeCode.Byte: - isEnumTypeCode = true; - return (short)sigReader.ReadByte(); - - case SignatureTypeCode.Int16: - isEnumTypeCode = true; - return sigReader.ReadInt16(); - - case SignatureTypeCode.UInt16: - isEnumTypeCode = true; - return sigReader.ReadUInt16(); - - case SignatureTypeCode.Int32: - isEnumTypeCode = true; - return sigReader.ReadInt32(); - - case SignatureTypeCode.UInt32: - isEnumTypeCode = true; - return sigReader.ReadUInt32(); - - case SignatureTypeCode.Int64: - isEnumTypeCode = true; - return sigReader.ReadInt64(); - - case SignatureTypeCode.UInt64: - isEnumTypeCode = true; - return sigReader.ReadUInt64(); - - case SignatureTypeCode.Single: - isEnumTypeCode = false; - return sigReader.ReadSingle(); - - case SignatureTypeCode.Double: - isEnumTypeCode = false; - return sigReader.ReadDouble(); - - case SignatureTypeCode.String: - isEnumTypeCode = false; - - if (sigReader.RemainingBytes == 1) - { - if (sigReader.ReadByte() != 0xff) - { - throw new BadImageFormatException(); - } - - return s_nullReferenceValue; - } - - if (sigReader.RemainingBytes % 2 != 0) - { - throw new BadImageFormatException(); - } - - return sigReader.ReadUTF16(sigReader.RemainingBytes); - - case SignatureTypeCode.Object: - // null reference - isEnumTypeCode = false; - return s_nullReferenceValue; - - default: - throw new BadImageFormatException(); - } - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymDocument.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymDocument.cs deleted file mode 100644 index 3a3275627acbcda261863290d2cac67292f7141b..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymDocument.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Diagnostics; -using System.Reflection.Metadata; -using System.Runtime.InteropServices; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - [ComVisible(false)] - public sealed class SymDocument : ISymUnmanagedDocument - { - private static Guid s_CSharpGuid = new Guid("3f5162f8-07c6-11d3-9053-00c04fa302a1"); - private static Guid s_visualBasicGuid = new Guid("3a12d0b8-c26c-11d0-b442-00a0244a1dd2"); - private static Guid s_FSharpGuid = new Guid("ab4f38c9-b6e6-43ba-be3b-58080b2ccce3"); - private static Guid s_sha1Guid = new Guid("ff1816ec-aa5e-4d10-87f7-6f4963833460"); - private static Guid s_sha256Guid = new Guid("8829d00f-11b8-4213-878b-770e8597ac16"); - - private static Guid s_vendorMicrosoftGuid = new Guid("994b45c4-e6e9-11d2-903f-00c04fa302a1"); - private static Guid s_documentTypeGuid = new Guid("5a869d0b-6611-11d3-bd2a-0000f80849bd"); - - internal DocumentHandle Handle { get; } - internal SymReader SymReader { get; } - - internal SymDocument(SymReader symReader, DocumentHandle documentHandle) - { - Debug.Assert(symReader != null); - SymReader = symReader; - Handle = documentHandle; - } - - public int FindClosestLine(int line, out int closestLine) - { - // Find a minimal sequence point start line in this document - // that is greater than or equal to the given line. - - int result = int.MaxValue; - var map = SymReader.GetMethodMap(); - var mdReader = SymReader.MetadataReader; - - // Note DiaSymReader searches across all documents with the same file name in CDiaWrapper::FindClosestLineAcrossFileIDs. We don't. - foreach (var extent in map.EnumerateContainingOrClosestFollowingMethodExtents(Handle, line)) - { - Debug.Assert(extent.MaxLine >= line); - - // extent is further than a sequence point we already found: - if (extent.MinLine >= result) - { - continue; - } - - // enumerate method sequence points: - var body = mdReader.GetMethodDebugInformation(extent.Method); - foreach (var sequencePoint in body.GetSequencePoints()) - { - if (sequencePoint.IsHidden || sequencePoint.Document != Handle) - { - continue; - } - - int startLine = sequencePoint.StartLine; - if (startLine >= line && startLine < result) - { - result = startLine; - } - } - } - - if (result < int.MaxValue) - { - closestLine = result; - return HResult.S_OK; - } - - closestLine = 0; - return HResult.E_FAIL; - } - - public int GetChecksum( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]byte[] checksum) - { - var document = SymReader.MetadataReader.GetDocument(Handle); - if (document.Hash.IsNil) - { - count = 0; - return HResult.S_FALSE; - } - - var hash = SymReader.MetadataReader.GetBlobBytes(document.Hash); - return InteropUtilities.BytesToBuffer(hash, bufferLength, out count, checksum); - } - - public int GetChecksumAlgorithmId(ref Guid algorithm) - { - var document = SymReader.MetadataReader.GetDocument(Handle); - algorithm = SymReader.MetadataReader.GetGuid(document.HashAlgorithm); - return HResult.S_OK; - } - - public int GetDocumentType(ref Guid documentType) - { - documentType = s_documentTypeGuid; - return HResult.S_OK; - } - - public int GetLanguage(ref Guid language) - { - var document = SymReader.MetadataReader.GetDocument(Handle); - language = SymReader.MetadataReader.GetGuid(document.Language); - return HResult.S_OK; - } - - public int GetLanguageVendor(ref Guid vendor) - { - var document = SymReader.MetadataReader.GetDocument(Handle); - Guid languageId = SymReader.MetadataReader.GetGuid(document.Language); - vendor = s_vendorMicrosoftGuid; - return HResult.S_OK; - } - - public int GetSourceLength(out int length) - { - // SymReader doesn't support embedded source. - length = 0; - return HResult.E_NOTIMPL; - } - - public int GetSourceRange( - int startLine, - int startColumn, - int endLine, - int endColumn, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4), Out]byte[] source) - { - // SymReader doesn't support embedded source. - count = 0; - return HResult.E_NOTIMPL; - } - - public int GetUrl( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]char[] url) - { - string name = SymReader.MetadataReader.GetString(SymReader.MetadataReader.GetDocument(Handle).Name); - return InteropUtilities.StringToBuffer(name, bufferLength, out count, url); - } - - public int HasEmbeddedSource(out bool value) - { - // SymReader doesn't support embedded source. - value = false; - return HResult.E_NOTIMPL; - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymMethod.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymMethod.cs deleted file mode 100644 index c823dc5b0bbf29a3d8f298b2230c527639a9c57a..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymMethod.cs +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Diagnostics; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Runtime.InteropServices; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - [ComVisible(false)] - public sealed class SymMethod : ISymUnmanagedMethod, ISymUnmanagedAsyncMethod, ISymEncUnmanagedMethod - { - internal sealed class ByHandleComparer : IComparer - { - public static readonly ByHandleComparer Default = new ByHandleComparer(); - public int Compare(ISymUnmanagedMethod x, ISymUnmanagedMethod y) => HandleComparer.Default.Compare(((SymMethod)x).DebugHandle, ((SymMethod)y).DebugHandle); - } - - internal MethodDebugInformationHandle DebugHandle { get; } - internal MethodDefinitionHandle DefinitionHandle => DebugHandle.ToDefinitionHandle(); - internal SymReader SymReader { get; } - private RootScopeData _lazyRootScopeData; - private AsyncMethodData _lazyAsyncMethodData; - - internal MetadataReader MetadataReader => SymReader.MetadataReader; - - internal SymMethod(SymReader symReader, MethodDebugInformationHandle handle) - { - Debug.Assert(symReader != null); - SymReader = symReader; - DebugHandle = handle; - } - - private SequencePointCollection.Enumerator GetSequencePointEnumerator() - { - return SymReader.MetadataReader.GetMethodDebugInformation(DebugHandle).GetSequencePoints().GetEnumerator(); - } - - private RootScopeData GetRootScopeData() - { - if (_lazyRootScopeData == null) - { - _lazyRootScopeData = new RootScopeData(this); - } - - return _lazyRootScopeData; - } - - private int GetILSize() - { - // SymWriter sets the size of the method to the end offset of the root scope in CloseMethod: - return GetRootScopeData().EndOffset; - } - - #region ISymUnmanagedMethod - - public int GetNamespace([MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedNamespace @namespace) - { - // SymReader doesn't support namespaces - @namespace = null; - return HResult.E_NOTIMPL; - } - - public int GetOffset(ISymUnmanagedDocument document, int line, int column, out int offset) - { - if (line <= 0) - { - offset = 0; - return HResult.E_INVALIDARG; - } - - // Note that DiaSymReader completely ignores column parameter. - - var symDocument = SymReader.AsSymDocument(document); - if (symDocument == null) - { - offset = 0; - return HResult.E_INVALIDARG; - } - - // DiaSymReader uses DiaSession::findLinesByLinenum, which results in bad results for lines shared across multiple methods - // and for lines outside of the current method. - - var spReader = GetSequencePointEnumerator(); - var documentHandle = symDocument.Handle; - - while (spReader.MoveNext()) - { - if (!spReader.Current.IsHidden && - spReader.Current.Document == documentHandle && - line >= spReader.Current.StartLine && - line <= spReader.Current.EndLine) - { - // Return the first matching IL offset. In common cases there will be a single one - // since sequence points of a single method don't overlap unless forced by #line. - offset = spReader.Current.Offset; - return HResult.S_OK; - } - } - - offset = 0; - return HResult.E_FAIL; - } - - public int GetParameters( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedVariable[] parameters) - { - // SymReader doesn't support parameter access. - count = 0; - return HResult.E_NOTIMPL; - } - - public int GetRanges( - ISymUnmanagedDocument document, - int line, - int column, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3), Out]int[] ranges) - { - if (line <= 0) - { - count = 0; - return HResult.E_INVALIDARG; - } - - // Note that DiaSymReader completely ignores column parameter. - - var symDocument = SymReader.AsSymDocument(document); - if (symDocument == null) - { - count = 0; - return HResult.E_INVALIDARG; - } - - // DiaSymReader uses DiaSession::findLinesByLinenum, which results in bad results for lines shared across multiple methods. - - var spReader = GetSequencePointEnumerator(); - var documentHandle = symDocument.Handle; - - bool setEndOffset = false; - int i = 0; - while (spReader.MoveNext()) - { - if (setEndOffset) - { - ranges[i - 1] = spReader.Current.Offset; - setEndOffset = false; - } - - if (!spReader.Current.IsHidden && - spReader.Current.Document == documentHandle && - line >= spReader.Current.StartLine && - line <= spReader.Current.EndLine) - { - if (i + 1 < bufferLength) - { - ranges[i] = spReader.Current.Offset; - setEndOffset = true; - } - - // pair of offsets for each sequence point - i += 2; - } - } - - if (setEndOffset) - { - ranges[i - 1] = GetILSize(); - } - - count = i; - return HResult.S_OK; - } - - public int GetRootScope([MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedScope scope) - { - // SymReader always creates a new scope instance - scope = new SymScope(GetRootScopeData()); - return HResult.S_OK; - } - - public int GetScopeFromOffset(int offset, [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedScope scope) - { - // SymReader doesn't support. - scope = null; - return HResult.S_OK; - } - - public int GetSequencePointCount(out int count) - { - var spReader = GetSequencePointEnumerator(); - - int i = 0; - while (spReader.MoveNext()) - { - i++; - } - - count = i; - return HResult.S_OK; - } - - public int GetSequencePoints( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]int[] offsets, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedDocument[] documents, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]int[] startLines, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]int[] startColumns, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]int[] endLines, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]int[] endColumns) - { - SymDocument currentDocument = null; - var spReader = GetSequencePointEnumerator(); - - int i = 0; - while (spReader.MoveNext()) - { - if (bufferLength != 0 && i >= bufferLength) - { - break; - } - - var sp = spReader.Current; - - if (offsets != null) - { - offsets[i] = sp.Offset; - } - - if (startLines != null) - { - startLines[i] = sp.StartLine; - } - - if (startColumns != null) - { - startColumns[i] = sp.StartColumn; - } - - if (endLines != null) - { - endLines[i] = sp.EndLine; - } - - if (endColumns != null) - { - endColumns[i] = sp.EndColumn; - } - - if (documents != null) - { - if (currentDocument == null || currentDocument.Handle != sp.Document) - { - currentDocument = new SymDocument(SymReader, sp.Document); - } - - documents[i] = currentDocument; - } - - i++; - } - - count = i; - return HResult.S_OK; - } - - public int GetSourceStartEnd( - ISymUnmanagedDocument[] documents, - [In, MarshalAs(UnmanagedType.LPArray), Out]int[] lines, - [In, MarshalAs(UnmanagedType.LPArray), Out]int[] columns, - out bool defined) - { - // This symbol reader doesn't support source start/end for methods. - defined = false; - return HResult.E_NOTIMPL; - } - - public int GetToken(out int methodToken) - { - methodToken = MetadataTokens.GetToken(DefinitionHandle); - return HResult.S_OK; - } - - #endregion - - #region ISymUnmanagedAsyncMethod - - private AsyncMethodData AsyncMethodData - { - get - { - if (_lazyAsyncMethodData == null) - { - _lazyAsyncMethodData = ReadAsyncMethodData(); - } - - return _lazyAsyncMethodData; - } - } - - private AsyncMethodData ReadAsyncMethodData() - { - var reader = MetadataReader; - var body = reader.GetMethodDebugInformation(DebugHandle); - var kickoffMethod = body.GetStateMachineKickoffMethod(); - - if (kickoffMethod.IsNil) - { - return AsyncMethodData.None; - } - - var value = reader.GetCustomDebugInformation(DefinitionHandle, MetadataUtilities.MethodSteppingInformationBlobId); - if (value.IsNil) - { - return AsyncMethodData.None; - } - - var blobReader = reader.GetBlobReader(value); - - long catchHandlerOffset = blobReader.ReadUInt32(); - if (catchHandlerOffset > (uint)int.MaxValue + 1) - { - throw new BadImageFormatException(); - } - - var yieldOffsets = ImmutableArray.CreateBuilder(); - var resultOffsets = ImmutableArray.CreateBuilder(); - var resumeMethods = ImmutableArray.CreateBuilder(); - - while (blobReader.RemainingBytes > 0) - { - uint yieldOffset = blobReader.ReadUInt32(); - if (yieldOffset > int.MaxValue) - { - throw new BadImageFormatException(); - } - - uint resultOffset = blobReader.ReadUInt32(); - if (resultOffset > int.MaxValue) - { - throw new BadImageFormatException(); - } - - yieldOffsets.Add((int)yieldOffset); - resultOffsets.Add((int)resultOffset); - resumeMethods.Add(MetadataUtilities.MethodDefToken(blobReader.ReadCompressedInteger())); - } - - return new AsyncMethodData( - kickoffMethod, - (int)(catchHandlerOffset - 1), - yieldOffsets.ToImmutable(), - resultOffsets.ToImmutable(), - resumeMethods.ToImmutable()); - } - - public int IsAsyncMethod(out bool value) - { - value = !AsyncMethodData.IsNone; - return HResult.S_OK; - } - - public int GetKickoffMethod(out int kickoffMethodToken) - { - if (AsyncMethodData.IsNone) - { - kickoffMethodToken = 0; - return HResult.E_UNEXPECTED; - } - - kickoffMethodToken = MetadataTokens.GetToken(AsyncMethodData.KickoffMethod); - return HResult.S_OK; - } - - public int HasCatchHandlerILOffset(out bool value) - { - if (AsyncMethodData.IsNone) - { - value = false; - return HResult.E_UNEXPECTED; - } - - value = AsyncMethodData.CatchHandlerOffset >= 0; - return HResult.S_OK; - } - - public int GetCatchHandlerILOffset(out int offset) - { - if (AsyncMethodData.IsNone || AsyncMethodData.CatchHandlerOffset < 0) - { - offset = 0; - return HResult.E_UNEXPECTED; - } - - offset = AsyncMethodData.CatchHandlerOffset; - return HResult.S_OK; - } - - public int GetAsyncStepInfoCount(out int count) - { - if (AsyncMethodData.IsNone) - { - count = 0; - return HResult.E_UNEXPECTED; - } - - count = AsyncMethodData.YieldOffsets.Length; - return HResult.S_OK; - } - - public int GetAsyncStepInfo( - int bufferLength, - out int count, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]int[] yieldOffsets, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]int[] breakpointOffsets, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]int[] breakpointMethods) - { - if (AsyncMethodData.IsNone) - { - count = 0; - return HResult.E_UNEXPECTED; - } - - int length = Math.Min(bufferLength, AsyncMethodData.YieldOffsets.Length); - - if (yieldOffsets != null) - { - AsyncMethodData.YieldOffsets.CopyTo(0, yieldOffsets, 0, length); - } - - if (breakpointOffsets != null) - { - AsyncMethodData.ResumeOffsets.CopyTo(0, breakpointOffsets, 0, length); - } - - if (breakpointMethods != null) - { - AsyncMethodData.ResumeMethods.CopyTo(0, breakpointMethods, 0, length); - } - - count = length; - return HResult.S_OK; - } - - #endregion - - #region ISymEncUnmanagedMethod - - /// - /// Get the file name for the line associated with specified offset. - /// - public int GetFileNameFromOffset( - int offset, - int bufferLength, - out int count, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] char[] name) - { - // TODO: parse sequence points -> document - throw new NotImplementedException(); - } - - /// - /// Get the Line information associated with . - /// - /// - /// If is not a sequence point it is associated with the previous one. - /// provides the associated sequence point. - /// - public int GetLineFromOffset( - int offset, - out int startLine, - out int startColumn, - out int endLine, - out int endColumn, - out int sequencePointOffset) - { - // TODO: parse sequence points - throw new NotImplementedException(); - } - - /// - /// Get the number of Documents that this method has lines in. - /// - public int GetDocumentsForMethodCount(out int count) - { - // TODO: parse sequence points - throw new NotImplementedException(); - } - - /// - /// Get the documents this method has lines in. - /// - public int GetDocumentsForMethod( - int bufferLength, - out int count, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]ISymUnmanagedDocument[] documents) - { - // TODO: parse sequence points - throw new NotImplementedException(); - } - - /// - /// Get the smallest start line and largest end line, for the method, in a specific document. - /// - public int GetSourceExtentInDocument(ISymUnmanagedDocument document, out int startLine, out int endLine) - { - return SymReader.GetMethodSourceExtentInDocument(document, this, out startLine, out endLine); - } - - #endregion - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymReader.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymReader.cs deleted file mode 100644 index 1851921e382b477ae67af676d6d687bff6a8f268..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymReader.cs +++ /dev/null @@ -1,559 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Diagnostics; -using System.Linq; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.ComTypes; -using Roslyn.Utilities; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - // TODO: - // ISymUnmanagedReaderSymbolSearchInfo? - // ISymUnmanagedSourceServerModule? - - [ComVisible(false)] - public sealed class SymReader : ISymUnmanagedReader4, ISymUnmanagedDispose - { - private readonly PortablePdbReader _pdbReader; - private readonly Lazy _lazyDocumentMap; - private readonly Lazy _lazyVbSemantics; - private readonly Lazy _lazyMethodMap; - - private int _version; - - // Takes ownership of . - private SymReader(PortablePdbReader pdbReader) - { - Debug.Assert(pdbReader != null); - - _pdbReader = pdbReader; - _version = 1; - - _lazyDocumentMap = new Lazy(() => new DocumentMap(MetadataReader)); - _lazyVbSemantics = new Lazy(() => IsVisualBasicAssembly()); - _lazyMethodMap = new Lazy(() => new MethodMap(MetadataReader)); - } - - internal static SymReader CreateFromFile(string path, LazyMetadataImport metadataImport) - { - byte[] bytes; - try - { - // TODO: use memory mapped files? - bytes = PortableShim.File.ReadAllBytes(path); - } - catch - { - return null; - } - - return new SymReader(new PortablePdbReader(bytes, bytes.Length, metadataImport)); - } - - internal static ISymUnmanagedReader CreateFromStream(IStream stream, LazyMetadataImport metadataImport) - { - byte[] bytes; - int size; - stream.ReadAllBytes(out bytes, out size); - - return new SymReader(new PortablePdbReader(bytes, size, metadataImport)); - } - - internal MetadataReader MetadataReader => _pdbReader.MetadataReader; - internal PortablePdbReader PdbReader => _pdbReader; - internal Lazy VbSemantics => _lazyVbSemantics; - - public int Destroy() - { - if (_pdbReader.IsDisposed) - { - return HResult.S_OK; - } - - _pdbReader.Dispose(); - return HResult.S_FALSE; - } - - private bool IsVisualBasicAssembly() - { - var reader = MetadataReader; - - foreach (var cdiHandle in reader.GetCustomDebugInformation(Handle.ModuleDefinition)) - { - if (reader.GetGuid(reader.GetCustomDebugInformation(cdiHandle).Kind) == MetadataUtilities.VbDefaultNamespaceId) - { - return true; - } - } - - return false; - } - - internal MethodMap GetMethodMap() - { - if (_pdbReader.IsDisposed) - { - throw new ObjectDisposedException(nameof(SymReader)); - } - - return _lazyMethodMap.Value; - } - - internal SymDocument AsSymDocument(ISymUnmanagedDocument document) - { - var symDocument = document as SymDocument; - return (symDocument?.SymReader == this) ? symDocument : null; - } - - public int GetDocument( - [MarshalAs(UnmanagedType.LPWStr)]string url, - Guid language, - Guid languageVendor, - Guid documentType, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedDocument document) - { - DocumentHandle documentHandle; - - // SymReader: language, vendor and type parameters are ignored. - - if (_pdbReader.IsDisposed) - { - throw new ObjectDisposedException(nameof(SymReader)); - } - - if (_lazyDocumentMap.Value.TryGetDocument(url, out documentHandle)) - { - document = new SymDocument(this, documentHandle); - return HResult.S_OK; - } - - document = null; - return HResult.S_FALSE; - } - - public int GetDocuments( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedDocument[] documents) - { - count = MetadataReader.Documents.Count; - - if (bufferLength == 0) - { - return HResult.S_OK; - } - - int i = 0; - foreach (var documentHandle in MetadataReader.Documents) - { - if (i >= bufferLength) - { - break; - } - - documents[i++] = new SymDocument(this, documentHandle); - } - - return HResult.S_OK; - } - - public int GetDocumentVersion(ISymUnmanagedDocument document, out int version, out bool isCurrent) - { - // SymReader always returns the same values - version = 1; - isCurrent = true; - return HResult.E_NOTIMPL; - } - - public int GetGlobalVariables( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedVariable[] variables) - { - // SymReader doesn't support. - count = 0; - return HResult.E_NOTIMPL; - } - - public int GetMethod(int methodToken, [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedMethod method) - { - return GetMethodByVersion(methodToken, _version, out method); - } - - public int GetMethodByVersion( - int methodToken, - int version, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedMethod method) - { - if (version != _version) - { - method = null; - return HResult.E_INVALIDARG; - } - - var handle = MetadataTokens.Handle(methodToken); - if (handle.Kind != HandleKind.MethodDefinition) - { - method = null; - return HResult.E_INVALIDARG; - } - - var methodDebugHandle = ((MethodDefinitionHandle)handle).ToDebugInformationHandle(); - - var methodBody = MetadataReader.GetMethodDebugInformation(methodDebugHandle); - if (methodBody.SequencePointsBlob.IsNil) - { - // no debug info for the method - method = null; - return HResult.E_FAIL; - } - - method = new SymMethod(this, methodDebugHandle); - return HResult.S_OK; - } - - public int GetMethodByVersionPreRemap(int methodToken, int version, [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedMethod method) - { - // TODO: - throw new NotSupportedException(); - } - - public int GetMethodFromDocumentPosition( - ISymUnmanagedDocument document, - int line, - int column, - [MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedMethod method) - { - var symDocument = AsSymDocument(document); - if (symDocument == null) - { - method = null; - return HResult.E_INVALIDARG; - } - - var methodBodyHandles = GetMethodMap().GetMethodsContainingLine(symDocument.Handle, line); - if (methodBodyHandles == null) - { - method = null; - return HResult.E_FAIL; - } - - var comparer = HandleComparer.Default; - var candidate = default(MethodDebugInformationHandle); - foreach (var methodDebugHandle in methodBodyHandles) - { - if (candidate.IsNil || comparer.Compare(methodDebugHandle, candidate) < 0) - { - candidate = methodDebugHandle; - } - } - - if (candidate.IsNil) - { - method = null; - return HResult.E_FAIL; - } - - method = new SymMethod(this, candidate); - return HResult.S_OK; - } - - public int GetMethodsFromDocumentPosition( - ISymUnmanagedDocument document, - int line, - int column, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3), Out]ISymUnmanagedMethod[] methods) - { - var symDocument = AsSymDocument(document); - if (symDocument == null) - { - count = 0; - return HResult.E_INVALIDARG; - } - - var methodBodyHandles = GetMethodMap().GetMethodsContainingLine(symDocument.Handle, line); - if (methodBodyHandles == null) - { - count = 0; - return HResult.E_FAIL; - } - - if (bufferLength > 0) - { - int i = 0; - foreach (var methodDebugHandle in methodBodyHandles) - { - if (i == bufferLength) - { - break; - } - - methods[i++] = new SymMethod(this, methodDebugHandle); - } - - count = i; - - if (i > 1) - { - Array.Sort(methods, 0, i, SymMethod.ByHandleComparer.Default); - } - } - else - { - count = methodBodyHandles.Count(); - } - - return HResult.S_OK; - } - - public int GetMethodsInDocument( - ISymUnmanagedDocument document, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out]ISymUnmanagedMethod[] methods) - { - var symDocument = AsSymDocument(document); - if (symDocument == null) - { - count = 0; - return HResult.E_INVALIDARG; - } - - var extentsByMethod = GetMethodMap().GetMethodExtents(symDocument.Handle); - if (bufferLength > 0) - { - int actualCount = Math.Min(extentsByMethod.Length, bufferLength); - for (int i = 0; i < actualCount; i++) - { - methods[i] = new SymMethod(this, extentsByMethod[i].Method); - } - - count = actualCount; - } - else - { - count = extentsByMethod.Length; - } - - count = 0; - return HResult.S_OK; - } - - internal int GetMethodSourceExtentInDocument(ISymUnmanagedDocument document, SymMethod method, out int startLine, out int endLine) - { - var symDocument = AsSymDocument(document); - if (symDocument == null) - { - startLine = endLine = 0; - return HResult.E_INVALIDARG; - } - - var map = GetMethodMap(); - if (!map.TryGetMethodSourceExtent(symDocument.Handle, method.DebugHandle, out startLine, out endLine)) - { - startLine = endLine = 0; - return HResult.E_FAIL; - } - - return HResult.S_OK; - } - - public int GetMethodVersion(ISymUnmanagedMethod method, out int version) - { - version = _version; - return HResult.S_OK; - } - - public int GetNamespaces( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedNamespace[] namespaces) - { - // SymReader doesn't support - count = 0; - return HResult.E_NOTIMPL; - } - - public int GetSymAttribute(int methodToken, - [MarshalAs(UnmanagedType.LPWStr)]string name, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out]byte[] customDebugInformation) - { - return GetSymAttributeByVersion(methodToken, 1, name, bufferLength, out count, customDebugInformation); - } - - public int GetSymAttributeByVersion( - int methodToken, - int version, - [MarshalAs(UnmanagedType.LPWStr)]string name, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3), Out]byte[] customDebugInformation) - { - if ((bufferLength != 0) != (customDebugInformation != null)) - { - count = 0; - return HResult.E_INVALIDARG; - } - - if (version != _version) - { - count = 0; - return HResult.E_INVALIDARG; - } - - if (name == "") - { - count = _pdbReader.ImageSize; - - if (bufferLength == 0) - { - return HResult.S_FALSE; - } - - Marshal.Copy(_pdbReader.ImagePtr, customDebugInformation, 0, bufferLength); - return HResult.S_OK; - } - - count = 0; - return HResult.S_FALSE; - } - - public int GetSymAttributePreRemap( - int methodToken, - [MarshalAs(UnmanagedType.LPWStr)]string name, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out]byte[] customDebugInformation) - { - // TODO: - throw new NotSupportedException(); - } - - public int GetSymAttributeByVersionPreRemap( - int methodToken, - int version, - [MarshalAs(UnmanagedType.LPWStr)]string name, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3), Out]byte[] customDebugInformation) - { - // TODO: - throw new NotSupportedException(); - } - - public int GetSymbolStoreFileName(int bufferLength, out int count, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]char[] name) - { - // TODO: - throw new NotImplementedException(); - } - - public int GetUserEntryPoint(out int methodToken) - { - var handle = MetadataReader.DebugMetadataHeader.EntryPoint; - if (!handle.IsNil) - { - methodToken = MetadataTokens.GetToken(handle); - return HResult.S_OK; - } - - methodToken = 0; - return HResult.E_FAIL; - } - - public int GetVariables( - int methodToken, - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1), Out]ISymUnmanagedVariable[] variables) - { - // SymReader doesn't support non-local variables. - count = 0; - return HResult.E_NOTIMPL; - } - - public int Initialize( - [MarshalAs(UnmanagedType.Interface)]object metadataImporter, - [MarshalAs(UnmanagedType.LPWStr)]string fileName, - [MarshalAs(UnmanagedType.LPWStr)]string searchPath, - IStream stream) - { - return HResult.S_OK; - } - - public int ReplaceSymbolStore([MarshalAs(UnmanagedType.LPWStr)]string fileName, IStream stream) - { - // TODO: - throw new NotImplementedException(); - } - - public int UpdateSymbolStore([MarshalAs(UnmanagedType.LPWStr)]string fileName, IStream stream) - { - // TODO: - throw new NotImplementedException(); - } - - /// - /// Checkes whether the id stored in the PDB matches the PDB ID stored in the PE/COFF Debug Directory. - /// - [PreserveSig] - public int MatchesModule(Guid guid, uint stamp, int age, [MarshalAs(UnmanagedType.Bool)]out bool result) - { - result = _pdbReader.MatchesModule(guid, stamp, age); - return HResult.S_OK; - } - - /// - /// Returns a pointer to Portable Debug Metadata. Only available for Portable PDBs. - /// - /// - /// A pointer to memory where Portable Debug Metadata start. The memory is owned by the SymReader and - /// valid until is invoked. - /// - /// Null if the PDB is not portable. - /// - /// Size of the metadata block. - [PreserveSig] - public unsafe int GetPortableDebugMetadata(out byte* metadata, out int size) - { - try - { - metadata = (byte*)_pdbReader.ImagePtr; - } - catch (InvalidOperationException) - { - metadata = null; - size = 0; - return HResult.E_UNEXPECTED; - } - - size = _pdbReader.ImageSize; - return HResult.S_OK; - } - - /// - /// Returns a pointer to Source Server data stored in the PDB. - /// - /// - /// A pointer to memory where Source Server data start. The memory is owned by the SymReader and - /// valid until is invoked. - /// - /// Null if the PDB doesn't contain Source Server data. - /// - /// Size of the data in bytes. - [PreserveSig] - public unsafe int GetSourceServerData(out byte* data, out int size) - { - data = null; - size = 0; - return HResult.S_OK; - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymScope.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymScope.cs deleted file mode 100644 index 4d9b3e8793265fc3f950ef67777d3933f9ec772d..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymScope.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Diagnostics; -using System.Runtime.InteropServices; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - [ComVisible(false)] - public sealed class SymScope : ISymUnmanagedScope2 - { - internal readonly ScopeData _data; - - internal SymScope(ScopeData data) - { - Debug.Assert(data != null); - _data = data; - } - - public int GetChildren( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedScope[] children) - { - var childrenData = _data.GetChildren(); - - int i = 0; - foreach (var childData in childrenData) - { - if (i >= bufferLength) - { - break; - } - - children[i++] = new SymScope(childData); - } - - count = (bufferLength == 0) ? childrenData.Length : i; - return HResult.S_OK; - } - - public int GetConstantCount(out int count) - { - return GetConstants(0, out count, null); - } - - public int GetConstants( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedConstant[] constants) - { - return _data.GetConstants(bufferLength, out count, constants); - } - - public int GetLocalCount(out int count) - { - return GetLocals(0, out count, null); - } - - public int GetLocals(int bufferLength, out int count, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedVariable[] locals) - { - return _data.GetLocals(bufferLength, out count, locals); - } - - public int GetMethod([MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedMethod method) - { - method = _data.SymMethod; - return HResult.S_OK; - } - - public int GetParent([MarshalAs(UnmanagedType.Interface)]out ISymUnmanagedScope scope) - { - var parentData = _data.Parent; - scope = (parentData != null) ? new SymScope(parentData) : null; - return HResult.S_OK; - } - - public int GetStartOffset(out int offset) - { - offset = _data.StartOffset; - return HResult.S_OK; - } - - public int GetEndOffset(out int offset) - { - offset = _data.EndOffset; - return HResult.S_OK; - } - - public int GetNamespaces( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]ISymUnmanagedNamespace[] namespaces) - { - // Language specific, the client has to use Portable PDB reader directly to access the data. - // Pretend there are no namespace scopes. - count = 0; - return HResult.S_OK; - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymVariable.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymVariable.cs deleted file mode 100644 index 2b0199b80eac4460eaf06ed7cc90d378ea78bda4..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/SymVariable.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Immutable; -using System.Diagnostics; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; -using System.Runtime.InteropServices; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - [ComVisible(false)] - public sealed class SymVariable : ISymUnmanagedVariable - { - private const int ADDR_IL_OFFSET = 1; - - private readonly SymMethod _symMethod; - private readonly LocalVariableHandle _handle; - - internal SymVariable(SymMethod symMethod, LocalVariableHandle handle) - { - Debug.Assert(symMethod != null); - _symMethod = symMethod; - _handle = handle; - } - - private MetadataReader MetadataReader => _symMethod.MetadataReader; - - public int GetAttributes(out int attributes) - { - var variable = MetadataReader.GetLocalVariable(_handle); - attributes = (int)variable.Attributes; - return HResult.S_OK; - } - - public int GetAddressField1(out int value) - { - var variable = MetadataReader.GetLocalVariable(_handle); - value = variable.Index; - return HResult.S_OK; - } - - public int GetAddressField2(out int value) - { - // not implemented by DiaSymReader - value = 0; - return HResult.E_NOTIMPL; - } - - public int GetAddressField3(out int value) - { - // not implemented by DiaSymReader - value = 0; - return HResult.E_NOTIMPL; - } - - public int GetStartOffset(out int offset) - { - // not implemented by DiaSymReader - offset = 0; - return HResult.E_NOTIMPL; - } - - public int GetEndOffset(out int offset) - { - // not implemented by DiaSymReader - offset = 0; - return HResult.E_NOTIMPL; - } - - public int GetAddressKind(out int kind) - { - kind = ADDR_IL_OFFSET; - return HResult.S_OK; - } - - public int GetName( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]char[] name) - { - var variable = MetadataReader.GetLocalVariable(_handle); - var str = MetadataReader.GetString(variable.Name); - return InteropUtilities.StringToBuffer(str, bufferLength, out count, name); - } - - public unsafe int GetSignature( - int bufferLength, - out int count, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0), Out]byte[] signature) - { - var localSignatureHandle = _symMethod.MetadataReader.GetMethodDebugInformation(_symMethod.DebugHandle).LocalSignature; - var metadataImport = _symMethod.SymReader.PdbReader.GetMetadataImport(); - var local = _symMethod.MetadataReader.GetLocalVariable(_handle); - - byte* signaturePtr; - int signatureLength; - int hr = metadataImport.GetSigFromToken(MetadataTokens.GetToken(localSignatureHandle), out signaturePtr, out signatureLength); - if (hr != HResult.S_OK) - { - count = 0; - return hr; - } - - var signatureReader = new BlobReader(signaturePtr, signatureLength); - - SignatureHeader header = signatureReader.ReadSignatureHeader(); - if (header.Kind != SignatureKind.LocalVariables) - { - count = 0; - return HResult.E_FAIL; - } - - int slotCount = signatureReader.ReadCompressedInteger(); - int slotIndex = local.Index; - if (slotIndex >= slotCount) - { - count = 0; - return HResult.E_FAIL; - } - - var typeProvider = DummyTypeProvider.Instance; - - var decoder = new SignatureDecoder(typeProvider); - for (int i = 0; i < slotIndex - 1; i++) - { - decoder.DecodeType(ref signatureReader, allowTypeSpecifications: false); - } - - int localSlotStart = signatureReader.Offset; - decoder.DecodeType(ref signatureReader, allowTypeSpecifications: false); - int localSlotLength = signatureReader.Offset - localSlotStart; - - if (localSlotLength <= bufferLength) - { - Marshal.Copy((IntPtr)(signaturePtr + localSlotStart), signature, 0, localSlotLength); - } - - count = localSlotLength; - return HResult.S_OK; - } - - private sealed class DummyTypeProvider : ISignatureTypeProvider - { - public static readonly DummyTypeProvider Instance = new DummyTypeProvider(); - - public object GetArrayType(object elementType, ArrayShape shape) => null; - public object GetByReferenceType(object elementType) => null; - public object GetFunctionPointerType(MethodSignature signature) => null; - public object GetGenericInstance(object genericType, ImmutableArray typeArguments) => null; - public object GetGenericMethodParameter(int index) => null; - public object GetGenericTypeParameter(int index) => null; - public object GetModifiedType(MetadataReader reader, bool isRequired, object modifier, object unmodifiedType) => null; - public object GetPinnedType(object elementType) => null; - public object GetPointerType(object elementType) => null; - public object GetPrimitiveType(PrimitiveTypeCode typeCode) => null; - public object GetSZArrayType(object elementType) => null; - public object GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) => null; - public object GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => null; - public object GetTypeFromSpecification(MetadataReader reader, TypeSpecificationHandle handle, byte rawTypeKind) => null; - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/BlobWriter.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/BlobWriter.cs deleted file mode 100644 index c51edb7538ded747358edfb98c3993c6687cec49..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/BlobWriter.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal struct BlobWriter - { - private byte[] _buffer; - private int _position; - - public BlobWriter(int initialCapacity = 16) - { - _buffer = new byte[initialCapacity]; - _position = 0; - } - - private void EnsureCapacity(int size) - { - if (_position + size > _buffer.Length) - { - Array.Resize(ref _buffer, Math.Min(_position + size, _buffer.Length * 2 + 1)); - } - } - - public void Write(byte value) - { - EnsureCapacity(1); - _buffer[_position] = value; - _position++; - } - - public void Write(byte b1, byte b2) - { - EnsureCapacity(2); - _buffer[_position] = b1; - _buffer[_position + 1] = b2; - _position += 2; - } - - public void Write(byte b1, byte b2, byte b3, byte b4) - { - EnsureCapacity(4); - _buffer[_position] = b1; - _buffer[_position + 1] = b2; - _buffer[_position + 2] = b3; - _buffer[_position + 3] = b4; - _position += 4; - } - - internal void Write(byte[] buffer) - { - Write(buffer, 0, buffer.Length); - } - - internal void Write(byte[] buffer, int index, int length) - { - EnsureCapacity(length); - Buffer.BlockCopy(buffer, index, _buffer, _position, length); - _position += length; - } - - public void WriteCompressedInteger(int value) - { - unchecked - { - if (value <= 0x7f) - { - Write((byte)value); - } - else if (value <= 0x3fff) - { - Write((byte)(0x80 | (value >> 8)), (byte)value); - } - else - { - Debug.Assert(value <= 0x1fffffff); - - Write( - (byte)(0xc0 | (value >> 24)), - (byte)(value >> 16), - (byte)(value >> 8), - (byte)value); - } - } - } - - public byte[] ToArray() - { - var buffer = _buffer; - Array.Resize(ref buffer, _position); - - _buffer = null; - _position = -1; - return buffer; - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/EnumerableHelpers.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/EnumerableHelpers.cs deleted file mode 100644 index 2a45c1ea588d987f7e1c2444362f3f2afbd33a2b..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/EnumerableHelpers.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; -using System.Collections.Immutable; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal static class EnumerableHelpers - { - /// - /// Groups specified entries by key optimizing for single-item groups. - /// The ordering of values within each bucket is the same as their ordering in the sequence. - /// - public static IReadOnlyDictionary>> GroupBy(this IEnumerable> entries, IEqualityComparer keyComparer) - { - var builder = new Dictionary.Builder>>(keyComparer); - - foreach (var entry in entries) - { - KeyValuePair.Builder> existing; - if (!builder.TryGetValue(entry.Key, out existing)) - { - builder[entry.Key] = KeyValuePair.Create(entry.Value, default(ImmutableArray.Builder)); - } - else if (existing.Value == null) - { - var list = ImmutableArray.CreateBuilder(); - list.Add(existing.Key); - list.Add(entry.Value); - builder[entry.Key] = KeyValuePair.Create(default(V), list); - } - else - { - existing.Value.Add(entry.Value); - } - } - - var result = new Dictionary>>(builder.Count, keyComparer); - foreach (var entry in builder) - { - result.Add(entry.Key, KeyValuePair.Create(entry.Value.Key, entry.Value.Value?.ToImmutable() ?? default(ImmutableArray))); - } - - return result; - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/FileNameUtilities.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/FileNameUtilities.cs deleted file mode 100644 index 2bc6d783fa39baca37ed107935c326d01f591917..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/FileNameUtilities.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal static class FileNameUtilities - { - private const string DirectorySeparatorStr = "\\"; - private const char DirectorySeparatorChar = '\\'; - private const char AltDirectorySeparatorChar = '/'; - private const char VolumeSeparatorChar = ':'; - - /// - /// Returns the position in given path where the file name starts. - /// - /// -1 if path is null. - internal static int IndexOfFileName(string path) - { - if (path == null) - { - return -1; - } - - for (int i = path.Length - 1; i >= 0; i--) - { - char ch = path[i]; - if (ch == DirectorySeparatorChar || ch == AltDirectorySeparatorChar || ch == VolumeSeparatorChar) - { - return i + 1; - } - } - - return 0; - } - - internal static bool IsDirectorySeparator(char separator) - { - return separator == DirectorySeparatorChar || separator == AltDirectorySeparatorChar; - } - - /// - /// Get file name from path. - /// - /// Unlike doesn't check for invalid path characters. - internal static string GetFileName(string path) - { - int fileNameStart = IndexOfFileName(path); - return (fileNameStart <= 0) ? path : path.Substring(fileNameStart); - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/HResult.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/HResult.cs deleted file mode 100644 index b7d84f3f0fe008935117da27d81a1a802e7424af..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/HResult.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal static class HResult - { - internal const int S_OK = 0; - internal const int S_FALSE = 1; - internal const int E_NOTIMPL = unchecked((int)0x80004001); - internal const int E_FAIL = unchecked((int)0x80004005); - internal const int E_INVALIDARG = unchecked((int)0x80070057); - internal const int E_OUTOFMEMORY = unchecked((int)0x8007000E); - internal const int E_UNEXPECTED = unchecked((int)0x8000FFFF); - - internal const int E_PDB_NOT_FOUND = unchecked((int)0x806D0005); - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/InteropUtilities.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/InteropUtilities.cs deleted file mode 100644 index 4173aa0453d7e7c0214ff18b86784426f7c7264f..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/InteropUtilities.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.ComTypes; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal static class InteropUtilities - { - public static int StringToBuffer( - string str, - int bufferLength, - out int count, - char[] buffer) - { - // include NUL terminator: - count = str.Length + 1; - - if (buffer == null) - { - return HResult.S_OK; - } - - if (count > bufferLength) - { - count = 0; - return HResult.E_OUTOFMEMORY; - } - - str.CopyTo(0, buffer, 0, str.Length); - buffer[str.Length] = '\0'; - - return HResult.S_OK; - } - - public static int BytesToBuffer( - byte[] bytes, - int bufferLength, - out int count, - byte[] buffer) - { - count = bytes.Length; - - if (buffer == null) - { - return HResult.S_OK; - } - - if (count > bufferLength) - { - count = 0; - return HResult.E_OUTOFMEMORY; - } - - Buffer.BlockCopy(bytes, 0, buffer, 0, count); - return HResult.S_OK; - } - - // TODO: use IUnsafeComStream (ComMemoryStream in tests)? - internal unsafe static void ReadAllBytes(this IStream stream, out byte[] bytes, out int size) - { - const int STREAM_SEEK_SET = 0; - - size = GetStreamSize(stream); - - stream.Seek(0, STREAM_SEEK_SET, IntPtr.Zero); - - bytes = new byte[size]; - - int bytesRead = 0; - stream.Read(bytes, size, (IntPtr)(&bytesRead)); - - if (bytesRead != size) - { - // TODO: - throw new NotSupportedException(); - } - } - - private static int GetStreamSize(IStream stream) - { - const int STATFLAG_NONAME = 1; - - STATSTG stats; - stream.Stat(out stats, STATFLAG_NONAME); - long result = stats.cbSize; - if (result < 0 || result > int.MaxValue) - { - throw new BadImageFormatException(); - } - - return (int)result; - } - - internal static void TransferOwnershipOrRelease(ref object objectOpt, object newOwnerOpt) - { - if (newOwnerOpt != null) - { - if (objectOpt != null && Marshal.IsComObject(objectOpt)) - { - Marshal.ReleaseComObject(objectOpt); - } - - objectOpt = null; - } - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/KeyValuePair.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/KeyValuePair.cs deleted file mode 100644 index b6f01cd7d70c2d9b39e919f58a1890795f11a16f..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/KeyValuePair.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal static class KeyValuePair - { - public static KeyValuePair Create(K key, V value) - { - return new KeyValuePair(key, value); - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/LazyMetadataImport.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/LazyMetadataImport.cs deleted file mode 100644 index 819dcf9c914ec2f1558cf06abd3d55b2fe85a9a6..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/LazyMetadataImport.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Runtime.InteropServices; -using System.Threading; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal sealed class LazyMetadataImport : IDisposable - { - private IMetadataImport _lazyMetadataImport; - private readonly IMetadataImportProvider _metadataImportProviderOpt; - - public LazyMetadataImport(IMetadataImport metadataImport) - { - _lazyMetadataImport = metadataImport; - } - - public LazyMetadataImport(IMetadataImportProvider _metadataImportProvider) - { - _metadataImportProviderOpt = _metadataImportProvider; - } - - public IMetadataImport GetMetadataImport() - { - if (_lazyMetadataImport == null) - { - var importer = _metadataImportProviderOpt.GetMetadataImport() as IMetadataImport; - if (importer == null) - { - throw new InvalidOperationException(); - } - - Interlocked.CompareExchange(ref _lazyMetadataImport, importer, null); - } - - return _lazyMetadataImport; - } - - public void Dispose() - { - var import = Interlocked.Exchange(ref _lazyMetadataImport, null); - if (import != null && Marshal.IsComObject(import)) - { - Marshal.ReleaseComObject(import); - } - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/MetadataUtilities.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/MetadataUtilities.cs deleted file mode 100644 index 05d1014a5a21878d4bcfceebfe601e1a4ea240f4..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/MetadataUtilities.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal static class MetadataUtilities - { - public const SignatureTypeCode SignatureTypeCode_ValueType = (SignatureTypeCode)0x11; - public const SignatureTypeCode SignatureTypeCode_Class = (SignatureTypeCode)0x12; - public static int MethodDefToken(int rowId) => 0x06000000 | rowId; - - // Custom Attribute kinds: - public static readonly Guid MethodSteppingInformationBlobId = new Guid("54FD2AC5-E925-401A-9C2A-F94F171072F8"); - public static readonly Guid VbDefaultNamespaceId = new Guid("58b2eab6-209f-4e4e-a22c-b2d0f910c782"); - - internal static int GetTypeDefOrRefOrSpecCodedIndex(EntityHandle typeHandle) - { - int tag = 0; - switch (typeHandle.Kind) - { - case HandleKind.TypeDefinition: - tag = 0; - break; - - case HandleKind.TypeReference: - tag = 1; - break; - - case HandleKind.TypeSpecification: - tag = 2; - break; - } - - return (MetadataTokens.GetRowNumber(typeHandle) << 2) | tag; - } - - internal static BlobHandle GetCustomDebugInformation(this MetadataReader reader, EntityHandle parent, Guid kind) - { - foreach (var cdiHandle in reader.GetCustomDebugInformation(parent)) - { - var cdi = reader.GetCustomDebugInformation(cdiHandle); - if (reader.GetGuid(cdi.Kind) == kind) - { - // return the first record - return cdi.Value; - } - } - - return default(BlobHandle); - } - } -} \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/PortableShim.cs b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/PortableShim.cs deleted file mode 100644 index 2ca348e24b63966a2d2965e411d87871b0f6c459..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Utilities/PortableShim.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Reflection; -using Roslyn.Utilities; - -namespace Microsoft.DiaSymReader.PortablePdb -{ - internal static class PortableShim - { - private static class CoreNames - { - internal const string System_IO_FileSystem = "System.IO.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - internal const string System_Runtime_Extensions = "System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - } - - internal static class Environment - { - internal const string TypeName = "System.Environment"; - - internal static readonly Type Type = ReflectionUtilities.GetTypeFromEither( - contractName: $"{TypeName}, {CoreNames.System_Runtime_Extensions}", - desktopName: TypeName); - - internal static Func GetEnvironmentVariable = (Func)Type - .GetTypeInfo() - .GetDeclaredMethod(nameof(GetEnvironmentVariable), paramTypes: new[] { typeof(string) }) - .CreateDelegate(typeof(Func)); - } - - internal static class File - { - internal const string TypeName = "System.IO.File"; - - internal static readonly Type Type = ReflectionUtilities.GetTypeFromEither( - contractName: $"{TypeName}, {CoreNames.System_IO_FileSystem}", - desktopName: TypeName); - - internal static readonly Func OpenRead = Type - .GetTypeInfo() - .GetDeclaredMethod(nameof(OpenRead), paramTypes: new[] { typeof(string) }) - .CreateDelegate>(); - - internal static readonly Func Exists = Type - .GetTypeInfo() - .GetDeclaredMethod(nameof(Exists), new[] { typeof(string) }) - .CreateDelegate>(); - - internal static readonly Func ReadAllBytes = Type - .GetTypeInfo() - .GetDeclaredMethod(nameof(ReadAllBytes), paramTypes: new[] { typeof(string) }) - .CreateDelegate>(); - } - } -} diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Version.targets b/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Version.targets deleted file mode 100644 index 7b8e6012fbab7cec2567441106aa0bb0ec6bc3b5..0000000000000000000000000000000000000000 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/Version.targets +++ /dev/null @@ -1,38 +0,0 @@ - - - 1.1.0 - false - - - - - - beta1 - $(AssemblyVersion).0 - - - - - - beta1-$(BuildNumber.Split('.')[0])-$(BuildNumber.Split('.')[1].PadLeft(2,'0')) - $(AssemblyVersion).$(BuildNumber.Split('.')[0]) - - - - - - - - $(AssemblyVersion) - Release - - - - - - $(AssemblyVersion)-$(NuGetVersionSuffix) - PerBuildPreRelease - - - - \ No newline at end of file diff --git a/src/Dependencies/DiaSymReader.PortablePdb/DiaSymReader.PortablePdb.csproj b/src/Dependencies/DiaSymReader.PortablePdb/DiaSymReader.PortablePdb.csproj new file mode 100644 index 0000000000000000000000000000000000000000..5f6161d55e6016e11b46c2dfb6b56d0bd29a3491 --- /dev/null +++ b/src/Dependencies/DiaSymReader.PortablePdb/DiaSymReader.PortablePdb.csproj @@ -0,0 +1,16 @@ + + + + + + + D06F8190-AC11-48E6-B0BF-5F17B7EB7B62 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + + + + + + \ No newline at end of file diff --git a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/project.json b/src/Dependencies/DiaSymReader.PortablePdb/project.json similarity index 53% rename from src/Debugging/Microsoft.DiaSymReader.PortablePdb/project.json rename to src/Dependencies/DiaSymReader.PortablePdb/project.json index 65b29938ab3388b1b8601c1b9e7de40cbce2d568..dab1114e7d095f66f1f5b3f18e5f0c1eba3af6b9 100644 --- a/src/Debugging/Microsoft.DiaSymReader.PortablePdb/project.json +++ b/src/Dependencies/DiaSymReader.PortablePdb/project.json @@ -1,5 +1,7 @@ -{ +{ + "supports": {}, "dependencies": { + "Microsoft.DiaSymReader.PortablePdb": "1.2.0-beta1-60706-02" }, "frameworks": { ".NETPortable,Version=v4.5,Profile=Profile7": {} diff --git a/src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestUtilities.csproj b/src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestUtilities.csproj index cca99ad6f319a6e674bce26b5018061bb14603e2..688f596a75d44a3fac389c10d62a97ff44567829 100644 --- a/src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestUtilities.csproj +++ b/src/ExpressionEvaluator/Core/Test/ExpressionCompiler/ExpressionCompilerTestUtilities.csproj @@ -34,10 +34,6 @@ {f7712928-1175-47b3-8819-ee086753dee2} TestUtilities.FX45 - - {f83343ba-b4ea-451c-b6db-5d645e6171bc} - Microsoft.DiaSymReader.PortablePdb - {5002636a-fe8d-40bf-8818-ab513a2194fa} Concord diff --git a/src/Setup/DevDivPackages/Dependencies.proj b/src/Setup/DevDivPackages/Dependencies.proj index 983cede53d8c65be13a0b1fe5726afb75de48b81..70fc2448fce8a403f019b904a5f0c1e8d4591c68 100644 --- a/src/Setup/DevDivPackages/Dependencies.proj +++ b/src/Setup/DevDivPackages/Dependencies.proj @@ -20,10 +20,6 @@ $(MicrosoftVisualStudioInteractiveWindowVersion)-beta-$(BuildNumberPart1.Trim())-$(BuildNumberPart2.Trim()) false - - $(MicrosoftDiaSymReaderPortablePdbVersion) - false - $(SystemCollectionsImmutableVersion) true @@ -46,7 +42,8 @@ Packages that exist on NuGet and already have structure compatible with DevDiv. --> - + + diff --git a/src/Setup/Setup.proj b/src/Setup/Setup.proj index e8813bf440bbc0181938f6559a8182643dad233a..6cda0ffaf446648c2e15fba59f4117662ec1ed08 100644 --- a/src/Setup/Setup.proj +++ b/src/Setup/Setup.proj @@ -37,8 +37,7 @@ - - + diff --git a/src/Test/DeployDesktopTestRuntime/DeployDesktopTestRuntime.csproj b/src/Test/DeployDesktopTestRuntime/DeployDesktopTestRuntime.csproj index ec30b527fc413a141fa24be4fb03e671abdea620..76de52f06e62c8bc883e1182bfef100b4685059a 100644 --- a/src/Test/DeployDesktopTestRuntime/DeployDesktopTestRuntime.csproj +++ b/src/Test/DeployDesktopTestRuntime/DeployDesktopTestRuntime.csproj @@ -25,10 +25,6 @@ - - {deb3d675-5a3c-46da-8945-f2efab135ea0} - Microsoft.DiaSymReader.PortablePdb.UnitTests - {2dae4406-7a89-4b5f-95c3-bc5472ce47ce} ScriptingTest diff --git a/src/Test/PdbUtilities/PdbUtilities.csproj b/src/Test/PdbUtilities/PdbUtilities.csproj index 09f6448a796b719093d00ae77513e7bfe32d5412..289c91308ae339c201a127d917c049e42a6873f9 100644 --- a/src/Test/PdbUtilities/PdbUtilities.csproj +++ b/src/Test/PdbUtilities/PdbUtilities.csproj @@ -96,9 +96,9 @@ - - {f83343ba-b4ea-451c-b6db-5d645e6171bc} - Microsoft.DiaSymReader.PortablePdb + + {d06f8190-ac11-48e6-b0bf-5f17b7eb7b62} + DiaSymReader.PortablePdb {27b7a354-80cc-4bac-abf5-d4081056cea9}