Windows arm32 and Linux arm/arm64 support (#276)
authorMike McLaughlin <mikem@microsoft.com>
Wed, 22 May 2019 00:36:17 +0000 (17:36 -0700)
committerGitHub <noreply@github.com>
Wed, 22 May 2019 00:36:17 +0000 (17:36 -0700)
Fix issue: https://github.com/dotnet/diagnostics/issues/242

Update command include files from coreclr to fix arm build problems.

Add warning headers to common includes: issue https://github.com/dotnet/diagnostics/issues/38

Added calling dbgeng DAC IOCTL fallback so ".cordll" works.

Added host runtime directory to diasymreader search.

Remove installing sudo on 18.04 docker images (docker-init.sh).

58 files changed:
.vsts-dotnet-ci.yml
.vsts-dotnet.yml
CMakeLists.txt
documentation/building/linux-instructions.md
documentation/building/windows-instructions.md
eng/Build-Native.cmd
eng/GalleryManifest.xml
eng/Versions.props
eng/build-native.sh
eng/build.sh
eng/build.yml
eng/common/build.ps1
eng/common/build.sh
eng/create-gallery-zip.ps1
eng/docker-build.sh
eng/docker-init.sh [deleted file]
eng/gen-buildsys-clang.sh
eng/gen-buildsys-win.bat
eng/init-distro-rid.sh
eng/probe-win.ps1 [deleted file]
eng/set-cmake-path.ps1 [new file with mode: 0644]
src/SOS/Strike/CMakeLists.txt
src/SOS/Strike/disasm.cpp
src/SOS/Strike/exts.cpp
src/SOS/Strike/hostcoreclr.cpp
src/SOS/Strike/util.cpp
src/SOS/Strike/util.h
src/SOS/gcdump/gcdumpnonx86.cpp
src/SOS/lldbplugin/CMakeLists.txt
src/Tools/dotnet-dump/dotnet-dump.csproj
src/Tools/dotnet-sos/dotnet-sos.csproj
src/Tools/sos-packaging.props [new file with mode: 0644]
src/inc/MSCOREE.IDL
src/inc/clr_std/string
src/inc/clrprivbinding.idl
src/inc/cor.h
src/inc/corexcep.h
src/inc/corhdr.h
src/inc/corprof.idl
src/inc/cortypeinfo.h
src/inc/debugmacros.h
src/inc/gcdecoder.cpp
src/inc/gcdump.h
src/inc/gcinfo.h
src/inc/gcinfodecoder.h
src/inc/gcinfodumper.h
src/inc/gcinfotypes.h
src/inc/holder.h
src/inc/loglf.h
src/inc/metahost.idl
src/inc/mscorsvc.idl
src/inc/palclr.h
src/inc/palclr_win.h
src/inc/predeftlsslot.h
src/inc/staticcontract.h
src/inc/stresslog.h
src/inc/switches.h
src/inc/tls.h

index 10c8b1185c9a14b1c55bd4e8e9f5c540880ffbdf..b6e4904620a155542e3595f99f5aba7c4f5fe8e5 100644 (file)
@@ -20,7 +20,7 @@ phases:
   parameters:
     name: CentOS_7
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:centos-7-c103199-20180628120549
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343
     queue:
       name: DotNetCore-Linux
       demands:
index 949b610b9d6f8117a52a8e97e38b8bac891b4409..47501b1773fb24b2df832c74a327e8fe34bcc6b5 100644 (file)
@@ -7,7 +7,7 @@ phases:
       name: DotNetCore-Build
       demands:
         - agent.os -equals Windows_NT
-      parallel: 3
+      parallel: 4
       matrix:
         Build_Debug:
           _BuildConfig: Debug
@@ -20,12 +20,16 @@ phases:
           _BuildConfig: Release
           _BuildArch: x86
           _PublishArtifacts: bin/Windows_NT.x86.Release
+        Build_Release_arm:
+          _BuildConfig: Release
+          _BuildArch: arm
+          _PublishArtifacts: bin/Windows_NT.arm.Release
 
 - template: /eng/build.yml
   parameters:
     name: CentOS_7
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:centos-7-c103199-20180628120549
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343
     queue:
       name: DotNet-Build
       demands:
@@ -41,6 +45,38 @@ phases:
           _BuildArch: x64
           _PublishArtifacts: bin/Linux.x64.Release
 
+- template: /eng/build.yml
+  parameters:
+    name: Linux_cross
+    agentOs: Linux
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-14.04-cross-1735d26-20190521133857
+    crossrootfsDir: '/crossrootfs/arm'
+    queue:
+      name: DotNet-Build
+      demands:
+        - agent.os -equals Linux
+      matrix:
+        Build_Release:
+          _BuildConfig: Release
+          _BuildArch: arm
+          _PublishArtifacts: bin/Linux.arm.Release
+
+- template: /eng/build.yml
+  parameters:
+    name: Linux_cross64
+    agentOs: Linux
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180315221921
+    crossrootfsDir: '/crossrootfs/arm64'
+    queue:
+      name: DotNet-Build
+      demands:
+        - agent.os -equals Linux
+      matrix:
+        Build_Release:
+          _BuildConfig: Release
+          _BuildArch: arm64
+          _PublishArtifacts: bin/Linux.arm64.Release
+
 - template: /eng/build.yml
   parameters:
     name: Alpine3_6
@@ -50,7 +86,6 @@ phases:
       name: DotNet-Build
       demands:
         - agent.os -equals Linux
-      parallel: 2
       matrix:
         Build_Release:
           _BuildConfig: Release
@@ -79,7 +114,7 @@ phases:
   parameters:
     name: Debian_Stretch
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:debian-stretch-c103199-20180628122423
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-stretch-3e800f1-20190521154431
     dependsOn: CentOS_7
     testOnly: true
     queue:
@@ -93,9 +128,9 @@ phases:
 
 - template: /eng/build.yml
   parameters:
-    name: Fedora_27
+    name: Fedora_28
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:fedora-27-c103199-20180628122443
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-28-09ca40b-20190508143249
     dependsOn: CentOS_7
     testOnly: true
     queue:
@@ -109,9 +144,9 @@ phases:
 
 - template: /eng/build.yml
   parameters:
-    name: Fedora_28
+    name: Fedora_29
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:fedora-28-c103199-20180628122443
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-29-09ca40b-20190508143249
     dependsOn: CentOS_7
     testOnly: true
     queue:
@@ -127,7 +162,7 @@ phases:
   parameters:
     name: OpenSuse_42_1
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:opensuse-42.1-c103199-20180628122439
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-42.1-c103199-20180628122439
     dependsOn: CentOS_7
     testOnly: true
     queue:
@@ -143,7 +178,7 @@ phases:
   parameters:
     name: OpenSuse_42_3
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:opensuse-42.3-c103199-20180628122439
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-42.3-3e800f1-20190501005344
     dependsOn: CentOS_7
     testOnly: true
     queue:
@@ -159,7 +194,7 @@ phases:
   parameters:
     name: Ubuntu_14_04
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-c103199-20180628134413
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-14.04-1735d26-20190521133852
     dependsOn: CentOS_7
     testOnly: true
     queue:
@@ -175,23 +210,7 @@ phases:
   parameters:
     name: Ubuntu_16_04
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-c103199-20180628134544
-    dependsOn: CentOS_7
-    testOnly: true
-    queue:
-      name: DotNet-Build
-      demands:
-        - agent.os -equals Linux
-      matrix:
-        Build_Debug:
-          _BuildConfig: Debug
-          _BuildArch: x64
-
-- template: /eng/build.yml
-  parameters:
-    name: Ubuntu_17_10
-    agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:ubuntu-17.10-c103199-20180628134544
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-09ca40b-20190520220842
     dependsOn: CentOS_7
     testOnly: true
     queue:
@@ -207,7 +226,7 @@ phases:
   parameters:
     name: Ubuntu_18_04
     agentOs: Linux
-    dockerImage: microsoft/dotnet-buildtools-prereqs:ubuntu-18.04-c103199-20180628134610
+    dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-3e800f1-20190508143252
     dependsOn: CentOS_7
     testOnly: true
     queue:
@@ -225,6 +244,8 @@ phases:
   - CentOS_7
   - Alpine3_6
   - MacOS
+  - Linux_cross
+  - Linux_cross64
   condition: ne(variables['Build.Reason'], 'Schedule')
   queue:
     name: DotNetCore-Build
@@ -318,6 +339,32 @@ phases:
       targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Windows_NT.x86.Release'
     condition: succeeded()
 
+  # Windows arm download, copy and archive.
+
+  - task: DownloadBuildArtifacts@0
+    displayName: Download Windows Arm Artifacts
+    inputs:
+      artifactName: Windows_arm_Release
+      downloadPath: '$(System.ArtifactsDirectory)'
+    condition: succeeded()
+
+  - task: CopyFiles@2
+    displayName: Copy Windows Arm Artifacts
+    inputs:
+      sourceFolder: '$(System.ArtifactsDirectory)/Windows_arm_Release'
+      contents: 'sos.dll'
+      targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Windows_NT.arm.Release'
+    condition: succeeded()
+
+  - task: CopyFiles@2
+    displayName: Copy Windows x86 Artifacts
+    inputs:
+      sourceFolder: '$(_SOSNETCorePath)'
+      contents: '*.dll'
+      overWrite: true
+      targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Windows_NT.arm.Release'
+    condition: succeeded()
+
   # Copy and archive the files for windbg extension gallery.
 
   - powershell: $(Build.SourcesDirectory)\eng\create-gallery-zip.ps1 $(Build.SourcesDirectory)
@@ -353,14 +400,14 @@ phases:
   # Linux MUSL x64 download, copy and archive
 
   - task: DownloadBuildArtifacts@0
-    displayName: Download Linux Artifacts
+    displayName: Download Linux Musl Artifacts
     inputs:
       artifactName: Alpine3_6_x64_Release
       downloadPath: '$(System.ArtifactsDirectory)'
     condition: succeeded()
 
   - task: CopyFiles@2
-    displayName: Copy Linux Artifacts
+    displayName: Copy Linux Musl Artifacts
     inputs:
       sourceFolder: '$(System.ArtifactsDirectory)/Alpine3_6_x64_Release'
       contents: ?(libsos.so|libsosplugin.so|sosdocsunix.txt)
@@ -368,7 +415,7 @@ phases:
     condition: succeeded()
 
   - task: CopyFiles@2
-    displayName: Copy Linux Artifacts
+    displayName: Copy Linux Musl Artifacts
     inputs:
       sourceFolder: '$(_SOSNETCorePath)'
       contents: '*.dll'
@@ -376,6 +423,58 @@ phases:
       targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Linux-musl.x64.Release'
     condition: succeeded()
 
+  # Linux arm download, copy and archive
+
+  - task: DownloadBuildArtifacts@0
+    displayName: Download Linux Arm Artifacts
+    inputs:
+      artifactName: Linux_cross_arm_Release
+      downloadPath: '$(System.ArtifactsDirectory)'
+    condition: succeeded()
+
+  - task: CopyFiles@2
+    displayName: Copy Linux Arm Artifacts
+    inputs:
+      sourceFolder: '$(System.ArtifactsDirectory)/Linux_cross_arm_Release'
+      contents: ?(libsos.so|libsosplugin.so|sosdocsunix.txt)
+      targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Linux.arm.Release'
+    condition: succeeded()
+
+  - task: CopyFiles@2
+    displayName: Copy Linux Arm Artifacts
+    inputs:
+      sourceFolder: '$(_SOSNETCorePath)'
+      contents: '*.dll'
+      overWrite: true
+      targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Linux.arm.Release'
+    condition: succeeded()
+
+  # Linux arm64 download, copy and archive
+
+  - task: DownloadBuildArtifacts@0
+    displayName: Download Linux Arm64 Artifacts
+    inputs:
+      artifactName: Linux_cross64_arm64_Release
+      downloadPath: '$(System.ArtifactsDirectory)'
+    condition: succeeded()
+
+  - task: CopyFiles@2
+    displayName: Copy Linux Arm64 Artifacts
+    inputs:
+      sourceFolder: '$(System.ArtifactsDirectory)/Linux_cross64_arm64_Release'
+      contents: ?(libsos.so|libsosplugin.so|sosdocsunix.txt)
+      targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Linux.arm64.Release'
+    condition: succeeded()
+
+  - task: CopyFiles@2
+    displayName: Copy Linux Arm64 Artifacts
+    inputs:
+      sourceFolder: '$(_SOSNETCorePath)'
+      contents: '*.dll'
+      overWrite: true
+      targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Linux.arm64.Release'
+
+    condition: succeeded()
   # MacOS download, copy and archive
 
   - task: DownloadBuildArtifacts@0
@@ -424,31 +523,9 @@ phases:
     inputs:
       publishLocation: Container
       pathtoPublish: '$(Build.SourcesDirectory)/artifacts/packages'
-      artifactName: packages
+      artifactName: Packages
     condition: succeeded()
 
-  # Optionally drop the artifacts on a share
-
-  - task: PublishBuildArtifacts@1
-    displayName: Drop Packages
-    inputs:
-      publishLocation: FilePath
-      pathtoPublish: '$(Build.SourcesDirectory)/artifacts/packages'
-      artifactName: _packages
-      targetPath: '$(DropRoot)\DotNetCore\$(Build.DefinitionName)\$(Build.BuildNumber)'
-    continueOnError: true
-    condition: eq(variables['DropPackages'], 'true')
-
-  - task: PublishBuildArtifacts@1
-    displayName: Drop Binaries
-    inputs:
-      publishLocation: FilePath
-      pathtoPublish: '$(Build.SourcesDirectory)/artifacts/bin'
-      artifactName: _bin
-      targetPath: '$(DropRoot)\DotNetCore\$(Build.DefinitionName)\$(Build.BuildNumber)'
-    continueOnError: true
-    condition: eq(variables['DropBinaries'], 'true')
-
   - task: PublishBuildArtifacts@1
     displayName: Publish Logs Artifacts
     inputs:
index c39471bf9854db52d9bf359dfd4a4f9663465b00..7a9adc4dc49ad8d726530f012a8fe291c1cfdade 100644 (file)
@@ -578,7 +578,6 @@ elseif (CLR_CMAKE_TARGET_ARCH_ARM)
     add_definitions(-D_ARM_WORKAROUND_)
   endif (CLR_CMAKE_PLATFORM_UNIX)
   add_definitions(-D_TARGET_ARM_=1)
-  add_definitions(-D_TARGET_WIN32_=1)
   add_definitions(-DDBG_TARGET_32BIT=1)
   add_definitions(-DDBG_TARGET_ARM=1)
 elseif (CLR_CMAKE_TARGET_ARCH_I386)
index 4e122113cea90106a155b1d07d6beb4cfa2e3948..74c963328d9a81d82f77b6c09b2e74ef7ebf8ea5 100644 (file)
@@ -8,6 +8,8 @@ Toolchain Setup
 
 The following instructions will install the required packages. This only needs to be done once per machine. These instructions assume that you already have "sudo" installed. It is also recommended to create a github fork of the diagnostics repo and cloning that instead of https://github.com/dotnet/diagnostics.git directly.
 
+To build or cross build for ARM on Windows or Linux see the instructions [here](https://github.com/mikem8361/coreclr/blob/master/Documentation/building/cross-building.md) in the coreclr repo.
+
 #### Ubuntu 14.04 ####
 
 In order to get clang-3.9, llvm-3.9 and lldb-3.9, we need to add additional package sources (see [http://llvm.org/apt/](http://llvm.org/apt/) for the other Ubuntu versions not listed here):
index 64c95ae15d7dea6f846cd724aad1b1ab15537a89..e3106244f22f35584f7c2155df05688a972cac0e 100644 (file)
@@ -11,13 +11,8 @@ You must install several components to build. These instructions were tested on
 ## Visual Studio
 
 Visual Studio must be installed. Supported versions:
-- [Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/) (Community, Professional, Enterprise).  The community version is completely free.  
 - [Visual Studio 2017](https://www.visualstudio.com/downloads/) (Community, Professional, Enterprise).  The community version is completely free.  
-
-For Visual Studio 2015:
-* Ensure you have installed at least [Visual Studio 2015 Update 3](https://www.visualstudio.com/en-us/news/releasenotes/vs2015-update3-vs).
-* Make sure that you install "VC++ Tools". By default, they will not be installed.
-* To build for Arm32, Make sure that you have the Windows SDK for Windows 10 installed (or selected to be installed as part of VS installation). To explicitly install Windows SDK, download it from here: [Windows SDK for Windows 10](https://developer.microsoft.com/en-us/windows/downloads)
+- [Visual Studio 2019 Preview](https://visualstudio.microsoft.com/vs/preview/) (Community, Professional, Enterprise).  The community version is completely free.  
 
 For Visual Studio 2017:
 * When doing a 'Workloads' based install, the following are the minimum requirements:
@@ -50,7 +45,6 @@ For Visual Studio 2017:
 * **Important:** You must have the `msdia120.dll` COM Library registered in order to build the repository.
   * This binary is registered by default when installing the "VC++ Tools" with Visual Studio 2015
   * You can also manually register the binary by launching the "Developer Command Prompt for VS2017" with Administrative privileges and running `regsvr32.exe "%VSINSTALLDIR%\Common7\IDE\msdia120.dll"`
-* **Important:** By default, the build will attempt to use VS2015 as the toolset for the build. To build using VS2017 as your toolset, you must use the "Developer Command Prompt for VS2017".
 
 Visual Studio Express is not supported.
 
index cd01d5177fd7c42e05ab8cdc3c1994c454eba735..70ea9ce1863be92f4ed0998576a6647989935c4c 100644 (file)
@@ -53,6 +53,8 @@ set __CI=0
 set __DailyTest=
 set __Verbosity=minimal
 set __TestArgs=
+set __BuildCrossArch=0
+set __CrossArch=
 
 :: Set the various build properties here so that CMake and MSBuild can pick them up
 set "__ProjectDir=%~dp0"
@@ -107,13 +109,13 @@ if [!processedArgs!] == [] (
 :: Determine if this is a cross-arch build
 
 if /i "%__BuildArch%" == "arm64" (
-    set __DoCrossArchBuild=1
-    set __CrossArch=x86
+    set __BuildCrossArch=%__Build%
+    set __CrossArch=x64
 )
 
 if /i "%__BuildArch%" == "arm" (
-    set __DoCrossArchBuild=1
-    set __CrossArch=x64
+    set __BuildCrossArch=%__Build%
+    set __CrossArch=x86
 )
 
 if /i "%__BuildType%" == "debug" set __BuildType=Debug
@@ -139,8 +141,6 @@ set "__PackagesBinDir=%__RootBinDir%\packages\%__BuildType%\Shipping"
 set "__CrossComponentBinDir=%__BinDir%"
 set "__CrossCompIntermediatesDir=%__IntermediatesDir%\crossgen"
 if NOT "%__CrossArch%" == "" set __CrossComponentBinDir=%__CrossComponentBinDir%\%__CrossArch%
-set "__CrossGenCoreLibLog=%__LogDir%\CrossgenCoreLib_%__BuildOS%_%__BuildArch%.log"
-set "__CrossgenExe=%__CrossComponentBinDir%\crossgen.exe"
 
 :: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
 set "__CMakeBinDir=%__BinDir%"
@@ -156,7 +156,7 @@ echo %__MsgPrefix%Commencing diagnostics repo build
 
 echo %__MsgPrefix%Checking prerequisites
 :: Eval the output from probe-win1.ps1
-for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__ProjectDir%\eng\probe-win.ps1"""') do %%a
+for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__ProjectDir%\eng\set-cmake-path.ps1"""') do %%a
 
 REM =========================================================================================
 REM ===
@@ -174,154 +174,145 @@ if not exist "%__DotNetCli%" (
 )
 
 set __DotNetRuntimeVersion=2.1.9
-
 REM =========================================================================================
 REM ===
-REM === Build the native code
+REM === Build Cross-Architecture Native Components (if applicable)
 REM ===
 REM =========================================================================================
 
-if %__Build% EQU 1 (
+if /i %__BuildCrossArch% EQU 1 (
     rem Scope environment changes start {
     setlocal
 
-    echo %__MsgPrefix%Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%
-
-    set __NativePlatformArgs=-platform=%__BuildArch%
-    if not "%__ToolsetDir%" == "" ( set __NativePlatformArgs=-useEnv )
-
-    if not "%__ToolsetDir%" == "" (
-        :: arm64 builds currently use private toolset which has not been released yet
-        :: TODO, remove once the toolset is open.
-        call :PrivateToolSet
-        goto GenVSSolution
-    )
+    echo %__MsgPrefix%Commencing build of cross architecture native components for %__BuildOS%.%__BuildArch%.%__BuildType%
 
     :: Set the environment for the native build
     set __VCBuildArch=x86_amd64
-    if /i "%__BuildArch%" == "x86" ( set __VCBuildArch=x86 )
-    if /i "%__BuildArch%" == "arm" (
-        set __VCBuildArch=x86_arm
-
-        :: Make CMake pick the highest installed version in the 10.0.* range
-        set ___SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"
-    )
-    if /i "%__BuildArch%" == "arm64" (
-        set __VCBuildArch=x86_arm64
-
-        REM Make CMake pick the highest installed version in the 10.0.* range
-        set ___SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"
-    )
+    if /i "%__CrossArch%" == "x86" ( set __VCBuildArch=x86 )
 
     echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch!
     call                                 "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch!
     @if defined _echo @echo on
 
-    if not defined VSINSTALLDIR (
-        echo %__MsgPrefix%Error: VSINSTALLDIR variable not defined.
-        exit /b 1
-    )
-    if not exist "!VSINSTALLDIR!DIA SDK" goto NoDIA
+    if not exist "%__CrossCompIntermediatesDir%" md "%__CrossCompIntermediatesDir%"
 
-:GenVSSolution
     echo Generating Version Header
     set __GenerateVersionLog="%__LogDir%\GenerateVersion.binlog"
-    "%__DotNetCli%" msbuild "%__ProjectDir%\eng\CreateVersionFile.csproj" /v:!__Verbosity! /bl:!__GenerateVersionLog! /t:GenerateVersionFiles /p:VersionPrefixFile=%__RootBinDir%\bin\VersionPrefix.txt /p:GenerateVersionHeader=true /p:NativeVersionHeaderFile=%__IntermediatesDir%\_version.h /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% %__UnprocessedBuildArgs%
+    "%__DotNetCli%" msbuild "%__ProjectDir%\eng\CreateVersionFile.csproj" /v:!__Verbosity! /bl:!__GenerateVersionLog! /t:GenerateVersionFiles /p:VersionPrefixFile=%__RootBinDir%\bin\VersionPrefix.txt /p:GenerateVersionHeader=true /p:NativeVersionHeaderFile=%__CrossCompIntermediatesDir%\_version.h /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% %__UnprocessedBuildArgs%
     if not !errorlevel! == 0 (
         echo Generate Version Header FAILED
         exit /b 1
     )
+    if defined __SkipConfigure goto SkipConfigureCrossBuild
 
-    if defined __SkipConfigure goto SkipConfigure
-
-    echo %__MsgPrefix%Regenerating the Visual Studio solution
+    set __CMakeBinDir=%__CrossComponentBinDir%
+    set "__CMakeBinDir=!__CMakeBinDir:\=/!"
 
     set "__ManagedBinaryDir=%__RootBinDir%\bin"
     set "__ManagedBinaryDir=!__ManagedBinaryDir:\=/!"
-    set __ExtraCmakeArgs=!___SDKVersion! "-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=!__BuildType!"
+    set __ExtraCmakeArgs="-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCMAKE_SYSTEM_VERSION=10.0"
 
-    pushd "%__IntermediatesDir%"
-    call "%__ProjectDir%\eng\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs!
+    pushd "%__CrossCompIntermediatesDir%"
+    call "%__ProjectDir%\eng\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs!
     @if defined _echo @echo on
     popd
 
-:SkipConfigure
-    if defined __ConfigureOnly goto SkipNativeBuild
-
-    if not exist "%__IntermediatesDir%\install.vcxproj" (
-        echo %__MsgPrefix%Error: failed to generate native component build project!
+:SkipConfigureCrossBuild
+    if not exist "%__CrossCompIntermediatesDir%\install.vcxproj" (
+        echo %__MsgPrefix%Error: failed to generate cross-arch components build project!
         exit /b 1
     )
-    set __BuildLog="%__LogDir%\Native.Build.binlog"
+    if defined __ConfigureOnly goto SkipCrossCompBuild
 
-    :: For some currently unknown reason, "%__DotNetCli% msbuild" fails because VCTargetsPath isn't defined.
-    msbuild.exe %__IntermediatesDir%\install.vcxproj /v:!__Verbosity! /bl:!__BuildLog! /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% %__UnprocessedBuildArgs%
+    set __BuildLog="%__LogDir%\Cross.Build.binlog"
+
+    :: MSBuild.exe is the only one that has the C++ targets. "%__DotNetCli% msbuild" fails because VCTargetsPath isn't defined.
+    msbuild.exe %__CrossCompIntermediatesDir%\install.vcxproj /v:!__Verbosity! /bl:!__BuildLog! /p:Configuration=%__BuildType% /p:Platform=%__CrossArch% %__UnprocessedBuildArgs%
 
     if not !ERRORLEVEL! == 0 (
-        echo %__MsgPrefix%Error: native component build failed. Refer to the build log files for details:
+        echo %__MsgPrefix%Error: cross-arch components build failed. Refer to the build log files for details:
         echo     !__BuildLog!
         exit /b 1
     )
 
-:SkipNativeBuild
+:SkipCrossCompBuild
     rem } Scope environment changes end
     endlocal
 )
 
 REM =========================================================================================
 REM ===
-REM === Build Cross-Architecture Native Components (if applicable)
+REM === Build the native code
 REM ===
 REM =========================================================================================
 
-if /i "%__DoCrossArchBuild%"=="1" (
+if %__Build% EQU 1 (
     rem Scope environment changes start {
     setlocal
 
-    echo %__MsgPrefix%Commencing build of cross architecture native components for %__BuildOS%.%__BuildArch%.%__BuildType%
+    echo %__MsgPrefix%Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%
 
-    :: Set the environment for the native build
     set __VCBuildArch=x86_amd64
-    if /i "%__CrossArch%" == "x86" ( set __VCBuildArch=x86 )
+    if /i "%__BuildArch%" == "x86" ( set __VCBuildArch=x86 )
+    if /i "%__BuildArch%" == "arm" (
+        set __VCBuildArch=x86_arm
+        :: Make CMake pick the highest installed version in the 10.0.* range
+        set ___SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"
+    )
+    if /i "%__BuildArch%" == "arm64" (
+        set __VCBuildArch=x86_arm64
+        :: Make CMake pick the highest installed version in the 10.0.* range
+        set ___SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"
+    )
 
     echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch!
     call                                 "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch!
     @if defined _echo @echo on
 
-    if not exist "%__CrossCompIntermediatesDir%" md "%__CrossCompIntermediatesDir%"
-    if defined __SkipConfigure goto SkipConfigureCrossBuild
+    if not defined VSINSTALLDIR (
+        echo %__MsgPrefix%Error: VSINSTALLDIR variable not defined.
+        exit /b 1
+    )
 
-    set __CMakeBinDir=%__CrossComponentBinDir%
-    set "__CMakeBinDir=!__CMakeBinDir:\=/!"
+    echo Generating Version Header
+    set __GenerateVersionLog="%__LogDir%\GenerateVersion.binlog"
+    "%__DotNetCli%" msbuild "%__ProjectDir%\eng\CreateVersionFile.csproj" /v:!__Verbosity! /bl:!__GenerateVersionLog! /t:GenerateVersionFiles /p:VersionPrefixFile=%__RootBinDir%\bin\VersionPrefix.txt /p:GenerateVersionHeader=true /p:NativeVersionHeaderFile=%__IntermediatesDir%\_version.h /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% %__UnprocessedBuildArgs%
+    if not !errorlevel! == 0 (
+        echo Generate Version Header FAILED
+        exit /b 1
+    )
+    if defined __SkipConfigure goto SkipConfigure
 
-    set "__ManagedBinaryDir=%__RootBinDir%\%__BuildType%\bin"
+    echo %__MsgPrefix%Regenerating the Visual Studio solution
+
+    set "__ManagedBinaryDir=%__RootBinDir%\bin"
     set "__ManagedBinaryDir=!__ManagedBinaryDir:\=/!"
-    set __ExtraCmakeArgs="-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=!__BuildType!" "-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCMAKE_SYSTEM_VERSION=10.0"
+    set __ExtraCmakeArgs=!___SDKVersion! "-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%"
 
-    pushd "%__CrossCompIntermediatesDir%"
-    call "%__ProjectDir%\eng\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs!
+    pushd "%__IntermediatesDir%"
+    call "%__ProjectDir%\eng\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs!
     @if defined _echo @echo on
     popd
 
-:SkipConfigureCrossBuild
-    if not exist "%__CrossCompIntermediatesDir%\install.vcxproj" (
-        echo %__MsgPrefix%Error: failed to generate cross-arch components build project!
+:SkipConfigure
+    if defined __ConfigureOnly goto SkipNativeBuild
+
+    if not exist "%__IntermediatesDir%\install.vcxproj" (
+        echo %__MsgPrefix%Error: failed to generate native component build project!
         exit /b 1
     )
-    if defined __ConfigureOnly goto SkipCrossCompBuild
-
-    set __BuildLog="%__LogDir%\Cross.Build.binlog"
+    set __BuildLog="%__LogDir%\Native.Build.binlog"
 
-    :: For some currently unknown reason, "%__DotNetCli% msbuild" fails because VCTargetsPath isn't defined.
-    msbuild.exe %__CrossCompIntermediatesDir%\install.vcxproj /v:!__Verbosity! /bl:!__BuildLog! /p:Configuration=%__BuildType% /p:Platform=%__CrossArch% %__UnprocessedBuildArgs%
+    :: MSBuild.exe is the only one that has the C++ targets. "%__DotNetCli% msbuild" fails because VCTargetsPath isn't defined.
+    msbuild.exe %__IntermediatesDir%\install.vcxproj /v:!__Verbosity! /bl:!__BuildLog! /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% %__UnprocessedBuildArgs%
 
     if not !ERRORLEVEL! == 0 (
-        echo %__MsgPrefix%Error: cross-arch components build failed. Refer to the build log files for details:
+        echo %__MsgPrefix%Error: native component build failed. Refer to the build log files for details:
         echo     !__BuildLog!
         exit /b 1
     )
 
-:SkipCrossCompBuild
+:SkipNativeBuild
     rem } Scope environment changes end
     endlocal
 )
@@ -342,6 +333,9 @@ REM ============================================================================
 echo %__MsgPrefix%Repo successfully built. Finished at %TIME%
 echo %__MsgPrefix%Product binaries are available at !__BinDir!
 
+if /i "%__BuildArch%" == "arm" goto Done
+if /i "%__BuildArch%" == "arm64" goto Done
+
 :: Test components
 if %__Test% EQU 1 (
     :: Install the other versions of .NET Core runtime we are going to test on
@@ -351,6 +345,8 @@ if %__Test% EQU 1 (
     powershell -ExecutionPolicy ByPass -NoProfile -command "& """%__ProjectDir%\eng\common\Build.ps1""" -test -configuration %__BuildType% -verbosity %__Verbosity% %__TestArgs%"
     exit /b !ERRORLEVEL!
 )
+
+:Done
 exit /b 0
 
 REM =========================================================================================
@@ -376,32 +372,3 @@ echo -architecture <x64|x86|arm|arm64>
 echo -configuration <debug|release>
 echo -verbosity <q[uiet]|m[inimal]|n[ormal]|d[etailed]|diag[nostic]>
 exit /b 1
-
-:PrivateToolSet
-
-echo %__MsgPrefix%Setting up the usage of __ToolsetDir:%__ToolsetDir%
-
-if /i "%__ToolsetDir%" == "" (
-    echo %__MsgPrefix%Error: A toolset directory is required for the Arm64 Windows build. Use the toolset_dir argument.
-    exit /b 1
-)
-
-if not exist "%__ToolsetDir%"\buildenv_arm64.cmd goto :Not_EWDK
-call "%__ToolsetDir%"\buildenv_arm64.cmd
-exit /b 0
-
-:Not_EWDK
-set PATH=%__ToolsetDir%\VC_sdk\bin;%PATH%
-set LIB=%__ToolsetDir%\VC_sdk\lib\arm64;%__ToolsetDir%\sdpublic\sdk\lib\arm64
-set INCLUDE=^
-%__ToolsetDir%\VC_sdk\inc;^
-%__ToolsetDir%\sdpublic\sdk\inc;^
-%__ToolsetDir%\sdpublic\shared\inc;^
-%__ToolsetDir%\sdpublic\shared\inc\minwin;^
-%__ToolsetDir%\sdpublic\sdk\inc\ucrt;^
-%__ToolsetDir%\sdpublic\sdk\inc\minwin;^
-%__ToolsetDir%\sdpublic\sdk\inc\mincore;^
-%__ToolsetDir%\sdpublic\sdk\inc\abi;^
-%__ToolsetDir%\sdpublic\sdk\inc\clientcore;^
-%__ToolsetDir%\diasdk\include
-exit /b 0
index 3523cb0b5c1d593c0b8481b2042355663debe313..b3ecbb3557eb1e4486bec7966946f4722cae5aeb 100644 (file)
@@ -8,6 +8,7 @@
             <Files>
                 <File Architecture="amd64" Module="x64\sos.dll" />
                 <File Architecture="x86"   Module="x86\sos.dll" />
+                <File Architecture="arm"   Module="arm\sos.dll" />
             </Files>
             <LoadTriggers>
                 <TriggerSet>
index 89fd4043099875635aca1543a14e9999bab9d889..ae80c2f2e2b6ca183e6a110e30964c1329a5174d 100644 (file)
@@ -3,7 +3,7 @@
   <PropertyGroup>
     <RepositoryUrl>https://github.com/dotnet/diagnostics</RepositoryUrl>
     <PreReleaseVersionLabel>preview6</PreReleaseVersionLabel>
-    <VersionPrefix>1.0.3</VersionPrefix>
+    <VersionPrefix>1.0.4</VersionPrefix>
     <DotNetUseShippingVersions>true</DotNetUseShippingVersions>
   </PropertyGroup>
 
index 68082d46fc236120f6fcc51fe3763a35b3268148..19f45a3686db0adc66991a569249abadc099994c 100755 (executable)
@@ -43,15 +43,14 @@ usage()
     echo "--daily-test - test native components for daily build job"
     echo "--architecture <x64|x86|arm|armel|arm64>"
     echo "--configuration <debug|release>"
+    echo "--rootfs <ROOTFS_DIR>"
     echo "--clangx.y - optional argument to build using clang version x.y"
-    echo "--cross - optional argument to enable cross architecture building"
     echo "--ci - CI lab build"
     echo "--verbosity <q[uiet]|m[inimal]|n[ormal]|d[etailed]|diag[nostic]>"
     echo "--help - this help message"
     exit 1
 }
 
-
 # args:
 # input - $1
 to_lowercase() {
@@ -196,6 +195,11 @@ while :; do
             shift
             ;;
 
+        --rootfs)
+            export ROOTFS_DIR="$2"
+            shift
+            ;;
+
         --portablebuild=false)
             __PortableBuild=0
             ;;
@@ -235,10 +239,6 @@ while :; do
             __ClangMinorVersion=0
             ;;
 
-        --cross)
-            __CrossBuild=true
-            ;;
-
         # Ignored for a native build
         --build|--rebuild|--sign|--restore|--pack|--publish|--preparemachine|--projects|--solution)
             ;;
@@ -305,11 +305,14 @@ if [[ "$__BuildArch" == "armel" ]]; then
 fi
 
 # Configure environment if we are doing a cross compile.
-if [ "$__CrossBuild" == true ]; then
+if [ "${__BuildArch}" != "${__HostArch}" ]; then
+    __CrossBuild=true
     export CROSSCOMPILE=1
     if ! [[ -n "$ROOTFS_DIR" ]]; then
-        export ROOTFS_DIR="$__ProjectRoot/cross/rootfs/$__BuildArch"
+        echo "ERROR: ROOTFS_DIR not set for cross build"
+        exit 1
     fi
+    echo "ROOTFS_DIR: $ROOTFS_DIR"
 fi
 
 mkdir -p "$__IntermediatesDir"
@@ -328,10 +331,11 @@ build_native()
     generator=""
     buildFile="Makefile"
     buildTool="make"
+    scriptDir="$__ProjectRoot/eng"
 
     pushd "$intermediatesForBuild"
-    echo "Invoking \"$__ProjectRoot/eng/gen-buildsys-clang.sh\" \"$__ProjectRoot\" $__ClangMajorVersion $__ClangMinorVersion $platformArch $__BuildType $generator $extraCmakeArguments $__cmakeargs"
-    "$__ProjectRoot/eng/gen-buildsys-clang.sh" "$__ProjectRoot" $__ClangMajorVersion $__ClangMinorVersion $platformArch $__BuildType $generator "$extraCmakeArguments" "$__cmakeargs"
+    echo "Invoking \"$scriptDir/gen-buildsys-clang.sh\" \"$__ProjectRoot\" $__ClangMajorVersion \"$__ClangMinorVersion\" $platformArch "$scriptDir" $__BuildType $generator $extraCmakeArguments $__cmakeargs"
+    "$scriptDir/gen-buildsys-clang.sh" "$__ProjectRoot" $__ClangMajorVersion "$__ClangMinorVersion" $platformArch "$scriptDir" $__BuildType $generator "$extraCmakeArguments" "$__cmakeargs"
     popd
 
     if [ ! -f "$intermediatesForBuild/$buildFile" ]; then
@@ -360,11 +364,8 @@ initTargetDistroRid()
     local passedRootfsDir=""
 
     # Only pass ROOTFS_DIR if cross is specified.
-    if (( ${__CrossBuild} == 1 )); then
+    if [ "$__CrossBuild" == true ]; then
         passedRootfsDir=${ROOTFS_DIR}
-    elif [ "${__BuildArch}" != "${__HostArch}" ]; then
-        echo "Error, you are building a cross scenario without passing -cross."
-        exit 1
     fi
 
     initDistroRidGlobal ${__BuildOS} ${__BuildArch} ${__PortableBuild} ${passedRootfsDir}
@@ -437,51 +438,54 @@ fi
 
 # Run SOS/lldbplugin tests
 if [ $__Test == true ]; then
-    # Install the other versions of .NET Core runtime we are going to test on
-    "$__ProjectRoot/eng/install-test-runtimes.sh" --dotnet-directory "$__ProjectRoot/.dotnet" --runtime-version-21 "$__DotNetRuntimeVersion" --temp-directory "$__IntermediatesDir" --architecture "$__BuildArch" $__DailyTest
-
-    if [ "$LLDB_PATH" = "" ]; then
-        export LLDB_PATH="$(which lldb-3.9.1 2> /dev/null)"
-        if [ "$LLDB_PATH" = "" ]; then
-            export LLDB_PATH="$(which lldb-3.9 2> /dev/null)"
-            if [ "$LLDB_PATH" = "" ]; then
-                export LLDB_PATH="$(which lldb-4.0 2> /dev/null)"
-                if [ "$LLDB_PATH" = "" ]; then
-                    export LLDB_PATH="$(which lldb-5.0 2> /dev/null)"
-                    if [ "$LLDB_PATH" = "" ]; then
-                        export LLDB_PATH="$(which lldb 2> /dev/null)"
-                    fi
-                fi
-            fi
-        fi
-    fi
-
-    if [ "$GDB_PATH" = "" ]; then
-        export GDB_PATH="$(which gdb 2> /dev/null)"
-    fi
-
-    echo "lldb: '$LLDB_PATH' gdb: '$GDB_PATH'"
-
-    # Run xunit SOS tests
-    "$__ProjectRoot/eng/common/build.sh" --test --configuration "$__BuildType" "$__TestArgs"
-    if [ $? != 0 ]; then
-        exit 1
-    fi
-
-    # Skip Alpine because lldb doesn't work
-    if [ $__Alpine == false ]; then
-        if [ "$__BuildOS" == "OSX" ]; then
-            __Plugin=$__CMakeBinDir/libsosplugin.dylib
-        else
-            __Plugin=$__CMakeBinDir/libsosplugin.so
-        fi
-
-        # Run lldb python tests
-        "$__ProjectRoot/src/SOS/lldbplugin.tests/testsos.sh" "$__ProjectRoot" "$__Plugin" "$__DotNetRuntimeVersion" "$__RootBinDir/bin/TestDebuggee/$__BuildType/netcoreapp2.0/TestDebuggee.dll" "$__ResultsDir"
-        if [ $? != 0 ]; then
-            exit 1
-        fi
-    fi
+   if [[ "$__BuildArch" != "arm" && "$__BuildArch" != "armel" && "$__BuildArch" != "arm64" ]]; then
+
+      # Install the other versions of .NET Core runtime we are going to test on
+      "$__ProjectRoot/eng/install-test-runtimes.sh" --dotnet-directory "$__ProjectRoot/.dotnet" --runtime-version-21 "$__DotNetRuntimeVersion" --temp-directory "$__IntermediatesDir" --architecture "$__BuildArch" $__DailyTest
+
+      if [ "$LLDB_PATH" == "" ]; then
+          export LLDB_PATH="$(which lldb-3.9.1 2> /dev/null)"
+          if [ "$LLDB_PATH" == "" ]; then
+              export LLDB_PATH="$(which lldb-3.9 2> /dev/null)"
+              if [ "$LLDB_PATH" == "" ]; then
+                  export LLDB_PATH="$(which lldb-4.0 2> /dev/null)"
+                  if [ "$LLDB_PATH" == "" ]; then
+                      export LLDB_PATH="$(which lldb-5.0 2> /dev/null)"
+                      if [ "$LLDB_PATH" == "" ]; then
+                          export LLDB_PATH="$(which lldb 2> /dev/null)"
+                      fi
+                  fi
+              fi
+          fi
+      fi
+
+      if [ "$GDB_PATH" == "" ]; then
+          export GDB_PATH="$(which gdb 2> /dev/null)"
+      fi
+
+      echo "lldb: '$LLDB_PATH' gdb: '$GDB_PATH'"
+
+      # Run xunit SOS tests
+      "$__ProjectRoot/eng/common/build.sh" --test --configuration "$__BuildType" "$__TestArgs"
+      if [ $? != 0 ]; then
+          exit 1
+      fi
+
+      # Skip Alpine because lldb doesn't work
+      if [ $__Alpine == false ]; then
+          if [ "$__BuildOS" == "OSX" ]; then
+              __Plugin=$__CMakeBinDir/libsosplugin.dylib
+          else
+              __Plugin=$__CMakeBinDir/libsosplugin.so
+          fi
+
+          # Run lldb python tests
+          "$__ProjectRoot/src/SOS/lldbplugin.tests/testsos.sh" "$__ProjectRoot" "$__Plugin" "$__DotNetRuntimeVersion" "$__RootBinDir/bin/TestDebuggee/$__BuildType/netcoreapp2.0/TestDebuggee.dll" "$__ResultsDir"
+          if [ $? != 0 ]; then
+              exit 1
+          fi
+      fi
+   fi
 fi
 
 echo "BUILD: Repo sucessfully built."
index 2590c2cbd37641a980ee76dbf179726d777b3de4..b3e56720db530b66d731f48d069c97b404282ec4 100755 (executable)
@@ -16,17 +16,49 @@ done
 
 scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
 
-# remove the options that build.sh can't handle and pass it to build-native.sh
-__args="$(echo $@ | sed 's/--build-native//g;s/--daily-test//g;s/--test//g;s/--clang[0-9]\.[0-9]//g;s/--cross//g')"
+# args:
+# input - $1
+function ToLowerCase() {
+    echo "$1" | tr '[:upper:]' '[:lower:]'
+    return 0
+}
+
+buildargs=
+buildnativeargs=$@
+
+# Parse command line options
+while :; do
+    if [ $# -le 0 ]; then
+        break
+    fi
+    lowerI="$(ToLowerCase "$1")"
+    case $lowerI in
+        --architecture)
+            shift
+            ;;
+        --rootfs)
+            shift
+            ;;
+        --build-native|--test|--daily-test)
+            ;;
+        --clang3.5|--clang3.6|--clang3.7|--clang3.8|--clang3.9|--clang4.0|--clang5.0)
+            ;;
+        *)
+            buildargs="$buildargs $1"
+            ;;
+    esac
+
+    shift
+done
 
 # build managed components
-"$scriptroot/common/build.sh" $__args
+"$scriptroot/common/build.sh" $buildargs
 if [[ $? != 0 ]]; then
     exit 1
 fi
 
 # build native components and test both
-"$scriptroot/build-native.sh" $@
+"$scriptroot/build-native.sh" $buildnativeargs
 if [[ $? != 0 ]]; then
     exit 1
 fi
index b13687e165733b492d86bff7b1554d40e5cb8215..211415cf53dccb47cd361292255a90d77725dd2e 100644 (file)
@@ -12,6 +12,7 @@ parameters:
   name: ''
   agentOs: Windows_NT
   dockerImage: ''
+  crossrootfsDir: ''
   testOnly: false
   dependsOn: ''
   # send telemetry
@@ -34,9 +35,7 @@ phases:
 - template: /eng/common/templates/phases/base.yml
   parameters:
     enableTelemetry: ${{ parameters.enableTelemetry }}
-
     enableMicrobuild: ${{ parameters.enableMicrobuild }}
-
     name: ${{ parameters.name }}
     agentOs: ${{ parameters.agentOs }}
     dependsOn: ${{ parameters.dependsOn }}
@@ -49,16 +48,18 @@ phases:
       _PhaseName : ${{ parameters.name }}
       _HelixType: build/product
       _HelixBuildConfig: $(_BuildConfig)
+
       # Only enable publishing in non-public, non PR scenarios.
       ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
         _HelixSource: official/dotnet/arcade/$(Build.SourceBranch)
-      # else
       ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
         _HelixSource: pr/dotnet/arcade/$(Build.SourceBranch)
+
       ${{ if eq(parameters.testOnly, 'true') }}:
         _LinuxScript: $(Build.SourcesDirectory)/eng/citest.sh
       ${{ if ne(parameters.testOnly, 'true') }}:
         _LinuxScript: $(Build.SourcesDirectory)/eng/cibuild.sh
+
       ${{ if eq(variables['Build.Reason'], 'Schedule') }}:
         ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
           _DailyTest: -daily-test
@@ -67,6 +68,12 @@ phases:
       ${{ if ne(variables['Build.Reason'], 'Schedule') }}:
         _DailyTest: ''
 
+      ${{ if eq(parameters.crossrootfsDir, '') }}:
+        _RootFs: ''
+      # This is only required for cross builds.
+      ${{ if ne(parameters.crossrootfsDir, '') }}:
+        _RootFs: --rootfs ${{ parameters.crossrootfsDir }}
+
     steps:
     - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
         - task: AzureKeyVault@1
@@ -108,7 +115,7 @@ phases:
           --docker-image $(_DockerImageName)
           --source-directory $(Build.SourcesDirectory)
           --container-name diagnostics-$(Build.BuildId)
-          $(_LinuxScript) $(_DailyTest)
+          $(_LinuxScript) $(_DailyTest) $(_RootFs)
           --configuration $(_BuildConfig) 
           --architecture $(_BuildArch)
           --prepareMachine 
index 928902094c81c135124ea96d892518b42840416a..2906803cdcd31bdeaacc90363afb22835c669739 100644 (file)
@@ -110,6 +110,13 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
 function InstallDotNetSdk([string] $dotnetRoot, [string] $version) {
   $installScript = GetDotNetInstallScript $dotnetRoot
   
+  if ($architecture -eq "arm") {
+    $architecture="x86"
+  }
+  if ($architecture -eq "arm64") {
+    $architecture="x64"
+  }
+
   & $installScript -Version $version -InstallDir $dotnetRoot -Architecture $architecture
   if ($lastExitCode -ne 0) {
     Write-Host "Failed to install dotnet cli (exit code '$lastExitCode')." -ForegroundColor Red
index 8872980e17e02f0a620868ec98edc479a3dedca3..37904d38690347875a596e9820a99c7bc878066f 100755 (executable)
@@ -26,7 +26,6 @@ ci=false
 
 projects=''
 configuration='Debug'
-architecture='<auto>'
 prepare_machine=false
 verbosity='minimal'
 properties=''
@@ -46,14 +45,9 @@ while (($# > 0)); do
       configuration=$2
       shift 2
       ;;
-    --architecture)
-      architecture=$2
-      shift 2
-      ;;
     --help)
       echo "Common settings:"
       echo "  --configuration <value>  Build configuration Debug, Release"
-      echo "  --architecture <value>   Build architecture x64, x86, arm, arm64"
       echo "  --verbosity <value>      Msbuild verbosity (q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic])"
       echo "  --help                   Print help and exit"
       echo ""
@@ -182,7 +176,7 @@ function InitializeDotNetCli {
     export DOTNET_INSTALL_DIR="$dotnet_root"
 
     if [[ "$restore" == true ]]; then
-      InstallDotNetSdk $dotnet_root $dotnet_sdk_version $architecture
+      InstallDotNetSdk $dotnet_root $dotnet_sdk_version
     fi
   fi
 
@@ -192,11 +186,10 @@ function InitializeDotNetCli {
 function InstallDotNetSdk {
   local root=$1
   local version=$2
-  local arch=$3
 
   local install_script=`GetDotNetInstallScript $root`
 
-  bash "$install_script" --version $version --install-dir $root --architecture $arch
+  bash "$install_script" --version $version --install-dir $root
   local lastexitcode=$?
 
   if [[ $lastexitcode != 0 ]]; then
index 352dc7f0e044b00b37cbaf5cdb426c182867a406..6d24d5d306c0dd412accade89672e869dddeb476 100644 (file)
@@ -17,12 +17,15 @@ $ZipFile = Join-Path -Path $ZipFilePath "$SOSGalleryVersion.zip"
 
 mkdir -Force "$GalleryDir\x64"
 mkdir -Force "$GalleryDir\x86"
+mkdir -Force "$GalleryDir\arm"
 mkdir -Force "$ZipFilePath"
 
 Copy-Item $BinDir\Windows_NT.x64.Release\sos.dll $GalleryDir\x64
 Copy-Item $SOSNETCorePath\*.dll $GalleryDir\x64
 Copy-Item $BinDir\Windows_NT.x86.Release\sos.dll $GalleryDir\x86
 Copy-Item $SOSNETCorePath\*.dll $GalleryDir\x86
+Copy-Item $BinDir\Windows_NT.arm.Release\sos.dll $GalleryDir\arm
+Copy-Item $SOSNETCorePath\*.dll $GalleryDir\arm
 cat $SourceDirectory\eng\GalleryManifest.xml | %{$_ -replace "X.X.X.X","$SOSGalleryVersion"} | Set-Content $BinDir\gallery\GalleryManifest.xml
 
 if (Test-Path $ZipFile) { rm "$ZipFile" }
index d0eb5c1431374372fa914c258ca30a1254875036..1cbe075113ef8abe7fcae1146866f6ceb335749f 100755 (executable)
@@ -60,7 +60,6 @@ echo "container user name: $container_user_name"
 $docker_bin exec $docker_id useradd -K MAIL_DIR=/dev/null -m -u $user_id $container_user_name
 $docker_bin exec $docker_id groupadd sudouser
 $docker_bin exec $docker_id usermod -a -G sudouser $container_user_name
-$docker_bin exec $docker_id su -c "$source_directory/eng/docker-init.sh"
 $docker_bin exec $docker_id su -c "echo '%sudouser ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers"
 
 echo "Execute $args"
diff --git a/eng/docker-init.sh b/eng/docker-init.sh
deleted file mode 100755 (executable)
index 2be3f6e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Install sudo on ubuntu 18.04
-os_name=$(uname -s)
-if [ "$os_name" == "Linux" ]; then
-    if [ -e /etc/os-release ]; then
-        source /etc/os-release
-        if [[ $ID == "ubuntu" ]]; then
-            if [[ $VERSION_ID == "18.04" ]]; then
-                apt-get update
-                apt-get install sudo
-            fi
-        fi
-    fi
-fi
index e0f84031152d403ab268994cd352fc2e48ea269d..7c2158587cc445e4f23ef3abbc55472d1b500acf 100755 (executable)
@@ -1,20 +1,19 @@
 #!/usr/bin/env bash
-# Copyright (c) .NET Foundation and contributors. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
 #
 # This file invokes cmake and generates the build system for Clang.
 #
 
-if [ $# -lt 4 ]
+if [ $# -lt 5 ]
 then
   echo "Usage..."
-  echo "gen-buildsys-clang.sh <path to top level CMakeLists.txt> <ClangMajorVersion> <ClangMinorVersion> <Architecture> [build flavor] [coverage] [ninja] [cmakeargs]"
+  echo "gen-buildsys-clang.sh <path to top level CMakeLists.txt> <ClangMajorVersion> <ClangMinorVersion> <Architecture> <ScriptDirectory> [build flavor] [coverage] [ninja] [scan-build] [cmakeargs]"
   echo "Specify the path to the top level CMake file - <ProjectK>/src/NDP"
   echo "Specify the clang version to use, split into major and minor version"
-  echo "Specify the target architecture." 
+  echo "Specify the target architecture."
+  echo "Specify the script directory."
   echo "Optionally specify the build configuration (flavor.) Defaults to DEBUG." 
   echo "Optionally specify 'coverage' to enable code coverage build."
+  echo "Optionally specify 'scan-build' to enable build with clang static analyzer."
   echo "Target ninja instead of make. ninja must be on the PATH."
   echo "Pass additional arguments to CMake call."
   exit 1
@@ -23,37 +22,51 @@ fi
 # Set up the environment to be used for building with clang.
 if command -v "clang-$2.$3" > /dev/null
     then
-        export CC="$(command -v clang-$2.$3)"
-        export CXX="$(command -v clang++-$2.$3)"
+        desired_llvm_version="-$2.$3"
 elif command -v "clang$2$3" > /dev/null
     then
-        export CC="$(command -v clang$2$3)"
-        export CXX="$(command -v clang++$2$3)"
+        desired_llvm_version="$2$3"
+elif command -v "clang-$2$3" > /dev/null
+    then
+        desired_llvm_version="-$2$3"
 elif command -v clang > /dev/null
     then
-        export CC="$(command -v clang)"
-        export CXX="$(command -v clang++)"
+        desired_llvm_version=
 else
     echo "Unable to find Clang Compiler"
     exit 1
 fi
 
+export CC="$(command -v clang$desired_llvm_version)"
+export CXX="$(command -v clang++$desired_llvm_version)"
+
 build_arch="$4"
+script_dir="$5"
 buildtype=DEBUG
+code_coverage=OFF
 build_tests=OFF
+scan_build=OFF
 generator="Unix Makefiles"
 __UnprocessedCMakeArgs=""
 
-for i in "${@:5}"; do
+for i in "${@:6}"; do
     upperI="$(echo $i | awk '{print toupper($0)}')"
     case $upperI in
       # Possible build types are DEBUG, CHECKED, RELEASE, RELWITHDEBINFO, MINSIZEREL.
       DEBUG | CHECKED | RELEASE | RELWITHDEBINFO | MINSIZEREL)
       buildtype=$upperI
       ;;
+      COVERAGE)
+      echo "Code coverage is turned on for this build."
+      code_coverage=ON
+      ;;
       NINJA)
       generator=Ninja
       ;;
+      SCAN-BUILD)
+      echo "Static analysis is turned on for this build."
+      scan_build=ON
+      ;;
       *)
       __UnprocessedCMakeArgs="${__UnprocessedCMakeArgs}${__UnprocessedCMakeArgs:+ }$i"
     esac
@@ -77,19 +90,6 @@ else
   exit 1
 fi
 
-desired_llvm_major_version=$2
-desired_llvm_minor_version=$3
-if [ $OS = "FreeBSD" ]; then
-    desired_llvm_version="$desired_llvm_major_version$desired_llvm_minor_version"
-elif [ $OS = "OpenBSD" ]; then
-    desired_llvm_version=""
-elif [ $OS = "NetBSD" ]; then
-    desired_llvm_version=""
-elif [ $OS = "SunOS" ]; then
-    desired_llvm_version=""
-else
-  desired_llvm_version="-$desired_llvm_major_version.$desired_llvm_minor_version"
-fi
 locate_llvm_exec() {
   if command -v "$llvm_prefix$1$desired_llvm_version" > /dev/null 2>&1
   then
@@ -114,8 +114,11 @@ if [ $OS = "Linux" -o $OS = "FreeBSD" -o $OS = "OpenBSD" -o $OS = "NetBSD" -o $O
 fi
 
 cmake_extra_defines=
-if [[ -n "$CROSSCOMPONENT" ]]; then
-    cmake_extra_defines="$cmake_extra_defines -DCLR_CROSS_COMPONENTS_BUILD=1"
+if [[ -n "$LLDB_LIB_DIR" ]]; then
+    cmake_extra_defines="$cmake_extra_defines -DWITH_LLDB_LIBS=$LLDB_LIB_DIR"
+fi
+if [[ -n "$LLDB_INCLUDE_DIR" ]]; then
+    cmake_extra_defines="$cmake_extra_defines -DWITH_LLDB_INCLUDES=$LLDB_INCLUDE_DIR"
 fi
 if [ "$CROSSCOMPILE" == "1" ]; then
     if ! [[ -n "$ROOTFS_DIR" ]]; then
@@ -154,15 +157,28 @@ else
     overridefile=clang-compiler-override.txt
 fi
 
-cmake \
+__currentScriptDir="$script_dir"
+
+cmake_command=cmake
+
+if [[ "$scan_build" == "ON" ]]; then
+    export CCC_CC=$CC
+    export CCC_CXX=$CXX
+    export SCAN_BUILD_COMMAND=$(command -v scan-build$desired_llvm_version)
+    cmake_command="$SCAN_BUILD_COMMAND $cmake_command"
+fi
+
+$cmake_command \
   -G "$generator" \
-  "-DCMAKE_USER_MAKE_RULES_OVERRIDE=$1/eng/$overridefile" \
+  "-DCMAKE_USER_MAKE_RULES_OVERRIDE=${__currentScriptDir}/$overridefile" \
   "-DCMAKE_AR=$llvm_ar" \
   "-DCMAKE_LINKER=$llvm_link" \
   "-DCMAKE_NM=$llvm_nm" \
   "-DCMAKE_OBJDUMP=$llvm_objdump" \
   "-DCMAKE_BUILD_TYPE=$buildtype" \
   "-DCMAKE_EXPORT_COMPILE_COMMANDS=1 " \
+  "-DCLR_CMAKE_ENABLE_CODE_COVERAGE=$code_coverage" \
+  "-DCLR_CMAKE_COMPILER=Clang" \
   $cmake_extra_defines \
   $__UnprocessedCMakeArgs \
   "$1"
index 75ef9b94adccd0909406c1339243e22d0d754a59..a3df018d065e8d85c478e4eaf62a6a8a6632d3a7 100644 (file)
@@ -41,11 +41,11 @@ goto loop
 
 if defined CMakePath goto DoGen
 
-:: Eval the output from probe-win.ps1
-for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& "%basePath%\probe-win.ps1""') do %%a
+:: Eval the output from set-cmake-path.ps1
+for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& "%basePath%\set-cmake-path.ps1""') do %%a
 
 :DoGen
-"%CMakePath%" "-DCMAKE_USER_MAKE_RULES_OVERRIDE=%basePath%\windows-compiler-override.txt" "-DCMAKE_INSTALL_PREFIX:PATH=$ENV{__CMakeBinDir}" "-DCLR_CMAKE_HOST_ARCH=%__Arch%" %__ExtraCmakeParams% -G "%__CmakeGenerator%" %__SourceDir%
+"%CMakePath%" "-DCMAKE_USER_MAKE_RULES_OVERRIDE=%basePath%\windows-compiler-override.txt" "-DCMAKE_INSTALL_PREFIX=%__CMakeBinDir%" "-DCLR_CMAKE_HOST_ARCH=%__Arch%" %__ExtraCmakeParams% -G "%__CmakeGenerator%" %__SourceDir%
 endlocal
 GOTO :DONE
 
index 2f8215ffea80dceb8ad5040d6c5639eeecddacf5..bc38ed90bc711bb7c4ab4855570382301948381c 100755 (executable)
@@ -169,12 +169,8 @@ initDistroRidGlobal()
 
     if [ -z "$__DistroRid" ]; then
         echo "DistroRid is not set. This is almost certainly an error"
-
         exit 1
     else
-        echo "__DistroRid: ${__DistroRid}"
-        echo "__RuntimeId: ${__DistroRid}"
-        
         export __RuntimeId=${__DistroRid}
     fi
 }
diff --git a/eng/probe-win.ps1 b/eng/probe-win.ps1
deleted file mode 100644 (file)
index fa30d9c..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# This file probes for the prerequisites for the build system, and outputs commands for eval'ing
-# from the cmd scripts to set variables (and exit on error)
-
-function GetCMakeVersions
-{
-  $items = @()
-  $items += @(Get-ChildItem hklm:\SOFTWARE\Wow6432Node\Kitware -ErrorAction SilentlyContinue)
-  $items += @(Get-ChildItem hklm:\SOFTWARE\Kitware -ErrorAction SilentlyContinue)
-  return $items | where { $_.PSChildName.StartsWith("CMake") }
-}
-
-function GetCMakeInfo($regKey)
-{
-  try {
-    $version = [System.Version] $regKey.PSChildName.Split(' ')[1]
-  }
-  catch {
-    return $null
-  }
-  $itemProperty = Get-ItemProperty $regKey.PSPath;
-  if (Get-Member -inputobject $itemProperty -name "InstallDir" -Membertype Properties) {
-    $cmakeDir = $itemProperty.InstallDir
-  }
-  else {
-    $cmakeDir = $itemProperty.'(default)'
-  }
-  $cmakePath = [System.IO.Path]::Combine($cmakeDir, "bin\cmake.exe")
-  if (![System.IO.File]::Exists($cmakePath)) {
-    return $null
-  }
-  return @{'version' = $version; 'path' = $cmakePath}
-}
-
-function LocateCMake
-{
-  $errorMsg = "CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from http://www.cmake.org/download/ and ensure it is on your path."
-  $inPathPath = (get-command cmake.exe -ErrorAction SilentlyContinue)
-  if ($inPathPath -ne $null) {
-    # Resolve the first version of CMake if multiple commands are found
-    if ($inPathPath.Length -gt 1) {
-      return $inPathPath[0].Path
-    }
-    return $inPathPath.Path
-  }
-  # Let us hope that CMake keep using their current version scheme
-  $validVersions = @()
-  foreach ($regKey in GetCMakeVersions) {
-    $info = GetCMakeInfo($regKey)
-    if ($info -ne $null) { 
-      $validVersions += @($info)
-    }
-  }
-  $newestCMakePath = ($validVersions |
-    Sort-Object -property @{Expression={$_.version}; Ascending=$false} |
-    select -first 1).path
-  if ($newestCMakePath -eq $null) {
-    Throw $errorMsg
-  }
-  return $newestCMakePath
-}
-
-try {
-  $cmakePath = LocateCMake
-  [System.Console]::WriteLine("set CMakePath=" + $cmakePath)
-
-}
-catch {
-  [System.Console]::Error.WriteLine($_.Exception.Message)
-  [System.Console]::WriteLine("exit /b 1")
-}
diff --git a/eng/set-cmake-path.ps1 b/eng/set-cmake-path.ps1
new file mode 100644 (file)
index 0000000..5fc499a
--- /dev/null
@@ -0,0 +1,70 @@
+# This file probes for the prerequisites for the build system, and outputs commands for eval'ing
+# from the cmd scripts to set variables (and exit on error)
+
+function GetCMakeVersions
+{
+  $items = @()
+  $items += @(Get-ChildItem hklm:\SOFTWARE\Wow6432Node\Kitware -ErrorAction SilentlyContinue)
+  $items += @(Get-ChildItem hklm:\SOFTWARE\Kitware -ErrorAction SilentlyContinue)
+  return $items | where { $_.PSChildName.StartsWith("CMake") }
+}
+
+function GetCMakeInfo($regKey)
+{
+  try {
+    $version = [System.Version] $regKey.PSChildName.Split(' ')[1]
+  }
+  catch {
+    return $null
+  }
+  $itemProperty = Get-ItemProperty $regKey.PSPath;
+  if (Get-Member -inputobject $itemProperty -name "InstallDir" -Membertype Properties) {
+    $cmakeDir = $itemProperty.InstallDir
+  }
+  else {
+    $cmakeDir = $itemProperty.'(default)'
+  }
+  $cmakePath = [System.IO.Path]::Combine($cmakeDir, "bin\cmake.exe")
+  if (![System.IO.File]::Exists($cmakePath)) {
+    return $null
+  }
+  return @{'version' = $version; 'path' = $cmakePath}
+}
+
+function LocateCMake
+{
+  $errorMsg = "CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from http://www.cmake.org/download/ and ensure it is on your path."
+  $inPathPath = (get-command cmake.exe -ErrorAction SilentlyContinue)
+  if ($inPathPath -ne $null) {
+    # Resolve the first version of CMake if multiple commands are found
+    if ($inPathPath.Length -gt 1) {
+      return $inPathPath[0].Path
+    }
+    return $inPathPath.Path
+  }
+  # Let us hope that CMake keep using their current version scheme
+  $validVersions = @()
+  foreach ($regKey in GetCMakeVersions) {
+    $info = GetCMakeInfo($regKey)
+    if ($info -ne $null) {
+      $validVersions += @($info)
+    }
+  }
+  $newestCMakePath = ($validVersions |
+    Sort-Object -property @{Expression={$_.version}; Ascending=$false} |
+    select -first 1).path
+  if ($newestCMakePath -eq $null) {
+    Throw $errorMsg
+  }
+  return $newestCMakePath
+}
+
+try {
+  $cmakePath = LocateCMake
+  [System.Console]::WriteLine("set CMakePath=" + $cmakePath)
+
+}
+catch {
+  [System.Console]::Error.WriteLine($_.Exception.Message)
+  [System.Console]::WriteLine("exit /b 1")
+}
index 17ce8cacbaa2e436f266ae921eb70d246e42071f..2e031cf9de41c09da3cb530bc172a0c446a8b12a 100644 (file)
@@ -14,21 +14,33 @@ if (CORECLR_SET_RPATH)
 endif (CORECLR_SET_RPATH)
 
 if(CLR_CMAKE_PLATFORM_ARCH_AMD64)
-  add_definitions(-D_TARGET_WIN64_=1)
   add_definitions(-DSOS_TARGET_AMD64=1)
+  add_definitions(-D_TARGET_WIN64_=1)
+  add_definitions(-DDBG_TARGET_64BIT)
+  add_definitions(-DDBG_TARGET_WIN64=1)
   if(WIN32)
     add_definitions(-DSOS_TARGET_ARM64=1)
   endif(WIN32)
+  remove_definitions(-D_TARGET_ARM64_=1)
+  add_definitions(-D_TARGET_AMD64_)
+  add_definitions(-DDBG_TARGET_AMD64)
 elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
   add_definitions(-DSOS_TARGET_X86=1)
+  add_definitions(-D_TARGET_X86_=1)
+  add_definitions(-DDBG_TARGET_32BIT)
   if(WIN32)
     add_definitions(-DSOS_TARGET_ARM=1)
   endif(WIN32)
 elseif(CLR_CMAKE_PLATFORM_ARCH_ARM)
   add_definitions(-DSOS_TARGET_ARM=1)
+  add_definitions(-D_TARGET_WIN32_=1)
+  add_definitions(-D_TARGET_ARM_=1)
+  add_definitions(-DDBG_TARGET_32BIT)
 elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
-  add_definitions(-D_TARGET_WIN64_=1)
   add_definitions(-DSOS_TARGET_ARM64=1)
+  add_definitions(-D_TARGET_WIN64_=1)
+  add_definitions(-DDBG_TARGET_64BIT)
+  add_definitions(-DDBG_TARGET_WIN64=1)
 endif()
 
 add_definitions(-DSTRIKE)  
index f82c38ac4dde7c66cf837963a89705ad172b0ceb..ceb0fed30de8b74f14fca75dc08eb6842198a0f5 100644 (file)
@@ -530,7 +530,7 @@ INT_PTR ParseHexNumber (__in_z char *ptr, ___out char **endptr)
         endptr1 = endptr2;
     }
     // if the hex number was specified as 000006fbf9b70f50, an overflow occurred
-    else if (ULONG_MAX == value1 && errno == ERANGE)
+    else if ((INT_PTR)ULONG_MAX == value1 && errno == ERANGE)
     {
         if (!strncmp(ptr, "0x", 2))
             ptr += 2;
index b14be2e6b2c8f8822045e2c0bc523ffab93df6d4..4df9234bfaee6e47cafbc747982bcd0e8374caae 100644 (file)
@@ -122,24 +122,25 @@ ArchQuery(void)
     {
         targetMachine = AMD64Machine::GetInstance();
     }
-#elif defined(SOS_TARGET_X86)
+#endif // SOS_TARGET_AMD64
+#ifdef SOS_TARGET_X86
     if (targetArchitecture == IMAGE_FILE_MACHINE_I386)
     {
         targetMachine = X86Machine::GetInstance();
     }
-#elif defined(SOS_TARGET_ARM)
+#endif // SOS_TARGET_X86
+#ifdef SOS_TARGET_ARM
     if (targetArchitecture == IMAGE_FILE_MACHINE_ARMNT)
     {
         targetMachine = ARMMachine::GetInstance();
     }
-#elif defined(SOS_TARGET_ARM64)
+#endif // SOS_TARGET_ARM
+#ifdef SOS_TARGET_ARM64
     if (targetArchitecture == IMAGE_FILE_MACHINE_ARM64)
     {
         targetMachine = ARM64Machine::GetInstance();
     }
-#else
-#error "Undefined target architecture"
-#endif
+#endif // SOS_TARGET_ARM64
 
     if (targetMachine == NULL)
     {
index 302f0e92fccdec2e29caaa4ef1314af0eb0f67b3..2a8dface9f162604e9d3bbc7267f45ac6e6b09a8 100644 (file)
@@ -226,7 +226,7 @@ static bool GetEntrypointExecutableAbsolutePath(std::string& entrypointExecutabl
 /**********************************************************************\
  * Returns the coreclr module/runtime directory of the target.
 \**********************************************************************/
-HRESULT GetCoreClrDirectory(std::string& coreClrDirectory)
+static HRESULT GetCoreClrDirectory(std::string& coreClrDirectory)
 {
 #ifdef FEATURE_PAL
     LPCSTR directory = g_ExtServices->GetCoreClrDirectory();
@@ -244,7 +244,7 @@ HRESULT GetCoreClrDirectory(std::string& coreClrDirectory)
     HRESULT Status = g_ExtSymbols->GetModuleByModuleName(MAIN_CLR_MODULE_NAME_A, 0, &index, NULL);
     if (FAILED(Status))
     {
-        ExtErr("Error: Can't find coreclr module\n");
+        ExtErr("Error: Runtime module (%s) not loaded yet\n", MAKEDLLNAME_A("coreclr"));
         return Status;
     }
     ArrayHolder<char> szModuleName = new char[MAX_LONGPATH + 1];
@@ -254,13 +254,17 @@ HRESULT GetCoreClrDirectory(std::string& coreClrDirectory)
         ExtErr("Error: Failed to get coreclr module name\n");
         return Status;
     }
+    if (GetFileAttributesA(szModuleName) == INVALID_FILE_ATTRIBUTES)
+    {
+        ExtErr("Error: coreclr module name doesn't exists\n");
+        return HRESULT_FROM_WIN32(GetLastError());
+    }
     coreClrDirectory = szModuleName;
 
     // Parse off the module name to get just the path
     size_t lastSlash = coreClrDirectory.rfind(DIRECTORY_SEPARATOR_CHAR_A);
     if (lastSlash == std::string::npos)
     {
-        ExtErr("Error: Failed to parse coreclr module name\n");
         return E_FAIL;
     }
     coreClrDirectory.assign(coreClrDirectory, 0, lastSlash);
@@ -331,7 +335,7 @@ const char *g_linuxPaths[] = {
  * directory. Attempts to use the best installed version of the 
  * runtime, otherwise it defaults to the target's runtime version.
 \**********************************************************************/
-HRESULT GetHostRuntime(std::string& coreClrPath, std::string& hostRuntimeDirectory)
+static HRESULT GetHostRuntime(std::string& coreClrPath, std::string& hostRuntimeDirectory)
 {
     // If the hosting runtime isn't already set, use the runtime we are debugging
     if (g_hostRuntimeDirectory == nullptr)
@@ -395,6 +399,25 @@ HRESULT GetHostRuntime(std::string& coreClrPath, std::string& hostRuntimeDirecto
     return S_OK;
 }
 
+#ifndef FEATURE_PAL
+/**********************************************************************\
+ * Returns the path to the runtime directory to use for hosting. 
+\**********************************************************************/
+LPCSTR
+GetHostRuntimeDirectory()
+{
+    std::string hostRuntimeDirectory;
+    std::string coreClrPath;
+
+    HRESULT Status = GetHostRuntime(coreClrPath, hostRuntimeDirectory);
+    if (FAILED(Status))
+    {
+        return nullptr;
+    }
+    return hostRuntimeDirectory.c_str();
+}
+#endif // FEATURE_PAL
+
 //
 // Returns the unique temporary directory for this instnace of SOS
 //
index dbe4b12b2999ac24975201663fd2695c9f8bdf7b..9d9d753a7dcb5fa71269c50e7b7eb15aa772e220 100644 (file)
@@ -85,8 +85,11 @@ ICorDebugProcess *g_pCorDebugProcess = NULL;
 // Max number of reverted rejit versions that !dumpmd and !ip2md will print
 const UINT kcMaxRevertedRejitData   = 10;
 const UINT kcMaxTieredVersions      = 10;
+
 #ifndef FEATURE_PAL
 
+extern LPCSTR GetHostRuntimeDirectory();
+
 // ensure we always allocate on the process heap
 void* __cdecl operator new(size_t size) throw()
 { return HeapAlloc(GetProcessHeap(), 0, size); }
@@ -183,31 +186,41 @@ HRESULT CreateInstanceCustomImpl(
                         void** ppItf)
 {
     _ASSERTE(ppItf != NULL);
+    _ASSERTE(dllName != NULL);
 
-    if (ppItf == NULL)
+    if (ppItf == NULL || dllName == NULL)
         return E_POINTER;
 
     WCHAR wszClsid[64] = W("<CLSID>");
 
-    if ((cciOptions & cciDbiColocated) != 0)
+    // Step 1: attempt activation using the host runtime directory
+    LPCSTR hostRuntimeDirectory = GetHostRuntimeDirectory();
+    if (hostRuntimeDirectory != nullptr)
     {
-        // if we institute a way to retrieve the module for the current DBI we
-        // can perform the same steps as for the DAC.
+        ArrayHolder<WCHAR> path = new WCHAR[MAX_LONGPATH];
+        int length = MultiByteToWideChar(CP_ACP, 0, hostRuntimeDirectory, -1, path, MAX_LONGPATH);
+        if (length > 0)
+        {
+            if (wcscat_s(path, MAX_LONGPATH, W("\\")) == 0 && wcscat_s(path, MAX_LONGPATH, dllName) == 0 &&
+                SUCCEEDED(CreateInstanceFromPath(clsid, iid, path, ppItf)))
+            {
+                return S_OK;
+            }
+        }
     }
 
     // Step 2: attempt activation using the folder the DAC was loaded from
     if ((cciOptions & cciDacColocated) != 0)
     {
-        _ASSERTE(dllName != NULL);
         HMODULE hDac = NULL;
-        WCHAR path[MAX_LONGPATH];
+        ArrayHolder<WCHAR> path = new WCHAR[MAX_LONGPATH];
 
-        if (SUCCEEDED(g_sos->GetDacModuleHandle(&hDac))
-            && GetPathFromModule(hDac, path, _countof(path)))
+        if (SUCCEEDED(g_sos->GetDacModuleHandle(&hDac)) && 
+            GetPathFromModule(hDac, path, MAX_LONGPATH))
         {
             // build the fully qualified file name and attempt instantiation
-            if (wcscat_s(path, dllName) == 0
-                && SUCCEEDED(CreateInstanceFromPath(clsid, iid, path, ppItf)))
+            if (wcscat_s(path, MAX_LONGPATH, dllName) == 0 && 
+                SUCCEEDED(CreateInstanceFromPath(clsid, iid, path, ppItf)))
             {
                 return S_OK;
             }
@@ -219,8 +232,6 @@ HRESULT CreateInstanceCustomImpl(
     // Step 3: attempt activation using the debugger's .exepath and .sympath
     if ((cciOptions & cciDbgPath) != 0)
     {
-        _ASSERTE(dllName != NULL);
-
         ToRelease<IDebugSymbols3> spSym3(NULL);
         HRESULT hr = g_ExtSymbols->QueryInterface(__uuidof(IDebugSymbols3), (void**)&spSym3);
         if (FAILED(hr))
@@ -247,10 +258,6 @@ HRESULT CreateInstanceCustomImpl(
                 }
 
                 ArrayHolder<WCHAR> imgPath = new WCHAR[pathSize+MAX_LONGPATH+1];
-                if (imgPath == NULL)
-                {
-                    continue;
-                }
 
                 // actually get the path
                 if ((spSym3.GetPtr()->*rgGetPathFuncs[i])(imgPath, pathSize, NULL) != S_OK)
@@ -262,11 +269,11 @@ HRESULT CreateInstanceCustomImpl(
                 LPCWSTR pathElem = wcstok_s(imgPath, W(";"), &ctx);
                 while (pathElem != NULL)
                 {
-                    WCHAR fullName[MAX_LONGPATH];
-                    wcscpy_s(fullName, _countof(fullName), pathElem);
-                    if (wcscat_s(fullName, W("\\")) == 0 && wcscat_s(fullName, dllName) == 0)
+                    ArrayHolder<WCHAR> path = new WCHAR[MAX_LONGPATH];
+                    wcscpy_s(path, MAX_LONGPATH, pathElem);
+                    if (wcscat_s(path, MAX_LONGPATH, W("\\")) == 0 && wcscat_s(path, MAX_LONGPATH, dllName) == 0) 
                     {
-                        if (SUCCEEDED(CreateInstanceFromPath(clsid, iid, fullName, ppItf)))
+                        if (SUCCEEDED(CreateInstanceFromPath(clsid, iid, path, ppItf)))
                         {
                             return S_OK;
                         }
@@ -3975,14 +3982,7 @@ void ResetGlobals(void)
     Output::ResetIndent();
 }
 
-//---------------------------------------------------------------------------------------
-//
-// Loads private DAC interface, and points g_clrData to it.
-//
-// Return Value:
-//      HRESULT indicating success or failure
-//
-HRESULT LoadClrDebugDll(void)
+static HRESULT GetClrDataProcess()
 {
     static IXCLRDataProcess* clrDataProcess = NULL;
     HRESULT hr = S_OK;
@@ -4021,6 +4021,38 @@ HRESULT LoadClrDebugDll(void)
     g_clrData->AddRef();
     g_clrData->Flush();
 
+    return S_OK;
+}
+
+//---------------------------------------------------------------------------------------
+//
+// Loads private DAC interface, and points g_clrData to it.
+//
+// Return Value:
+//      HRESULT indicating success or failure
+//
+HRESULT LoadClrDebugDll(void)
+{
+    static IXCLRDataProcess* clrDataProcess = NULL;
+    HRESULT hr = GetClrDataProcess();
+    if (FAILED(hr)) 
+    {
+#ifdef FEATURE_PAL
+        return hr;
+#else
+        // Try getting the DAC interface from dbgeng if the above fails on Windows
+        WDBGEXTS_CLR_DATA_INTERFACE Query;
+
+        Query.Iid = &__uuidof(IXCLRDataProcess);
+        if (!Ioctl(IG_GET_CLR_DATA_INTERFACE, &Query, sizeof(Query)))
+        {
+            return hr;
+        }
+        g_clrData = (IXCLRDataProcess*)Query.Iface;
+        g_clrData->Flush();
+#endif
+    }
+
     hr = g_clrData->QueryInterface(__uuidof(ISOSDacInterface), (void**)&g_sos);
     if (FAILED(hr))
     {
index 4677d694208f246ec9ece319cb4817e14bdd861e..031082de4f962fd8a41e3fcfa759e70fabfb3e02 100644 (file)
@@ -3056,9 +3056,8 @@ private:
 // Flags defining activation policy for COM objects
 enum CIOptionsBits 
 {
-    cciDbiColocated = 0x01,     // NYI: Look next to the already loaded DBI module
-    cciDacColocated = 0x02,     // Look next to the already loaded DAC module
-    cciDbgPath      = 0x04,     // Look in all folders in the debuggers symbols and binary path
+    cciDacColocated = 0x01,     // Look next to the already loaded DAC module
+    cciDbgPath      = 0x02,     // Look in all folders in the debuggers symbols and binary path
 };
 
 typedef Flags<DWORD, CIOptionsBits> CIOptions;
index 7635037649ee1f8b2c678549f9d9300db9c21681..e0520105ad6325e9e54d79451df1ab30221a0498 100644 (file)
@@ -213,7 +213,7 @@ BOOL StackSlotStateChangeCallback (
         if (pState->fAnythingPrinted)
             pState->pfnPrintf("\n");
 
-        if ((CodeOffset == -2) && !pState->fAnythingPrinted)
+        if ((CodeOffset == (UINT32)-2) && !pState->fAnythingPrinted)
             pState->pfnPrintf("Untracked:");
         else
             pState->pfnPrintf("%08x", CodeOffset);
index bac1c89830402413efa4b06b37c1df611addcb26..0f82fd663488b08f7b3ed743140f0857c4610490 100644 (file)
@@ -23,11 +23,26 @@ if(SKIP_LLDBPLUGIN)
 endif()
 
 if(CLR_CMAKE_PLATFORM_ARCH_AMD64)
+    add_definitions(-D_TARGET_AMD64_=1)
+    add_definitions(-DDBG_TARGET_64BIT=1)
+    add_definitions(-DDBG_TARGET_AMD64=1)
+    add_definitions(-DDBG_TARGET_WIN64=1)
     add_definitions(-DBIT64)
+elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
+    add_definitions(-D_TARGET_X86_=1)
+    add_definitions(-DDBG_TARGET_32BIT=1)
+    add_definitions(-DDBG_TARGET_X86=1)
 elseif(CLR_CMAKE_PLATFORM_ARCH_ARM)
-    set(REQUIRE_LLDBPLUGIN false)
+    add_definitions(-D_TARGET_ARM_=1)
+    add_definitions(-DDBG_TARGET_32BIT=1)
+    add_definitions(-DDBG_TARGET_ARM=1)
 elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+    add_definitions(-D_TARGET_ARM64_=1)
+    add_definitions(-DDBG_TARGET_64BIT=1)
+    add_definitions(-DDBG_TARGET_ARM64=1)
+    add_definitions(-DDBG_TARGET_WIN64=1)
     add_definitions(-DBIT64)
+    SET(REQUIRE_LLDBPLUGIN false)
 endif()
 
 if(NOT $ENV{LLVM_HOME} STREQUAL "")
index d0ca38a8fefcde46cd8921ebd6023d3e89ad439f..2907b973fc18d22a57277a94c10abed56cd022e8 100644 (file)
@@ -8,7 +8,6 @@
     <Description>Diagnostic dump collect and analyze tool</Description>
     <PackageTags>Diagnostic</PackageTags>
     <PackageReleaseNotes>$(Description)</PackageReleaseNotes>
-    <SOSNETCoreBinaries>$(ArtifactsBinDir)\SOS.NETCore\$(Configuration)\netstandard2.0\publish\*.dll</SOSNETCoreBinaries>
   </PropertyGroup>
 
   <ItemGroup>
     <ProjectReference Include="$(MSBuildThisFileDirectory)..\..\SOS\SOS.NETCore\SOS.NETCore.csproj" />
   </ItemGroup>
 
-  <ItemGroup>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/win-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Windows_NT.x64.$(Configuration)\sos.dll" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/win-x64</PackagePath>
-    </None>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Windows_NT.x86.$(Configuration)\sos.dll" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
-    </None>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\libsosplugin.so" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\libsos.so" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
-    </None>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\libsosplugin.so" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\libsos.so" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
-    </None>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\libsosplugin.dylib" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\libsos.dylib" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
-    </None>
-  </ItemGroup>
+  <Import Project="$(MSBuildThisFileDirectory)..\sos-packaging.props" />
 </Project>
index 9c412476f3cae791eec47ebcb6e4c2fcfbca34e7..a89054d3a44b81daded3ec0b1fe37c53993a5a09 100644 (file)
     <PackageReference Include="System.CommandLine.Experimental" Version="$(SystemCommandLineExperimentalVersion)" />
   </ItemGroup>
 
-  <ItemGroup>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/win-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Windows_NT.x64.$(Configuration)\sos.dll" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/win-x64</PackagePath>
-    </None>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Windows_NT.x86.$(Configuration)\sos.dll" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
-    </None>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\libsosplugin.so" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\libsos.so" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
-    </None>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\libsosplugin.so" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\libsos.so" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
-    </None>
-    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\libsosplugin.dylib" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\libsos.dylib" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
-    </None>
-    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
-      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
-    </None>
-  </ItemGroup>
+  <Import Project="$(MSBuildThisFileDirectory)..\sos-packaging.props" />
 </Project>
diff --git a/src/Tools/sos-packaging.props b/src/Tools/sos-packaging.props
new file mode 100644 (file)
index 0000000..df6012b
--- /dev/null
@@ -0,0 +1,91 @@
+<Project>
+  <PropertyGroup>
+    <SOSNETCoreBinaries>$(ArtifactsBinDir)\SOS.NETCore\$(Configuration)\netstandard2.0\publish\*.dll</SOSNETCoreBinaries>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/win-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Windows_NT.x64.$(Configuration)\sos.dll" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/win-x64</PackagePath>
+    </None>
+    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Windows_NT.x86.$(Configuration)\sos.dll" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
+    </None>
+    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/win-arm</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Windows_NT.arm.$(Configuration)\sos.dll" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/win-arm</PackagePath>
+    </None>
+
+    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\libsosplugin.so" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\libsos.so" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>
+    </None>
+
+    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\libsosplugin.so" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\libsos.so" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux-musl.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-musl-x64</PackagePath>
+    </None>
+
+    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-arm</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.arm.$(Configuration)\libsosplugin.so" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-arm</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.arm.$(Configuration)\libsos.so" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-arm</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.arm.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-arm</PackagePath>
+    </None>
+
+    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-arm64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.arm64.$(Configuration)\libsosplugin.so" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-arm64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.arm64.$(Configuration)\libsos.so" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-arm64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\Linux.arm64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/linux-arm64</PackagePath>
+    </None>
+
+    <None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\libsosplugin.dylib" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\libsos.dylib" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
+    </None>
+    <None Include="$(ArtifactsBinDir)\OSX.x64.$(Configuration)\sosdocsunix.txt" Pack="true" Visible="false">
+      <PackagePath>tools/$(TargetFramework)/any/osx-x64</PackagePath>
+    </None>
+  </ItemGroup>
+</Project>
index 92aa0b7c70e0c7f1ead90c3910eb6dc17d2699ee..ce368f3f80a6d1f7398d86997b6860eec235c961 100644 (file)
@@ -19,49 +19,18 @@ cpp_quote("")
 // Interface descriptions
 //
 import "unknwn.idl";
-#if defined(FEATURE_WINDOWSPHONE)
-import "gchost.idl";
-#endif
-
-#include "product_version.h"
 
 cpp_quote("struct IActivationFactory;")
 interface IActivationFactory;
 
-// CLSID TypeNameFactory : uuid{B81FF171-20F3-11d2-8DCC-00A0C9B00525}
-cpp_quote("EXTERN_GUID(CLSID_TypeNameFactory, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0xcc, 0x00, 0xa0, 0xc9, 0xb0, 0x05, 0x25);")
-
+cpp_quote("struct IHostControl;")
+interface IHostControl;
 
-#ifdef FEATURE_COMINTEROP
-// CLSID ComCallUnmarshal
-cpp_quote("EXTERN_GUID(CLSID_ComCallUnmarshal, 0x3F281000,0xE95A,0x11d2,0x88,0x6B,0x00,0xC0,0x4F,0x86,0x9F,0x04);")
+cpp_quote("struct ICLRControl;")
+interface ICLRControl;
 
 // CLSID ComCallUnmarshal2
 cpp_quote("EXTERN_GUID(CLSID_ComCallUnmarshalV4, 0x45fb4600,0xe6e8,0x4928,0xb2,0x5e,0x50,0x47,0x6f,0xf7,0x94,0x25);")
-#endif // FEATURE_COMINTEROP
-
-#ifdef FEATURE_APPDOMAIN_RESOURCE_MONITORING
-// IID ICLRAppDomainResourceMonitor: uuid(C62DE18C-2E23-4AEA-8423-B40C1FC59EAE)
-cpp_quote("EXTERN_GUID(IID_ICLRAppDomainResourceMonitor, 0XC62DE18C, 0X2E23, 0X4AEA, 0X84, 0X23, 0XB4, 0X0C, 0X1F, 0XC5, 0X9E, 0XAE);")
-#endif //FEATURE_APPDOMAIN_RESOURCE_MONITORING
-
-// {7D290010-D781-45da-A6F8-AA5D711A730E}
-cpp_quote("EXTERN_GUID(IID_ICLRPolicyManager, 0x7D290010, 0xD781, 0x45da, 0xA6, 0xF8, 0xAA, 0x5D, 0x71, 0x1A, 0x73, 0x0E);")
-
-#if defined (FEATURE_WINDOWSPHONE)
-// IID_ICLRGCManager : uuid(54D9007E-A8E2-4885-B7BF-F998DEEE4F2A)
-cpp_quote("EXTERN_GUID(IID_ICLRGCManager, 0x54D9007E, 0xA8E2, 0x4885, 0xB7, 0xBF, 0xF9, 0x98, 0xDE, 0xEE, 0x4F, 0x2A);")
-// IID_ICLRGCManager2 : uuid(0603B793-A97A-4712-9CB4-0CD1C74C0F7C)
-cpp_quote("EXTERN_GUID(IID_ICLRGCManager2, 0x0603B793, 0xA97A, 0x4712, 0x9C, 0xB4, 0x0C, 0xD1, 0xC7, 0x4C, 0x0F, 0x7C);")
-// IID_ICLRErrorReportingManager : uuid(980D2F1A-BF79-4c08-812A-BB9778928F78)
-cpp_quote("EXTERN_GUID(IID_ICLRErrorReportingManager, 0x980d2f1a, 0xbf79, 0x4c08, 0x81, 0x2a, 0xbb, 0x97, 0x78, 0x92, 0x8f, 0x78);")
-#endif // FEATURE_WINDOWSPHONE
-
-#ifdef FEATURE_WINDOWSPHONE
-// IID_ICLRErrorReportingManager2 : uuid(C68F63B1-4D8B-4E0B-9564-9D2EFE2FA18C)
-cpp_quote("EXTERN_GUID(IID_ICLRErrorReportingManager2, 0xc68f63b1, 0x4d8b, 0x4e0b, 0x95, 0x64, 0x9d, 0x2e, 0xfe, 0x2f, 0xa1, 0x8c);")
-#endif // FEATURE_WINDOWSPHONE
-
 
 // IID ICLRRuntimeHost: uuid(90F1A06C-7712-4762-86B5-7A5EBA6BDB02)
 cpp_quote("EXTERN_GUID(IID_ICLRRuntimeHost, 0x90F1A06C, 0x7712, 0x4762, 0x86, 0xB5, 0x7A, 0x5E, 0xBA, 0x6B, 0xDB, 0x02);")
@@ -72,52 +41,8 @@ cpp_quote("EXTERN_GUID(IID_ICLRRuntimeHost2, 0x712AB73F, 0x2C22, 0x4807, 0xAD, 0
 // IID ICLRRuntimeHost4: uuid(64F6D366-D7C2-4F1F-B4B2-E8160CAC43AF)
 cpp_quote("EXTERN_GUID(IID_ICLRRuntimeHost4, 0x64F6D366, 0xD7C2, 0x4F1F, 0xB4, 0xB2, 0xE8, 0x16, 0x0C, 0xAC, 0x43, 0xAF);")
 
-// IID IID_ICLRExecutionManager: uuid(1000A3E7-B420-4620-AE30-FB19B587AD1D)
-cpp_quote("EXTERN_GUID(IID_ICLRExecutionManager, 0x1000A3E7, 0xB420, 0x4620, 0xAE, 0x30, 0xFB, 0x19, 0xB5, 0x87, 0xAD, 0x1D);")
-
-
-// IID ITypeName : uuid{B81FF171-20F3-11d2-8DCC-00A0C9B00522}
-cpp_quote("EXTERN_GUID(IID_ITypeName, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0xcc, 0x00, 0xa0, 0xc9, 0xb0, 0x05, 0x22);")
-
-
-// IID ITypeNameBuilder : uuid{B81FF171-20F3-11d2-8DCC-00A0C9B00523}
-cpp_quote("EXTERN_GUID(IID_ITypeNameBuilder, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0xcc, 0x00, 0xa0, 0xc9, 0xb0, 0x05, 0x23);")
-
-// IID ITypeNameFactory : uuid{B81FF171-20F3-11d2-8DCC-00A0C9B00521}
-cpp_quote("EXTERN_GUID(IID_ITypeNameFactory, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0xcc, 0x00, 0xa0, 0xc9, 0xb0, 0x05, 0x21);")
-
-#pragma midl_echo("DEPRECATED_CLR_STDAPI GetCORSystemDirectory(_Out_writes_to_(cchBuffer, *dwLength) LPWSTR pbuffer, DWORD  cchBuffer, DWORD* dwLength);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI GetCORVersion(_Out_writes_to_(cchBuffer, *dwLength) LPWSTR pbBuffer, DWORD cchBuffer, DWORD* dwLength);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI GetFileVersion(LPCWSTR szFilename, _Out_writes_to_opt_(cchBuffer, *dwLength) LPWSTR szBuffer, DWORD cchBuffer, DWORD* dwLength);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI GetCORRequiredVersion(_Out_writes_to_(cchBuffer, *dwLength) LPWSTR pbuffer, DWORD cchBuffer, DWORD* dwLength);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI GetRequestedRuntimeInfo(LPCWSTR pExe, LPCWSTR pwszVersion, LPCWSTR pConfigurationFile, DWORD startupFlags, DWORD runtimeInfoFlags, _Out_writes_opt_(dwDirectory) LPWSTR pDirectory, DWORD dwDirectory, _Out_opt_ DWORD *dwDirectoryLength, _Out_writes_opt_(cchBuffer) LPWSTR pVersion, DWORD cchBuffer, _Out_opt_ DWORD* dwlength);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI GetRequestedRuntimeVersion(_In_ LPWSTR pExe, _Out_writes_to_(cchBuffer, *dwLength) LPWSTR pVersion, DWORD cchBuffer, _Out_ DWORD* dwLength);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, LPCWSTR pwszHostConfigFile, VOID* pReserved, DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI CorBindToRuntimeEx(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI CorBindToRuntimeByCfg(IStream* pCfgStream, DWORD reserved, DWORD startupFlags, REFCLSID rclsid,REFIID riid, LPVOID FAR* ppv);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI CorBindToRuntime(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI CorBindToCurrentRuntime(LPCWSTR pwszFileName, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI ClrCreateManagedInstance(LPCWSTR pTypeName, REFIID riid, void **ppObject);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI RunDll32ShimW(HWND hwnd, HINSTANCE hinst, LPCWSTR lpszCmdLine, int nCmdShow);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI LoadLibraryShim(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI CallFunctionShim(LPCWSTR szDllName, LPCSTR szFunctionName, LPVOID lpvArgument1, LPVOID lpvArgument2, LPCWSTR szVersion, LPVOID pvReserved);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI GetRealProcAddress(LPCSTR pwszProcName, VOID** ppv);")
-#pragma midl_echo("DECLARE_DEPRECATED void STDMETHODCALLTYPE CorExitProcess(int exitCode);")
-#pragma midl_echo("DEPRECATED_CLR_STDAPI LoadStringRC(UINT iResouceID, _Out_writes_z_(iMax) LPWSTR szBuffer, int iMax, int bQuiet);")
-#ifdef FEATURE_USE_LCID
-#pragma midl_echo("DEPRECATED_CLR_STDAPI LoadStringRCEx(LCID lcid, UINT iResouceID, _Out_writes_z_(iMax) LPWSTR szBuffer, int iMax, int bQuiet, int *pcwchUsed);")
-#endif
-
 #pragma midl_echo("typedef HRESULT  (STDAPICALLTYPE *FnGetCLRRuntimeHost)(REFIID riid, IUnknown **pUnk);")
 
-typedef enum {
-    HOST_TYPE_DEFAULT     = 0x0,
-    HOST_TYPE_APPLAUNCH   = 0x1,
-    HOST_TYPE_CORFLAG     = 0x2
-} HOST_TYPE;
-
-#pragma midl_echo("STDAPI CorLaunchApplication(HOST_TYPE dwClickOnceHost, LPCWSTR pwzAppFullName, DWORD dwManifestPaths, LPCWSTR* ppwzManifestPaths, DWORD dwActivationData, LPCWSTR* ppwzActivationData, LPPROCESS_INFORMATION lpProcessInformation);")
-
 typedef HRESULT (__stdcall *FExecuteInAppDomainCallback) (void* cookie);
 
 // By default GC is concurrent and only the base system library is loaded into the domain-neutral area.
@@ -149,26 +74,6 @@ typedef enum {
   STARTUP_DISABLE_RANDOMIZED_STRING_HASHING     = 0x2000000      // Disable the randomized string hashing (not supported)
 } STARTUP_FLAGS;
 
-typedef enum {
-  CLSID_RESOLUTION_DEFAULT         = 0x0,     // Standard behavior that interop uses
-  CLSID_RESOLUTION_REGISTERED   = 0x1,     // Searches the registry and applies shim policy
-} CLSID_RESOLUTION_FLAGS;
-
-typedef enum
-{
-    RUNTIME_INFO_UPGRADE_VERSION        = 0x001, // apply upgrades - i.e RTM->Everett
-    RUNTIME_INFO_REQUEST_IA64           = 0x002, // requesting a CLR for ia64
-    RUNTIME_INFO_REQUEST_AMD64          = 0x004, // requesting a CLR for amd64
-    RUNTIME_INFO_REQUEST_X86            = 0x008, // requesting a CLR for x86
-    RUNTIME_INFO_DONT_RETURN_DIRECTORY  = 0x010, // don't return directory information
-    RUNTIME_INFO_DONT_RETURN_VERSION    = 0x020, // don't return version information
-    RUNTIME_INFO_DONT_SHOW_ERROR_DIALOG = 0x040, // don't pop up an error dialog on failure
-    RUNTIME_INFO_IGNORE_ERROR_MODE      = 0x1000,// ignore SEM_FAILCRITICALERRORS 
-                                                 // (by default the error dialog is not shown if  SEM_FAILCRITICALERRORS is set)
-    // Reserved values here - see mscoreepriv.h
-} RUNTIME_INFO_FLAGS;
-
-
 typedef enum
 {
     APPDOMAIN_SECURITY_DEFAULT =0x0, 
@@ -186,85 +91,12 @@ typedef enum
     APPDOMAIN_DISABLE_TRANSPARENCY_ENFORCEMENT = 0x100,
 } APPDOMAIN_SECURITY_FLAGS;
 
-#pragma midl_echo("STDAPI GetRequestedRuntimeVersionForCLSID(REFCLSID rclsid, _Out_writes_opt_(cchBuffer) LPWSTR pVersion, DWORD cchBuffer, _Out_opt_ DWORD* dwLength, CLSID_RESOLUTION_FLAGS dwResolutionFlags);")
-
-
-cpp_quote("EXTERN_GUID(IID_IDebuggerThreadControl, 0x23d86786, 0x0bb5, 0x4774, 0x8f, 0xb5, 0xe3, 0x52, 0x2a, 0xdd, 0x62, 0x46);")
-[
-    uuid(23D86786-0BB5-4774-8FB5-E3522ADD6246),
-    version(1.0),
-    helpstring("Control over threads blocked in debugging services"),
-    pointer_default(unique),
-    local
-]
-interface IDebuggerThreadControl : IUnknown
-{
-    // Notification that the thread making the call is about to
-    // block within the debugging services.      This gives the host
-    // an opportunity to perform another action while the thread
-    // blocks. This will always be called on a Runtime thread.
-    HRESULT ThreadIsBlockingForDebugger();
-
-    // Notification that the debugging services is about to
-    // release all threads it has blocked. This will never be
-    // called on a Runtime thread. If the host has a Runtime
-    // thread blocked in ThreadIsBlockingForDebugger() then it
-    // should release it now.
-    HRESULT ReleaseAllRuntimeThreads();
-
-    // Notification that the debugging services are about to
-    // start blocking all threads. This could be called on a
-    // Runtime thread. This is the signal to the host to
-    // start blocking threads in ThreadIsBlockingForDebugger().
-    HRESULT StartBlockingForDebugger(DWORD dwUnused);
-}
-
-cpp_quote("EXTERN_GUID(IID_IDebuggerInfo, 0xbf24142d, 0xa47d, 0x4d24, 0xa6, 0x6d, 0x8c, 0x21, 0x41, 0x94, 0x4e, 0x44);")
-[
-    uuid(BF24142D-A47D-4d24-A66D-8C2141944E44),
-    version(1.0),
-    helpstring("Information on the state of the debugging services"),
-    pointer_default(unique),
-    local
-]
-interface IDebuggerInfo : IUnknown
-{
-    // Indicates whether or not a managed debugger is attached to this process.
-    HRESULT IsDebuggerAttached([out] BOOL *pbAttached);
-}
-
-
-//*****************************************************************************
-// Interface for hosting mscoree
-//*****************************************************************************
-typedef void* HDOMAINENUM;
-
-
-typedef enum
-{
-    eMemoryAvailableLow = 1,
-    eMemoryAvailableNeutral = 2,
-    eMemoryAvailableHigh = 3
-} EMemoryAvailable;
-
-typedef enum
-{
-    eTaskCritical = 0,
-    eAppDomainCritical = 1,
-    eProcessCritical = 2
-} EMemoryCriticalLevel;
-
 typedef enum {
     WAIT_MSGPUMP = 0x1,
     WAIT_ALERTABLE = 0x2,
     WAIT_NOTINDEADLOCK = 0x4
 }WAIT_OPTION;
 
-
-typedef UINT64 TASKID;
-typedef DWORD CONNID;
-
-
 typedef enum ETaskType
 {
     TT_DEBUGGERHELPER = 0x1,
@@ -281,14 +113,6 @@ typedef enum ETaskType
     TT_UNKNOWN = 0x80000000,
 } ETaskType;
 
-
-typedef enum { 
-    eSymbolReadingNever = 0,        // Never read PDBs
-    eSymbolReadingAlways = 1,       // Always read PDBs
-    eSymbolReadingFullTrustOnly = 2 // Only read PDBs that correspond to full-trust assemblies
-} ESymbolReadingPolicy;
-
-
 typedef enum {
     // Default to minidump
         DUMP_FLAVOR_Mini = 0,
@@ -304,26 +128,6 @@ typedef enum {
         
 } ECustomDumpFlavor;
 
-// reserved for future extension
-typedef enum
-{           
-        DUMP_ITEM_None = 0
-} ECustomDumpItemKind;
-
-//
-// The CustomDumpItem structure describes an item to be added to a dump. 
-// It is defined for future expansion and is not presently used.
-//
-typedef struct
-{
-    ECustomDumpItemKind itemKind; //this affects how next fields are interpreted.
-    union
-    {
-                  // Union to be expanded later if need be
-             UINT_PTR pReserved;
-    };    
-} CustomDumpItem;
-
 const DWORD BucketParamsCount = 10;
 const DWORD BucketParamLength = 255;
 
@@ -349,112 +153,6 @@ typedef struct _BucketParameters
     WCHAR pszParams[BucketParamsCount][BucketParamLength];    // Parameter strings.
 } BucketParameters;
 
-#if defined(FEATURE_WINDOWSPHONE)
-[
-    uuid(980D2F1A-BF79-4c08-812A-BB9778928F78),
-    version(1.0),
-    helpstring("CLR error reporting manager"),
-    pointer_default(unique),
-    local
-]
-interface ICLRErrorReportingManager : IUnknown
-{
-    // Get Watson bucket parameters for "current" exception (on calling thread).
-    HRESULT GetBucketParametersForCurrentException([out] BucketParameters *pParams);
-    
-    // The BeginCustomDump function configures the custom dump support
-    HRESULT BeginCustomDump(        [in] ECustomDumpFlavor dwFlavor,
-                                    [in] DWORD dwNumItems,
-                                    [in, size_is(dwNumItems), length_is(dwNumItems)] CustomDumpItem *items,
-                                    DWORD dwReserved);
-    
-    // EndCustomDump clears the custom dump configuration 
-    HRESULT EndCustomDump();                             
-}
-
-#ifdef FEATURE_WINDOWSPHONE
-typedef enum
-{
-    // indicates that the specified value is the Application ID
-    ApplicationID  = 0x1,
-
-    // indicates that the specified value is the application's Instance ID
-    InstanceID     = 0x2,
-
-    // additional values are reserved for future use
-} ApplicationDataKey;
-
-[
-    uuid(C68F63B1-4D8B-4E0B-9564-9D2EFE2FA18C),
-    version(1.0),
-    helpstring("CLR error reporting manager 2"),
-    pointer_default(unique),
-    local
-]
-interface ICLRErrorReportingManager2 : ICLRErrorReportingManager
-{
-    // This API will allow the host to specify key/value pairs of data to be consumed by the CLR.
-    //
-    // Parameters:
-    //   [in] key - One of the values specified in the ApplicationDataKey enumerated type.
-    //
-    //   [in] pValue - A NULL-terminated WCHAR string with a maximum length of MAX_PATH containing the corresponding
-    //                 value.  Note that the CLR maintains its own copy of the data so this structure does not need
-    //                 to persist after the API call returns.
-    //
-    // Return values:
-    //   S_OK upon success.
-    //
-    //   Any other return value indicates that the API did not complete successfully and no value was set.
-    //
-    //   Well-defined errors:
-    //     E_INVALIDOPERATION if the CLR has already started.
-    //     E_INVALIDARG for any of the following:
-    //       key is not within the range of valid values for ApplicationDataKey
-    //       pValue == NULL
-    //       length of pValue is greater than MAX_PATH
-    HRESULT SetApplicationData([in] ApplicationDataKey key, [in] WCHAR const* pValue);
-
-    // This API will allow the host to specify pre-defined Watson bucket data in the event of an unhandled
-    // exception, allowing the host to override Watson bucket parameter data that is usually collected and
-    // populated by the CLR.  It should be called before the CLR has started.
-    // The BucketParameters data structure must be properly initialized before calling this API by zeroing
-    // out all fields, setting pszParams entries as required, then setting fInited to TRUE.
-    // A NULL pszParams entry indicates that the bucket parameter should not be overridden, and if all pszParams
-    // entries are NULL then the API call will fail.
-    // To override a bucket parameter with an empty string specify a pszParams entry with a blank string (one or
-    // more whitespace characters).
-    //
-    // NOTE: The current implementation allows overriding of the first bucket parameter only (pszParams[0]).
-    //       Any other non-NULL pszParams entries will be ignored.  This is subject to change in future releases.
-    //
-    // Parameters:
-    //   [in] pBucketParams - A pointer to an initialized BucketParameters structure which contains the data to be
-    //                        reported in the event of an unhandled exception.  Note that the CLR maintains its own
-    //                        copy of the data so this structure does not need to persist after the API call returns.
-    //
-    //   [out] pCountParams - A pointer to a DWORD indicating the number of bucket parameter values that have
-    //                        been overridden by the host.  A count of 0 indicates that no parameters were
-    //                        overridden.
-    //
-    // Return values:
-    //   S_OK upon success.  In this case the value pointed to by pCountParams will be greater than 0.
-    //
-    //   Any other return value indicates that the API did not complete successfully.  In this case the value
-    //   pointed to by pCountParams will be 0.
-    //
-    //   Well-defined errors:
-    //     E_INVALIDOPERATION if the CLR has already started.
-    //     E_INVALIDARG for any of the following:
-    //       pBucketParams or pCountParams is NULL
-    //       pBucketParams->fInited != TRUE
-    //       if all BucketParameters.pszParams are NULL
-    HRESULT SetBucketParametersForUnhandledException([in] BucketParameters const* pBucketParams, [out] DWORD* pCountParams);
-}
-#endif // FEATURE_WINDOWSPHONE
-
-#endif // defined(FEATURE_WINDOWSPHONE)
-
 
 typedef enum
 {
@@ -506,229 +204,9 @@ typedef enum
         // Stop bypasses finalizer run.
     eFastExitProcess,
     eRudeExitProcess,
-    eDisableRuntime,
     MaxPolicyAction
 } EPolicyAction;
 
-[
-    uuid(7D290010-D781-45da-A6F8-AA5D711A730E),
-    version(1.0),
-    helpstring("Allow host to specify policy for CLR to follow in abnormal condition"),
-    pointer_default(unique),
-    local
-]
-interface ICLRPolicyManager: IUnknown
-{
-    HRESULT SetDefaultAction(
-        [in] EClrOperation operation,
-        [in] EPolicyAction action);
-
-    HRESULT SetTimeout(
-        [in] EClrOperation operation,
-        [in] DWORD dwMilliseconds);
-
-    HRESULT SetActionOnTimeout(
-        [in] EClrOperation operation,
-        [in] EPolicyAction action);
-
-    HRESULT SetTimeoutAndAction(
-        [in] EClrOperation operation,
-        [in] DWORD dwMilliseconds,
-        [in] EPolicyAction action);
-
-    HRESULT SetActionOnFailure(
-        [in] EClrFailure failure,
-        [in] EPolicyAction action);
-
-    HRESULT SetUnhandledExceptionPolicy(
-        [in] EClrUnhandledException policy);
-}
-
-
-typedef enum
-{
-    Event_DomainUnload,
-    Event_ClrDisabled,
-    Event_MDAFired,
-    Event_StackOverflow,
-    MaxClrEvent
-    // Do not add anything after this
-} EClrEvent;
-
-// An MDAInfo is passed via OnEvent for Event_MDAFired events.
-typedef struct _MDAInfo
-{
-    LPCWSTR lpMDACaption;
-    LPCWSTR lpMDAMessage;
-    LPCWSTR lpStackTrace;
-} MDAInfo;
-
-// An StackOverflowInfo is passed via OnEvent for Event_StackOverflow events.
-typedef enum
-{
-    SO_Managed,
-    SO_ClrEngine,
-    SO_Other,
-} StackOverflowType;
-
-cpp_quote("typedef struct _StackOverflowInfo")
-cpp_quote("{")
-cpp_quote("    StackOverflowType soType;")
-cpp_quote("    EXCEPTION_POINTERS *pExceptionInfo;")
-cpp_quote("} StackOverflowInfo;")
-
-
-#if defined(FEATURE_WINDOWSPHONE)
-
-/*
- * This interface is used to get information about the GC system and
- * control some aspects of the GC.  This interface is for expert usage
- * only, and can severely impact the performance of an application if
- * used improperly!!
- */
-[
-        uuid(54D9007E-A8E2-4885-B7BF-F998DEEE4F2A),
-    version(1.0),
-        pointer_default(unique),
-        local
-]
-interface ICLRGCManager : IUnknown
-{
-    /*
-     * Forces a collection to occur for the given generation, regardless of
-     * current GC statistics.  A value of -1 means collect all generations.
-     */
-    HRESULT Collect([in] LONG Generation);
-
-    /*
-     * Returns a set of current statistics about the state of the GC system.
-     * These values can then be used by a smart allocation system to help the
-     * GC run, by say adding more memory or forcing a collection.
-     */
-    HRESULT GetStats([in][out] COR_GC_STATS *pStats);
-
-    /*
-     * Sets the segment size and gen 0 maximum size.  This value may only be
-     * specified once and will not change if called later.
-     */
-    HRESULT SetGCStartupLimits([in] DWORD SegmentSize, [in] DWORD MaxGen0Size);
-}
-
-/*
- * This interface is added to allow users to specify 64-bit numbers on 64-bit OSs
- * for the parameters to SetGCStartupLimits.
- */
-[
-    uuid(0603B793-A97A-4712-9CB4-0CD1C74C0F7C),
-    version(2.0),
-    pointer_default(unique),
-    local
-]
-interface ICLRGCManager2 : ICLRGCManager
-{
-    /*
-     * Sets the segment size and gen 0 maximum size.  This value may only be
-     * specified once and will not change if called later.
-     */
-    HRESULT SetGCStartupLimitsEx([in] SIZE_T SegmentSize, [in] SIZE_T MaxGen0Size);
-};
-
-
-#endif // FEATURE_WINDOWSPHONE
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// enum EBindPolicyLevels
-//
-///////////////////////////////////////////////////////////////////////////////
-typedef enum
-{
-    ePolicyLevelNone = 0x0,
-    ePolicyLevelRetargetable = 0x1,
-    ePolicyUnifiedToCLR = 0x2,
-    ePolicyLevelApp = 0x4,
-    ePolicyLevelPublisher = 0x8,
-    ePolicyLevelHost = 0x10,
-    ePolicyLevelAdmin = 0x20,
-    ePolicyPortability = 0x40,
-} EBindPolicyLevels;
-///////////////////////////////////////////////////////////////////////////////
-//
-// struct AssemblyBindInfo
-//
-///////////////////////////////////////////////////////////////////////////////
-typedef struct _AssemblyBindInfo
-{
-    DWORD                       dwAppDomainId;
-    LPCWSTR                     lpReferencedIdentity;
-    LPCWSTR                     lpPostPolicyIdentity;
-    DWORD                       ePolicyLevel;
-}AssemblyBindInfo;
-///////////////////////////////////////////////////////////////////////////////
-//
-// struct ModuleBindInfo
-//
-///////////////////////////////////////////////////////////////////////////////
-typedef struct _ModuleBindInfo
-{
-    DWORD                         dwAppDomainId;
-    LPCWSTR                       lpAssemblyIdentity;
-    LPCWSTR                       lpModuleName;
-} ModuleBindInfo;
-
-
-typedef enum _HostApplicationPolicy
-{
-    HOST_APPLICATION_BINDING_POLICY = 1
-}EHostApplicationPolicy;
-
-
-
-// Implemented in mscorwks.dll, use mscoree!GetRealProcAddress to get
-// a function pointer of this API.
-#pragma midl_echo("STDAPI GetCLRIdentityManager(REFIID riid, IUnknown **ppManager);")
-
-// {02CA073D-7079-4860-880A-C2F7A449C991}
-cpp_quote("EXTERN_GUID(IID_IHostControl, 0x02CA073C, 0x7079, 0x4860, 0x88, 0x0A, 0xC2, 0xF7, 0xA4, 0x49, 0xC9, 0x91);")
-[
-    uuid(02CA073C-7079-4860-880A-C2F7A449C991),
-    version(1.0),
-    helpstring("Common Language Runtime Host Control Interface"),
-    pointer_default(unique),
-    local
-]
-interface IHostControl : IUnknown
-{
-    HRESULT GetHostManager(
-        [in] REFIID riid,
-        [out] void **ppObject);
-
-    /* Notify Host with IUnknown with the pointer to AppDomainManager */
-        HRESULT SetAppDomainManager(
-        [in] DWORD dwAppDomainID,
-        [in] IUnknown* pUnkAppDomainManager);
-}
-
-cpp_quote("EXTERN_GUID(IID_ICLRControl, 0x9065597E, 0xD1A1, 0x4fb2, 0xB6, 0xBA, 0x7E, 0x1F, 0xCE, 0x23, 0x0F, 0x61);")
-[
-    uuid(9065597E-D1A1-4fb2-B6BA-7E1FCE230F61),
-    version(1.0),
-    helpstring("Common Language Runtime Control Interface"),
-    pointer_default(unique),
-    local
-]
-interface ICLRControl : IUnknown
-{
-    HRESULT GetCLRManager(
-        [in] REFIID riid,
-        [out] void **ppObject);
-
-        HRESULT SetAppDomainManagerType(
-                [in] LPCWSTR pwzAppDomainManagerAssembly,
-        [in] LPCWSTR pwzAppDomainManagerType);
-}
-
-
 
 //*****************************************************************************
 // New interface for hosting mscoree
@@ -778,10 +256,6 @@ interface ICLRRuntimeHost : IUnknown
                                       [out] DWORD  *pReturnValue);
 };
 
-// Keys for ICLRRuntmeHost2::Authenticate. No longer required.
-cpp_quote("#define CORECLR_HOST_AUTHENTICATION_KEY 0x1C6CA6F94025800LL")
-cpp_quote("#define CORECLR_HOST_AUTHENTICATION_KEY_NONGEN 0x1C6CA6F94025801LL")
-
 //*****************************************************************************
 // New interface for hosting mscoree
 //*****************************************************************************
@@ -847,227 +321,6 @@ interface ICLRRuntimeHost4 : ICLRRuntimeHost2
                                           [out] int *pLatchedExitCode);
 };
 
-[
-    uuid(1000A3E7-B420-4620-AE30-FB19B587AD1D),
-    version(1.0),
-    helpstring("Pause and Resume Interface"),
-    pointer_default(unique),
-    local
-]
-interface ICLRExecutionManager : IUnknown
-{
-    // Pause all managed threads
-    // Parameters are ignored and reserved for future use.
-    HRESULT Pause([in] DWORD dwAppDomainId, [in] DWORD dwFlags);
-
-    // Resume managed threads
-    // Parameters are ignored and reserved for future use.
-    HRESULT Resume([in] DWORD dwAppDomainId);
-}
-
-//*****************************************************************************
-// Interface to utilize HostProtection
-//*****************************************************************************
-typedef enum
-{
-    eNoChecks                    = 0,
-    //---------------------------------
-    eSynchronization             = 0x1,
-    eSharedState                 = 0x2,
-    eExternalProcessMgmt         = 0x4,
-    eSelfAffectingProcessMgmt    = 0x8,
-    eExternalThreading           = 0x10,
-    eSelfAffectingThreading      = 0x20,
-    eSecurityInfrastructure      = 0x40,
-    eUI                          = 0x80,
-    eMayLeakOnAbort              = 0x100,
-    //----------------------------------
-    eAll                         = 0x1ff
-} EApiCategories;
-
-
-//
-// Interface for configuring the default AppDomain
-//
-
-typedef enum
-{
-    eInitializeNewDomainFlags_None              = 0x0000,
-
-    // InitializeNewDomain will not make changes to the security state of the AppDomain
-    eInitializeNewDomainFlags_NoSecurityChanges = 0x0002
-}
-EInitializeNewDomainFlags;
-
-
-//*****************************************************************************
-// mscoree typelib definition
-//*****************************************************************************
-
-[
-    uuid(5477469e-83b1-11d2-8b49-00a0c9b7c9c4),
-    version(2.4),
-    helpstring("Common Language Runtime Execution Engine 2.4 Library")
-]
-library mscoree
-{
-    importlib("stdole32.tlb");
-
-    //*****************************************************************************
-    //
-    //*****************************************************************************
-    [
-        object,
-        oleautomation,
-        uuid(B81FF171-20F3-11d2-8DCC-00A0C9B00522),
-        helpstring("Type name parser"),
-        pointer_default(unique)
-    ]
-    interface ITypeName : IUnknown
-    {
-        HRESULT GetNameCount([out, retval] DWORD* pCount);
-        HRESULT GetNames([in] DWORD count, [out] BSTR* rgbszNames, [out, retval] DWORD* pCount);
-        HRESULT GetTypeArgumentCount([out, retval] DWORD* pCount);
-        HRESULT GetTypeArguments([in] DWORD count, [out] ITypeName** rgpArguments, [out, retval] DWORD* pCount);
-        HRESULT GetModifierLength([out, retval] DWORD* pCount);
-        HRESULT GetModifiers([in] DWORD count, [out] DWORD* rgModifiers, [out, retval] DWORD* pCount);
-        HRESULT GetAssemblyName([out, retval] BSTR* rgbszAssemblyNames);
-    };
-
-    //*****************************************************************************
-    //
-    //*****************************************************************************
-    [
-        object,
-        oleautomation,
-        uuid(B81FF171-20F3-11d2-8DCC-00A0C9B00523),
-        helpstring("Type name builder"),
-        pointer_default(unique)
-    ]
-    interface ITypeNameBuilder : IUnknown
-    {
-        HRESULT OpenGenericArguments();
-        HRESULT CloseGenericArguments();
-        HRESULT OpenGenericArgument();
-        HRESULT CloseGenericArgument();
-        HRESULT AddName([in] LPCWSTR szName);
-        HRESULT AddPointer();
-        HRESULT AddByRef();
-        HRESULT AddSzArray();
-        HRESULT AddArray([in] DWORD rank);
-        HRESULT AddAssemblySpec([in] LPCWSTR szAssemblySpec);
-        HRESULT ToString([out, retval] BSTR* pszStringRepresentation);
-        HRESULT Clear();
-    };
-
-    //*****************************************************************************
-    //
-    //*****************************************************************************
-    [
-        object,
-        oleautomation,
-        uuid(B81FF171-20F3-11d2-8DCC-00A0C9B00521),
-        helpstring("Type name builder and parser factory"),
-        pointer_default(unique)
-    ]
-    interface ITypeNameFactory : IUnknown
-    {
-        HRESULT ParseTypeName([in] LPCWSTR szName, [out] DWORD* pError, [out, retval] ITypeName** ppTypeName);
-        HRESULT GetTypeNameBuilder([out, retval] ITypeNameBuilder** ppTypeBuilder);
-    };
-
-
-#ifdef _WIN64
-    #define CCW_PTR __int64 *
-    cpp_quote("#define CCW_PTR __int64 *")
-#else // WIN64
-    #define CCW_PTR int *
-    cpp_quote("#define CCW_PTR int *")
-#endif // WIN64
-
-#ifdef FEATURE_COMINTEROP
-    //*****************************************************************************
-    // IMarshal implementation for 1.0, 1.1, and 2.0 COM callable wrappers
-    //*****************************************************************************
-    [
-        uuid(3F281000-E95A-11d2-886B-00C04F869F04),
-        helpstring("Com Call Wrapper Unmarshalling Class")
-    ]
-    coclass ComCallUnmarshal
-    {
-        [default] interface IMarshal;
-    };
-
-    //*****************************************************************************
-    // IMarshal implementation for 4.0 COM callable wrappers
-    //*****************************************************************************
-    [
-        uuid(45FB4600-E6E8-4928-B25E-50476FF79425),
-        helpstring("Com Call Wrapper Unmarshalling Class 4.0")
-    ]
-    coclass ComCallUnmarshalV4
-    {
-        [default] interface IMarshal;
-    };
-#endif // FEATURE_COMINTEROP
-
-
-    [
-        uuid(90F1A06E-7712-4762-86B5-7A5EBA6BDB02),
-        helpstring("CLR Runtime Hosting Class V2")
-    ]
-    coclass CLRRuntimeHost
-    {
-        [default] interface ICLRRuntimeHost;
-        interface ICLRValidator;
-    };
-
-    [
-        uuid(B81FF171-20F3-11d2-8DCC-00A0C9B00525),
-        helpstring("TypeName parser and builder")
-    ]
-    coclass TypeNameFactory
-    {
-        [default] interface ITypeNameFactory;
-    };
-};
-
-typedef enum
-{
-        eCurrentContext=0x00,
-        eRestrictedContext=0x01
-} EContextType;
-
-
-#ifdef FEATURE_APPDOMAIN_RESOURCE_MONITORING
-///////////////////////////////////////////////////////////////////////////////
-//
-// ICLRAppDomainResourceMonitor
-//
-///////////////////////////////////////////////////////////////////////////////
-[
-        version(1.0),
-        uuid(c62de18c-2e23-4aea-8423-b40c1fc59eae),
-        helpstring("ARM interface"),
-        pointer_default(unique),
-        local
-]
-interface ICLRAppDomainResourceMonitor: IUnknown
-{
-    HRESULT GetCurrentAllocated([in] DWORD dwAppDomainId, 
-                                [out] ULONGLONG* pBytesAllocated);
-
-    HRESULT GetCurrentSurvived([in] DWORD dwAppDomainId, 
-                               [out] ULONGLONG* pAppDomainBytesSurvived,
-                               [out] ULONGLONG* pTotalBytesSurvived);
-
-    HRESULT GetCurrentCpuTime([in] DWORD dwAppDomainId,
-                              [out] ULONGLONG* pMilliseconds);
-
-
-};
-#endif //FEATURE_APPDOMAIN_RESOURCE_MONITORING
-
 cpp_quote("#undef DEPRECATED_CLR_STDAPI")
 cpp_quote("#undef DECLARE_DEPRECATED")
 cpp_quote("#undef DEPRECATED_CLR_API_MESG")
index 78a3d1bb60e8b586657d71649fc3a55b639919b1..66f219c8a878571c5dbf1ba129c03a8128aa4a78 100644 (file)
@@ -53,9 +53,8 @@ public:
         copy(_Ptr, _Count);
     }
 
-    basic_string(const value_type* _Ptr)
+    basic_string(const value_type* _Ptr) : basic_string(_Ptr, c_len(_Ptr))
     {
-        this->basic_string::basic_string(_Ptr, c_len(_Ptr));
     }
 
     void reserve(size_t newcapacity)
index 284bc96bf01df31cacab00961cb44e2f1c660613..c30ed62d5e09e1dc5635c644fea7901b1e350adb 100644 (file)
@@ -50,21 +50,6 @@ interface ICLRPrivBinder : IUnknown
         [in]          IAssemblyName * pAssemblyName,
         [out, retval] ICLRPrivAssembly ** ppAssembly);
 
-    /**********************************************************************************
-     ** VerifyBind
-     **********************************************************************************/
-    HRESULT VerifyBind(
-        [in] IAssemblyName * AssemblyName,
-        [in] ICLRPrivAssembly * pAssembly,
-        [in] ICLRPrivAssemblyInfo * pAssemblyInfo);
-
-    /**********************************************************************************
-     ** GetBinderFlags
-     **  pBinderFlags, pointer to binder flags.
-     **********************************************************************************/
-    HRESULT GetBinderFlags(
-        [out, retval] DWORD *pBinderFlags);
-
     /**********************************************************************************
      ** GetBinderID
      **  pBinderId, pointer to binder id. The binder id has the following properties
@@ -75,23 +60,6 @@ interface ICLRPrivBinder : IUnknown
     HRESULT GetBinderID(
         [out, retval] UINT_PTR *pBinderId);
 
-    /**********************************************************************************
-     ** FindAssemblyBySpec -- if it has been previously bound, guarantees that the same
-     ** result will be returned; if previous result was successful, the bound
-     ** ICLRPrivAssembly will be returned, and if previous result was not successful
-     ** the same failure HRESULT will be assigned to *pResult. Returns failure HR if
-     ** identity has not been requested previously.
-     **
-     **  pvAssemblySpec - the AssemblySpec identity to bind.
-     **  pResult        - the result of the previous bind request.
-     **  ppAssembly     - when successful, contains the corresponding assembly object.
-     **********************************************************************************/
-    HRESULT FindAssemblyBySpec(
-        [in]          LPVOID pvAppDomain,
-        [in]          LPVOID pvAssemblySpec,
-        [out]         HRESULT * pResult,
-        [out]         ICLRPrivAssembly ** ppAssembly);
-
     /**********************************************************************************
      ** GetLoaderAllocator
      ** Get LoaderAllocator for binders that contain it. For other binders, return
@@ -103,13 +71,6 @@ interface ICLRPrivBinder : IUnknown
         [out, retval] LPVOID * pLoaderAllocator);
 };
 
-enum CLR_PRIV_BINDER_FLAGS
-{
-    BINDER_NONE                     = 0x0,
-    BINDER_DESIGNER_BINDING_CONTEXT = 0x1,
-    BINDER_FINDASSEMBLYBYSPEC_REQUIRES_EXACT_MATCH = 0x2,
-};
-    
 /**************************************************************************************
  ** ASSEMBLY_IMAGE_TYPES - The set of assembly image formats.
  **************************************************************************************/
index 3494b05e4f9571bf94d9045fd1197d1957189a41..85ef14d8cbb4de262e789a64c4d22e185b6afd0f 100644 (file)
@@ -2026,20 +2026,12 @@ typedef enum
 
 #ifndef DEBUG_NOINLINE
 #if defined(_DEBUG)
-#define DEBUG_NOINLINE __declspec(noinline)
+#define DEBUG_NOINLINE NOINLINE
 #else
 #define DEBUG_NOINLINE
 #endif
 #endif
 
-#ifndef DBG_NOINLINE_X86__RET_INLINE
-#if defined(_DEBUG) && defined(_X86_)
-#define DBG_NOINLINE_X86__RET_INLINE __declspec(noinline)
-#else
-#define DBG_NOINLINE_X86__RET_INLINE FORCEINLINE
-#endif
-#endif
-
 #ifndef NOINLINE
 #ifdef _MSC_VER
 #define NOINLINE __declspec(noinline)
@@ -2203,8 +2195,12 @@ inline ULONG CorSigUncompressData(      // return number of bytes of that compre
 
 
 #if !defined(SELECTANY)
+#if defined(__GNUC__)
+    #define SELECTANY extern __attribute__((weak))
+#else
     #define SELECTANY extern __declspec(selectany)
 #endif
+#endif
 
 SELECTANY const mdToken g_tkCorEncodeToken[4] ={mdtTypeDef, mdtTypeRef, mdtTypeSpec, mdtBaseType};
 
index f1bed3e77bbafdaab0e10d290b0635626b4d45e1..9235a9846f4cdd7f990510897785fa46ee492afc 100644 (file)
 
 #define EXCEPTION_HIJACK  0xe0434f4e    // 0xe0000000 | 'COM'+1
 
-#ifdef FEATURE_STACK_PROBE
-#define EXCEPTION_SOFTSO  0xe053534f    // 0xe0000000 | 'SSO'
-                                        // We can not throw internal C++ exception through managed frame.
-                                        // At boundary, we will raise an exception with this error code
-#endif
-
 #if defined(_DEBUG)
 #define EXCEPTION_INTERNAL_ASSERT 0xe0584d4e // 0xe0000000 | 'XMN'
                                         // An internal Assert will raise this exception when the config
index 9b891d810c1192b406f241d94e66347384b9e5dc..6675582528424e906588cd129621b29ec6201257 100644 (file)
 #define __CORHDR_H__
 
 #define FRAMEWORK_REGISTRY_KEY          "Software\\Microsoft\\.NETFramework"
-#define FRAMEWORK_REGISTRY_KEY_W        L"Software\\Microsoft\\.NETFramework"
+#define FRAMEWORK_REGISTRY_KEY_W        W("Software\\Microsoft\\.NETFramework")
 
 // keys for HKCU
 #ifdef _WIN64    
 #define USER_FRAMEWORK_REGISTRY_KEY             "Software\\Microsoft\\.NETFramework64"
-#define USER_FRAMEWORK_REGISTRY_KEY_W        L"Software\\Microsoft\\.NETFramework64"
+#define USER_FRAMEWORK_REGISTRY_KEY_W        W("Software\\Microsoft\\.NETFramework64")
 #else
 #define USER_FRAMEWORK_REGISTRY_KEY             "Software\\Microsoft\\.NETFramework"
-#define USER_FRAMEWORK_REGISTRY_KEY_W        L"Software\\Microsoft\\.NETFramework"
+#define USER_FRAMEWORK_REGISTRY_KEY_W        W("Software\\Microsoft\\.NETFramework")
 #endif
 
 
@@ -258,18 +258,18 @@ typedef struct IMAGE_COR20_HEADER
 // The most recent version.
 
 #define COR_CTOR_METHOD_NAME        ".ctor"
-#define COR_CTOR_METHOD_NAME_W      L".ctor"
+#define COR_CTOR_METHOD_NAME_W      W(".ctor")
 #define COR_CCTOR_METHOD_NAME       ".cctor"
-#define COR_CCTOR_METHOD_NAME_W     L".cctor"
+#define COR_CCTOR_METHOD_NAME_W     W(".cctor")
 
 #define COR_ENUM_FIELD_NAME         "value__"
-#define COR_ENUM_FIELD_NAME_W       L"value__"
+#define COR_ENUM_FIELD_NAME_W       W("value__")
 
 // The predefined name for deleting a typeDef,MethodDef, FieldDef, Property and Event
 #define COR_DELETED_NAME_A          "_Deleted"
-#define COR_DELETED_NAME_W          L"_Deleted"
+#define COR_DELETED_NAME_W          W("_Deleted")
 #define COR_VTABLEGAP_NAME_A        "_VtblGap"
-#define COR_VTABLEGAP_NAME_W        L"_VtblGap"
+#define COR_VTABLEGAP_NAME_W        W("_VtblGap")
 
 // We intentionally use strncmp so that we will ignore any suffix
 #define IsDeletedName(strName)      (strncmp(strName, COR_DELETED_NAME_A, COR_DELETED_NAME_LENGTH) == 0)
@@ -1639,74 +1639,74 @@ typedef enum CorAttributeTargets
   #define IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS (IMAGE_CEE_CS_CALLCONV_DEFAULT | IMAGE_CEE_CS_CALLCONV_HASTHIS)
 #endif
 
-#define INTEROP_DISPID_TYPE_W                   L"System.Runtime.InteropServices.DispIdAttribute"
+#define INTEROP_DISPID_TYPE_W                   W("System.Runtime.InteropServices.DispIdAttribute")
 #define INTEROP_DISPID_TYPE                     "System.Runtime.InteropServices.DispIdAttribute"
 #define INTEROP_DISPID_SIG                      {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I4}
 
-#define INTEROP_INTERFACETYPE_TYPE_W            L"System.Runtime.InteropServices.InterfaceTypeAttribute"
+#define INTEROP_INTERFACETYPE_TYPE_W            W("System.Runtime.InteropServices.InterfaceTypeAttribute")
 #define INTEROP_INTERFACETYPE_TYPE              "System.Runtime.InteropServices.InterfaceTypeAttribute"
 #define INTEROP_INTERFACETYPE_SIG               {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2}
 
-#define INTEROP_CLASSINTERFACE_TYPE_W           L"System.Runtime.InteropServices.ClassInterfaceAttribute"
+#define INTEROP_CLASSINTERFACE_TYPE_W           W("System.Runtime.InteropServices.ClassInterfaceAttribute")
 #define INTEROP_CLASSINTERFACE_TYPE             "System.Runtime.InteropServices.ClassInterfaceAttribute"
 #define INTEROP_CLASSINTERFACE_SIG              {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2}
 
-#define INTEROP_COMVISIBLE_TYPE_W               L"System.Runtime.InteropServices.ComVisibleAttribute"
+#define INTEROP_COMVISIBLE_TYPE_W               W("System.Runtime.InteropServices.ComVisibleAttribute")
 #define INTEROP_COMVISIBLE_TYPE                 "System.Runtime.InteropServices.ComVisibleAttribute"
 #define INTEROP_COMVISIBLE_SIG                  {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_BOOLEAN}
 
-#define INTEROP_COMREGISTERFUNCTION_TYPE_W      L"System.Runtime.InteropServices.ComRegisterFunctionAttribute"
+#define INTEROP_COMREGISTERFUNCTION_TYPE_W      W("System.Runtime.InteropServices.ComRegisterFunctionAttribute")
 #define INTEROP_COMREGISTERFUNCTION_TYPE        "System.Runtime.InteropServices.ComRegisterFunctionAttribute"
 #define INTEROP_COMREGISTERFUNCTION_SIG         {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_COMUNREGISTERFUNCTION_TYPE_W    L"System.Runtime.InteropServices.ComUnregisterFunctionAttribute"
+#define INTEROP_COMUNREGISTERFUNCTION_TYPE_W    W("System.Runtime.InteropServices.ComUnregisterFunctionAttribute")
 #define INTEROP_COMUNREGISTERFUNCTION_TYPE      "System.Runtime.InteropServices.ComUnregisterFunctionAttribute"
 #define INTEROP_COMUNREGISTERFUNCTION_SIG       {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_IMPORTEDFROMTYPELIB_TYPE_W      L"System.Runtime.InteropServices.ImportedFromTypeLibAttribute"
+#define INTEROP_IMPORTEDFROMTYPELIB_TYPE_W      W("System.Runtime.InteropServices.ImportedFromTypeLibAttribute")
 #define INTEROP_IMPORTEDFROMTYPELIB_TYPE        "System.Runtime.InteropServices.ImportedFromTypeLibAttribute"
 #define INTEROP_IMPORTEDFROMTYPELIB_SIG         {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}
 
-#define INTEROP_PRIMARYINTEROPASSEMBLY_TYPE_W   L"System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute"
+#define INTEROP_PRIMARYINTEROPASSEMBLY_TYPE_W   W("System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute")
 #define INTEROP_PRIMARYINTEROPASSEMBLY_TYPE     "System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute"
 #define INTEROP_PRIMARYINTEROPASSEMBLY_SIG      {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 2, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I4, ELEMENT_TYPE_I4}
 
-#define INTEROP_IDISPATCHIMPL_TYPE_W            L"System.Runtime.InteropServices.IDispatchImplAttribute"
+#define INTEROP_IDISPATCHIMPL_TYPE_W            W("System.Runtime.InteropServices.IDispatchImplAttribute")
 #define INTEROP_IDISPATCHIMPL_TYPE              "System.Runtime.InteropServices.IDispatchImplAttribute"
 #define INTEROP_IDISPATCHIMPL_SIG               {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2}
 
-#define INTEROP_COMSOURCEINTERFACES_TYPE_W      L"System.Runtime.InteropServices.ComSourceInterfacesAttribute"
+#define INTEROP_COMSOURCEINTERFACES_TYPE_W      W("System.Runtime.InteropServices.ComSourceInterfacesAttribute")
 #define INTEROP_COMSOURCEINTERFACES_TYPE        "System.Runtime.InteropServices.ComSourceInterfacesAttribute"
 #define INTEROP_COMSOURCEINTERFACES_SIG         {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}
 
-#define INTEROP_COMDEFAULTINTERFACE_TYPE_W      L"System.Runtime.InteropServices.ComDefaultInterfaceAttribute"
+#define INTEROP_COMDEFAULTINTERFACE_TYPE_W      W("System.Runtime.InteropServices.ComDefaultInterfaceAttribute")
 #define INTEROP_COMDEFAULTINTERFACE_TYPE        "System.Runtime.InteropServices.ComDefaultInterfaceAttribute"
 
-#define INTEROP_COMCONVERSIONLOSS_TYPE_W        L"System.Runtime.InteropServices.ComConversionLossAttribute"
+#define INTEROP_COMCONVERSIONLOSS_TYPE_W        W("System.Runtime.InteropServices.ComConversionLossAttribute")
 #define INTEROP_COMCONVERSIONLOSS_TYPE          "System.Runtime.InteropServices.ComConversionLossAttribute"
 #define INTEROP_COMCONVERSIONLOSS_SIG           {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_BESTFITMAPPING_TYPE_W           L"System.Runtime.InteropServices.BestFitMappingAttribute"
+#define INTEROP_BESTFITMAPPING_TYPE_W           W("System.Runtime.InteropServices.BestFitMappingAttribute")
 #define INTEROP_BESTFITMAPPING_TYPE             "System.Runtime.InteropServices.BestFitMappingAttribute"
 #define INTEROP_BESTFITMAPPING_SIG              {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 2, ELEMENT_TYPE_VOID, ELEMENT_TYPE_BOOLEAN, ELEMENT_TYPE_BOOLEAN}
 
-#define INTEROP_TYPELIBTYPE_TYPE_W              L"System.Runtime.InteropServices.TypeLibTypeAttribute"
+#define INTEROP_TYPELIBTYPE_TYPE_W              W("System.Runtime.InteropServices.TypeLibTypeAttribute")
 #define INTEROP_TYPELIBTYPE_TYPE                "System.Runtime.InteropServices.TypeLibTypeAttribute"
 #define INTEROP_TYPELIBTYPE_SIG                 {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2}
 
-#define INTEROP_TYPELIBFUNC_TYPE_W              L"System.Runtime.InteropServices.TypeLibFuncAttribute"
+#define INTEROP_TYPELIBFUNC_TYPE_W              W("System.Runtime.InteropServices.TypeLibFuncAttribute")
 #define INTEROP_TYPELIBFUNC_TYPE                "System.Runtime.InteropServices.TypeLibFuncAttribute"
 #define INTEROP_TYPELIBFUNC_SIG                 {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2}
 
-#define INTEROP_TYPELIBVAR_TYPE_W               L"System.Runtime.InteropServices.TypeLibVarAttribute"
+#define INTEROP_TYPELIBVAR_TYPE_W               W("System.Runtime.InteropServices.TypeLibVarAttribute")
 #define INTEROP_TYPELIBVAR_TYPE                 "System.Runtime.InteropServices.TypeLibVarAttribute"
 #define INTEROP_TYPELIBVAR_SIG                  {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2}
 
-#define INTEROP_MARSHALAS_TYPE_W                L"System.Runtime.InteropServices.MarshalAsAttribute"
+#define INTEROP_MARSHALAS_TYPE_W                W("System.Runtime.InteropServices.MarshalAsAttribute")
 #define INTEROP_MARSHALAS_TYPE                  "System.Runtime.InteropServices.MarshalAsAttribute"
 #define INTEROP_MARSHALAS_SIG                   {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2}
 
-#define INTEROP_COMIMPORT_TYPE_W                L"System.Runtime.InteropServices.ComImportAttribute"
+#define INTEROP_COMIMPORT_TYPE_W                W("System.Runtime.InteropServices.ComImportAttribute")
 #define INTEROP_COMIMPORT_TYPE                  "System.Runtime.InteropServices.ComImportAttribute"
 #define INTEROP_COMIMPORT_SIG                   {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
@@ -1714,112 +1714,112 @@ typedef enum CorAttributeTargets
 #define INTEROP_GUID_TYPE                       "System.Runtime.InteropServices.GuidAttribute"
 #define INTEROP_GUID_SIG                        {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}
 
-#define INTEROP_DEFAULTMEMBER_TYPE_W            L"System.Reflection.DefaultMemberAttribute"
+#define INTEROP_DEFAULTMEMBER_TYPE_W            W("System.Reflection.DefaultMemberAttribute")
 #define INTEROP_DEFAULTMEMBER_TYPE              "System.Reflection.DefaultMemberAttribute"
 #define INTEROP_DEFAULTMEMBER_SIG               {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}
 
-#define INTEROP_COMEMULATE_TYPE_W               L"System.Runtime.InteropServices.ComEmulateAttribute"
+#define INTEROP_COMEMULATE_TYPE_W               W("System.Runtime.InteropServices.ComEmulateAttribute")
 #define INTEROP_COMEMULATE_TYPE                 "System.Runtime.InteropServices.ComEmulateAttribute"
 #define INTEROP_COMEMULATE_SIG                  {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}
 
-#define INTEROP_PRESERVESIG_TYPE_W              L"System.Runtime.InteropServices.PreserveSigAttribure"
+#define INTEROP_PRESERVESIG_TYPE_W              W("System.Runtime.InteropServices.PreserveSigAttribure")
 #define INTEROP_PRESERVESIG_TYPE                "System.Runtime.InteropServices.PreserveSigAttribure"
 #define INTEROP_PRESERVESIG_SIG                 {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_BOOLEAN}
 
-#define INTEROP_IN_TYPE_W                       L"System.Runtime.InteropServices.InAttribute"
+#define INTEROP_IN_TYPE_W                       W("System.Runtime.InteropServices.InAttribute")
 #define INTEROP_IN_TYPE                         "System.Runtime.InteropServices.InAttribute"
 #define INTEROP_IN_SIG                          {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_OUT_TYPE_W                      L"System.Runtime.InteropServices.OutAttribute"
+#define INTEROP_OUT_TYPE_W                      W("System.Runtime.InteropServices.OutAttribute")
 #define INTEROP_OUT_TYPE                        "System.Runtime.InteropServices.OutAttribute"
 #define INTEROP_OUT_SIG                         {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_COMALIASNAME_TYPE_W             L"System.Runtime.InteropServices.ComAliasNameAttribute"
+#define INTEROP_COMALIASNAME_TYPE_W             W("System.Runtime.InteropServices.ComAliasNameAttribute")
 #define INTEROP_COMALIASNAME_TYPE               "System.Runtime.InteropServices.ComAliasNameAttribute"
 #define INTEROP_COMALIASNAME_SIG                {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}
 
-#define INTEROP_PARAMARRAY_TYPE_W               L"System.ParamArrayAttribute"
+#define INTEROP_PARAMARRAY_TYPE_W               W("System.ParamArrayAttribute")
 #define INTEROP_PARAMARRAY_TYPE                 "System.ParamArrayAttribute"
 #define INTEROP_PARAMARRAY_SIG                  {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_LCIDCONVERSION_TYPE_W           L"System.Runtime.InteropServices.LCIDConversionAttribute"
+#define INTEROP_LCIDCONVERSION_TYPE_W           W("System.Runtime.InteropServices.LCIDConversionAttribute")
 #define INTEROP_LCIDCONVERSION_TYPE             "System.Runtime.InteropServices.LCIDConversionAttribute"
 #define INTEROP_LCIDCONVERSION_SIG              {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I4}
 
-#define INTEROP_COMSUBSTITUTABLEINTERFACE_TYPE_W    L"System.Runtime.InteropServices.ComSubstitutableInterfaceAttribute"
+#define INTEROP_COMSUBSTITUTABLEINTERFACE_TYPE_W    W("System.Runtime.InteropServices.ComSubstitutableInterfaceAttribute")
 #define INTEROP_COMSUBSTITUTABLEINTERFACE_TYPE      "System.Runtime.InteropServices.ComSubstitutableInterfaceAttribute"
 #define INTEROP_COMSUBSTITUTABLEINTERFACE_SIG       {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_DECIMALVALUE_TYPE_W             L"System.Runtime.CompilerServices.DecimalConstantAttribute"
+#define INTEROP_DECIMALVALUE_TYPE_W             W("System.Runtime.CompilerServices.DecimalConstantAttribute")
 #define INTEROP_DECIMALVALUE_TYPE               "System.Runtime.CompilerServices.DecimalConstantAttribute"
 #define INTEROP_DECIMALVALUE_SIG                {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 5, ELEMENT_TYPE_VOID, ELEMENT_TYPE_U1, ELEMENT_TYPE_U1, ELEMENT_TYPE_U4, ELEMENT_TYPE_U4, ELEMENT_TYPE_U4}
 
-#define INTEROP_DATETIMEVALUE_TYPE_W            L"System.Runtime.CompilerServices.DateTimeConstantAttribute"
+#define INTEROP_DATETIMEVALUE_TYPE_W            W("System.Runtime.CompilerServices.DateTimeConstantAttribute")
 #define INTEROP_DATETIMEVALUE_TYPE              "System.Runtime.CompilerServices.DateTimeConstantAttribute"
 #define INTEROP_DATETIMEVALUE_SIG               {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I8}
 
-#define INTEROP_IUNKNOWNVALUE_TYPE_W            L"System.Runtime.CompilerServices.IUnknownConstantAttribute"
+#define INTEROP_IUNKNOWNVALUE_TYPE_W            W("System.Runtime.CompilerServices.IUnknownConstantAttribute")
 #define INTEROP_IUNKNOWNVALUE_TYPE               "System.Runtime.CompilerServices.IUnknownConstantAttribute"
 #define INTEROP_IUNKNOWNVALUE_SIG               {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_IDISPATCHVALUE_TYPE_W           L"System.Runtime.CompilerServices.IDispatchConstantAttribute"
+#define INTEROP_IDISPATCHVALUE_TYPE_W           W("System.Runtime.CompilerServices.IDispatchConstantAttribute")
 #define INTEROP_IDISPATCHVALUE_TYPE              "System.Runtime.CompilerServices.IDispatchConstantAttribute"
 #define INTEROP_IDISPATCHVALUE_SIG              {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_AUTOPROXY_TYPE_W                L"System.Runtime.InteropServices.AutomationProxyAttribute"
+#define INTEROP_AUTOPROXY_TYPE_W                W("System.Runtime.InteropServices.AutomationProxyAttribute")
 #define INTEROP_AUTOPROXY_TYPE                  "System.Runtime.InteropServices.AutomationProxyAttribute"
 #define INTEROP_AUTOPROXY_SIG                   {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_BOOLEAN}
 
-#define INTEROP_TYPELIBIMPORTCLASS_TYPE_W       L"System.Runtime.InteropServices.TypeLibImportClassAttribute"
+#define INTEROP_TYPELIBIMPORTCLASS_TYPE_W       W("System.Runtime.InteropServices.TypeLibImportClassAttribute")
 #define INTEROP_TYPELIBIMPORTCLASS_TYPE         "System.Runtime.InteropServices.TypeLibImportClassAttribute"
 
 
-#define INTEROP_TYPELIBVERSION_TYPE_W           L"System.Runtime.InteropServices.TypeLibVersionAttribute"
+#define INTEROP_TYPELIBVERSION_TYPE_W           W("System.Runtime.InteropServices.TypeLibVersionAttribute")
 #define INTEROP_TYPELIBVERSION_TYPE             "System.Runtime.InteropServices.TypeLibVersionAttribute"
 #define INTEROP_TYPELIBVERSION_SIG              {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 2, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2, ELEMENT_TYPE_I2}
 
-#define INTEROP_COMCOMPATIBLEVERSION_TYPE_W     L"System.Runtime.InteropServices.ComCompatibleVersionAttribute"
+#define INTEROP_COMCOMPATIBLEVERSION_TYPE_W     W("System.Runtime.InteropServices.ComCompatibleVersionAttribute")
 #define INTEROP_COMCOMPATIBLEVERSION_TYPE       "System.Runtime.InteropServices.ComCompatibleVersionAttribute"
 #define INTEROP_COMCOMPATIBLEVERSION_SIG        {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 4, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2, ELEMENT_TYPE_I2, ELEMENT_TYPE_I2, ELEMENT_TYPE_I2}
 
-#define INTEROP_COMEVENTINTERFACE_TYPE_W        L"System.Runtime.InteropServices.ComEventInterfaceAttribute"
+#define INTEROP_COMEVENTINTERFACE_TYPE_W        W("System.Runtime.InteropServices.ComEventInterfaceAttribute")
 #define INTEROP_COMEVENTINTERFACE_TYPE          "System.Runtime.InteropServices.ComEventInterfaceAttribute"
 
-#define INTEROP_COCLASS_TYPE_W                  L"System.Runtime.InteropServices.CoClassAttribute"
+#define INTEROP_COCLASS_TYPE_W                  W("System.Runtime.InteropServices.CoClassAttribute")
 #define INTEROP_COCLASS_TYPE                    "System.Runtime.InteropServices.CoClassAttribute"
 
-#define INTEROP_SERIALIZABLE_TYPE_W             L"System.SerializableAttribute"
+#define INTEROP_SERIALIZABLE_TYPE_W             W("System.SerializableAttribute")
 #define INTEROP_SERIALIZABLE_TYPE               "System.SerializableAttribute"
 #define INTEROP_SERIALIZABLE_SIG                {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define INTEROP_SETWIN32CONTEXTINIDISPATCHATTRIBUTE_TYPE_W  L"System.Runtime.InteropServices.SetWin32ContextInIDispatchAttribute"
+#define INTEROP_SETWIN32CONTEXTINIDISPATCHATTRIBUTE_TYPE_W  W("System.Runtime.InteropServices.SetWin32ContextInIDispatchAttribute")
 #define INTEROP_SETWIN32CONTEXTINIDISPATCHATTRIBUTE_TYPE     "System.Runtime.InteropServices.SetWin32ContextInIDispatchAttribute"
 #define INTEROP_SETWIN32CONTEXTINIDISPATCHATTRIBUTE_SIG     {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define FORWARD_INTEROP_STUB_METHOD_TYPE_W      L"System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute"
+#define FORWARD_INTEROP_STUB_METHOD_TYPE_W      W("System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute")
 #define FORWARD_INTEROP_STUB_METHOD_TYPE        "System.Runtime.InteropServices.ManagedToNativeComInteropStubAttribute"
 
-#define FRIEND_ASSEMBLY_TYPE_W                  L"System.Runtime.CompilerServices.InternalsVisibleToAttribute"
+#define FRIEND_ASSEMBLY_TYPE_W                  W("System.Runtime.CompilerServices.InternalsVisibleToAttribute")
 #define FRIEND_ASSEMBLY_TYPE                     "System.Runtime.CompilerServices.InternalsVisibleToAttribute"
 #define FRIEND_ASSEMBLY_SIG                     {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 2, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING, ELEMENT_TYPE_BOOLEAN}
 
-#define SUBJECT_ASSEMBLY_TYPE_W                 L"System.Runtime.CompilerServices.IgnoresAccessChecksToAttribute"
+#define SUBJECT_ASSEMBLY_TYPE_W                 W("System.Runtime.CompilerServices.IgnoresAccessChecksToAttribute")
 #define SUBJECT_ASSEMBLY_TYPE                    "System.Runtime.CompilerServices.IgnoresAccessChecksToAttribute"
 #define SUBJECT_ASSEMBLY_SIG                    {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}
 
-#define DISABLED_PRIVATE_REFLECTION_TYPE_W      L"System.Runtime.CompilerServices.DisablePrivateReflectionAttribute"
+#define DISABLED_PRIVATE_REFLECTION_TYPE_W      W("System.Runtime.CompilerServices.DisablePrivateReflectionAttribute")
 #define DISABLED_PRIVATE_REFLECTION_TYPE         "System.Runtime.CompilerServices.DisablePrivateReflectionAttribute"
 #define DISABLED_PRIVATE_REFLECTION_SIG         {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define DEFAULTDOMAIN_STA_TYPE_W                L"System.STAThreadAttribute"
+#define DEFAULTDOMAIN_STA_TYPE_W                W("System.STAThreadAttribute")
 #define DEFAULTDOMAIN_STA_TYPE                   "System.STAThreadAttribute"
 #define DEFAULTDOMAIN_STA_SIG                   {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define DEFAULTDOMAIN_MTA_TYPE_W                L"System.MTAThreadAttribute"
+#define DEFAULTDOMAIN_MTA_TYPE_W                W("System.MTAThreadAttribute")
 #define DEFAULTDOMAIN_MTA_TYPE                   "System.MTAThreadAttribute"
 #define DEFAULTDOMAIN_MTA_SIG                   {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}
 
-#define NONVERSIONABLE_TYPE_W                   L"System.Runtime.Versioning.NonVersionableAttribute"
+#define NONVERSIONABLE_TYPE_W                   W("System.Runtime.Versioning.NonVersionableAttribute")
 #define NONVERSIONABLE_TYPE                      "System.Runtime.Versioning.NonVersionableAttribute"
 
 // Keep in sync with CompilationRelaxations.cs
@@ -1829,12 +1829,12 @@ typedef enum CompilationRelaxationsEnum
         
 } CompilationRelaxationEnum;
 
-#define COMPILATIONRELAXATIONS_TYPE_W           L"System.Runtime.CompilerServices.CompilationRelaxationsAttribute"
+#define COMPILATIONRELAXATIONS_TYPE_W           W("System.Runtime.CompilerServices.CompilationRelaxationsAttribute")
 #define COMPILATIONRELAXATIONS_TYPE             "System.Runtime.CompilerServices.CompilationRelaxationsAttribute"
 
 
 // Keep in sync with RuntimeCompatibilityAttribute.cs
-#define RUNTIMECOMPATIBILITY_TYPE_W             L"System.Runtime.CompilerServices.RuntimeCompatibilityAttribute"
+#define RUNTIMECOMPATIBILITY_TYPE_W             W("System.Runtime.CompilerServices.RuntimeCompatibilityAttribute")
 #define RUNTIMECOMPATIBILITY_TYPE               "System.Runtime.CompilerServices.RuntimeCompatibilityAttribute"
 
 
@@ -1858,16 +1858,16 @@ typedef enum LoadHintEnum
     LoadNever               = 0x0003  // Dependency is never loaded
 } LoadHintEnum;
 
-#define DEFAULTDEPENDENCY_TYPE_W                L"System.Runtime.CompilerServices.DefaultDependencyAttribute"
+#define DEFAULTDEPENDENCY_TYPE_W                W("System.Runtime.CompilerServices.DefaultDependencyAttribute")
 #define DEFAULTDEPENDENCY_TYPE                  "System.Runtime.CompilerServices.DefaultDependencyAttribute"
 
-#define DEPENDENCY_TYPE_W                       L"System.Runtime.CompilerServices.DependencyAttribute"
+#define DEPENDENCY_TYPE_W                       W("System.Runtime.CompilerServices.DependencyAttribute")
 #define DEPENDENCY_TYPE                         "System.Runtime.CompilerServices.DependencyAttribute"
 
-#define TARGET_FRAMEWORK_TYPE_W                 L"System.Runtime.Versioning.TargetFrameworkAttribute"
+#define TARGET_FRAMEWORK_TYPE_W                 W("System.Runtime.Versioning.TargetFrameworkAttribute")
 #define TARGET_FRAMEWORK_TYPE                   "System.Runtime.Versioning.TargetFrameworkAttribute"
 
-#define ASSEMBLY_METADATA_TYPE_W                L"System.Reflection.AssemblyMetadataAttribute"
+#define ASSEMBLY_METADATA_TYPE_W                W("System.Reflection.AssemblyMetadataAttribute")
 #define ASSEMBLY_METADATA_TYPE                  "System.Reflection.AssemblyMetadataAttribute"
 
 
index feeac08c5184a63128eadea3a1909157be271cbd..f8295886ba020c6b4cc1d5d7177993ff2389be5a 100644 (file)
@@ -627,9 +627,21 @@ typedef enum
 
     COR_PRF_HIGH_DISABLE_TIERED_COMPILATION         = 0x00000008,
 
+    COR_PRF_HIGH_BASIC_GC                           = 0x00000010,
+
+    // Enables the MovedReferences/MovedReferences2 callback for compacting GCs only.
+    COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS           = 0x00000020,
+
     COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE              = 0,
 
-    COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH             = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS,
+    // Enables the large object allocation monitoring according to the LOH threshold.
+    COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED      = 0x00000040,
+
+    COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH             = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | 
+                                                      COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS | 
+                                                      COR_PRF_HIGH_BASIC_GC |
+                                                      COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS |
+                                                      COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED,
 
     // MONITOR_IMMUTABLE represents all flags that may only be set during initialization.
     // Trying to change any of these flags elsewhere will result in a
@@ -705,6 +717,21 @@ typedef enum
     COR_PRF_CORE_CLR    = 0x2,
 } COR_PRF_RUNTIME_TYPE;
 
+/*
+ * COR_PRF_REJIT_FLAGS contains values used to control the behavior of
+ * RequestReJITWithInliners.
+ */
+typedef enum
+{
+    // ReJITted methods will be prevented from being inlined
+    COR_PRF_REJIT_BLOCK_INLINING = 0x1,
+
+    // This flag controls whether the runtime will call GetReJITParameters
+    // on methods that are ReJITted because they inline a method that was requested
+    // for ReJIT
+    COR_PRF_REJIT_INLINING_CALLBACKS    = 0x2
+} COR_PRF_REJIT_FLAGS;
+
 
 /* -------------------------------------------------------------------------- *
  * Forward declarations
@@ -3909,6 +3936,41 @@ interface ICorProfilerInfo9 : ICorProfilerInfo8
 
     //Given the native code start address, return the the blocks of virtual memory that store this code (method code is not necessarily stored in a single contiguous memory region)
     HRESULT GetCodeInfo4(UINT_PTR pNativeCodeStartAddress, ULONG32 cCodeInfos, ULONG32* pcCodeInfos, COR_PRF_CODE_INFO codeInfos[]);
+};
+
+[
+    object,
+    uuid(2F1B5152-C869-40C9-AA5F-3ABE026BD720),
+    pointer_default(unique),
+    local
+]
+interface ICorProfilerInfo10 : ICorProfilerInfo9
+{
+    // Given an ObjectID, fetches all its object references and offsets (if any).
+    HRESULT GetObjectReferences(ObjectID objectId, ULONG32 cNumReferences, ULONG32 *pcNumReferences, ObjectID references[], SIZE_T offsets[]);
+
+    // Given an ObjectID, determines whether it is in a read only segment.
+    HRESULT IsFrozenObject(ObjectID objectId, BOOL *pbFrozen);
+
+    // Gets the value of the configured LOH Threshold.
+    HRESULT GetLOHObjectSizeThreshold(DWORD *pThreshold);
+
+    /*
+     * This method will ReJIT the methods requested, as well as any inliners
+     * of the methods requested.
+     * 
+     * RequestReJIT does not do any tracking of inlined methods. The profiler
+     * was expected to track inlining and call RequestReJIT for all inliners
+     * to make sure every instance of an inlined method was ReJITted.
+     * This poses a problem with ReJIT on attach, since the profiler was
+     * not present to monitor inlining. This method can be called to guarantee
+     * that the full set of inliners will be ReJITted as well.
+     */
+    HRESULT RequestReJITWithInliners(
+                [in]                       DWORD       dwRejitFlags,
+                [in]                       ULONG       cFunctions,
+                [in, size_is(cFunctions)]  ModuleID    moduleIds[],
+                [in, size_is(cFunctions)]  mdMethodDef methodIds[]);
 }
 
 /*
index 8fdfe43c5fa9bc96b0469062ddf462fb202c82a2..6cc73257684e79d5a5467d4c1d25c68b2963a88c 100644 (file)
@@ -4,6 +4,14 @@
 
 // This describes information about the COM+ primitive types
 
+//
+// Note: This file gets parsed by the Mono IL Linker (https://github.com/mono/linker/) which may throw an exception during parsing.
+// Specifically, this (https://github.com/mono/linker/blob/master/corebuild/integration/ILLink.Tasks/CreateRuntimeRootDescriptorFile.cs) will try to 
+// parse this header, and it may throw an exception while doing that. If you edit this file and get a build failure on msbuild.exe D:\repos\coreclr\build.proj
+// you might want to check out the parser linked above.
+//
+
+
 #define NO_SIZE ((BYTE)-1)
 
 // TYPEINFO(type (CorElementType),  namespace, class,          size,                 gcType,         isArray,isPrim, isFloat,isModifier,isGenVariable)
index ef809cb69d165b46d5dc10e8aef2b626a61ab31f..540be99c74070d89cc100910a5b1e240fe20cff3 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "stacktrace.h"
 #include "debugmacrosext.h"
+#include "palclr.h"
 
 #undef _ASSERTE
 #undef VERIFY
@@ -29,7 +30,7 @@ bool GetStackTraceAtContext(SString & s, struct _CONTEXT * pContext);
 void _cdecl DbgWriteEx(LPCTSTR szFmt, ...);
 bool _DbgBreakCheck(LPCSTR szFile, int iLine, LPCSTR szExpr, BOOL fConstrained = FALSE);
 
-extern VOID DbgAssertDialog(const char *szFile, int iLine, const char *szExpr);
+extern VOID ANALYZER_NORETURN DbgAssertDialog(const char *szFile, int iLine, const char *szExpr);
 
 #define TRACE_BUFF_SIZE (cchMaxAssertStackLevelStringLen * cfrMaxAssertStackLevels + cchMaxAssertExprLen + 1)
 extern char g_szExprWithStack[TRACE_BUFF_SIZE];
index a2a2e8ccd58f5557935b1823fe298caf4bcdc96d..bcbb5a12315411f96126876c6388925158a8f26c 100644 (file)
@@ -13,6 +13,10 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 */
 
+// ******************************************************************************
+// WARNING!!!: This code is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/gcdecoder.cpp
+// ******************************************************************************
 
 #ifdef _TARGET_X86_
 
index 3271ca1d6bdcc29c3e9403de89d471e95ea8c2b7..f8bffe7622bc1b86ece4f2a6239654cb67149b21 100644 (file)
  * to the standard code-manager spec.
  */
 
+// ******************************************************************************
+// WARNING!!!: This header is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/gcdump.h
+// ******************************************************************************
+
 /*****************************************************************************/
 #ifndef __GCDUMP_H__
 #define __GCDUMP_H__
index 901f2cfc0762cd454528408e8395a83b97b2efed..97ff737117bc652e946eb4307575c77058d0cc9a 100644 (file)
@@ -3,6 +3,11 @@
 // See the LICENSE file in the project root for more information.
 
 
+// ******************************************************************************
+// WARNING!!!: This header is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/gcinfo.h
+// ******************************************************************************
+
 /*****************************************************************************/
 #ifndef _GCINFO_H_
 #define _GCINFO_H_
index e8fe6b95233e7056ae8ba88de3205037578e0cb1..b2c89d8538b0b356e66019ebd09c97c094706ad9 100644 (file)
@@ -8,6 +8,11 @@
  *
  *****************************************************************/
 
+// ******************************************************************************
+// WARNING!!!: This header is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/gcinfodecoder.h
+// ******************************************************************************
+
 #ifndef _GC_INFO_DECODER_
 #define _GC_INFO_DECODER_
 
index 296dd295435af3589bf8664da16ae2cb5dd96af7..e3ad734da9ffabb145582aff3a0679c1f8b5e1d8 100644 (file)
@@ -8,6 +8,10 @@
 #include "gcinfotypes.h"
 #include "gcinfodecoder.h"
 
+// ******************************************************************************
+// WARNING!!!: This header is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/gcinfodumper.h
+// ******************************************************************************
 
 //
 // This class dumps the contents of the gc encodings, providing outputs
index ac82dfb2fce9c9a58011bf263af5d0cb68a4b885..4a1992a7c9daf9dae1269b08563271374a03ae7a 100644 (file)
 #include "gcinfo.h"
 #endif
 
+// ******************************************************************************
+// WARNING!!!: This header is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/gcinfotypes.h
+// ******************************************************************************
 
 #define PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
 
index 76ade76c09ef7cbc82614e534e78707176a5b344..204f807a08cfa0abc80cc8020b96d198aea474b1 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <wincrypt.h>
 #include "cor.h"
-#include "genericstackprobe.h"
 #include "staticcontract.h"
 #include "volatile.h"
 #include "palclr.h"
         _NAME & operator=(_NAME const &);
 #endif
 
-
 #ifdef _DEBUG
 
-
 //------------------------------------------------------------------------------------------------
 // This is used to make Visual Studio autoexp.dat work sensibly with holders again.
 // The problem is that certain codebases (particulary Fusion) implement key data structures
@@ -131,11 +128,6 @@ class HolderBase
     HolderBase(TYPE value)
       : m_value(value)
     {
-        // TODO: Find a way to enable this check.
-        // We can have a holder in SO tolerant, then probe, then acquire a value.  This works
-        // because the dtor is guaranteed to run with enough stack.
-        // EnsureSOIntolerantOK(__FUNCTION__, __FILE__, __LINE__);
-
 #ifdef _DEBUG
         m_pAutoExpVisibleValue = (const AutoExpVisibleValue *)(&m_value);
 #endif //_DEBUG
@@ -238,8 +230,7 @@ template
         typename TYPE,
         typename BASE,
         UINT_PTR DEFAULTVALUE = 0,
-        BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>,
-        HolderStackValidation VALIDATION_TYPE = HSV_ValidateNormalStackReq
+        BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>
     >
 class BaseHolder : protected BASE
 {
@@ -303,16 +294,7 @@ class BaseHolder : protected BASE
         if (m_acquired)
         {
             _ASSERTE(!IsNull());
-        
-            if (VALIDATION_TYPE != HSV_NoValidation)
-            {
-                VALIDATE_HOLDER_STACK_CONSUMPTION_FOR_TYPE(VALIDATION_TYPE);
-                this->DoRelease();
-            }
-            else
-            {
-                this->DoRelease();
-            }
+            this->DoRelease();
             m_acquired = FALSE;
         }
     }
@@ -347,7 +329,7 @@ class BaseHolder : protected BASE
     HIDE_GENERATED_METHODS(BaseHolder)
 };  // BaseHolder<>
 
-template <void (*ACQUIRE)(), void (*RELEASEF)(), HolderStackValidation VALIDATION_TYPE = HSV_ValidateNormalStackReq>
+template <void (*ACQUIRE)(), void (*RELEASEF)()>
 class StateHolder
 {
   private:
@@ -383,15 +365,7 @@ class StateHolder
 
         if (m_acquired)
         {
-            if (VALIDATION_TYPE != HSV_NoValidation)
-            {
-                VALIDATE_HOLDER_STACK_CONSUMPTION_FOR_TYPE(VALIDATION_TYPE);
-                RELEASEF();
-            }
-            else
-            {
-                RELEASEF();
-            }
+            RELEASEF();
             m_acquired = FALSE;
         }
     }
@@ -415,7 +389,7 @@ class StateHolder
 };  // class StateHolder<>
 
 // Holder for the case where the acquire function can fail.
-template <typename VALUE, BOOL (*ACQUIRE)(VALUE value), void (*RELEASEF)(VALUE value), HolderStackValidation VALIDATION_TYPE = HSV_ValidateNormalStackReq>
+template <typename VALUE, BOOL (*ACQUIRE)(VALUE value), void (*RELEASEF)(VALUE value)>
 class ConditionalStateHolder
 {
   private:
@@ -453,15 +427,7 @@ class ConditionalStateHolder
 
         if (m_acquired)
         {
-            if (VALIDATION_TYPE != HSV_NoValidation)
-            {
-                VALIDATE_HOLDER_STACK_CONSUMPTION_FOR_TYPE(VALIDATION_TYPE);
-                RELEASEF(m_value);
-            }
-            else
-            {
-                RELEASEF(m_value);
-            }
+            RELEASEF(m_value);
             m_acquired = FALSE;
         }
     }
@@ -503,10 +469,10 @@ class ConditionalStateHolder
 // the value it contains.
 //-----------------------------------------------------------------------------
 template <typename TYPE, typename BASE,
-          UINT_PTR DEFAULTVALUE = 0, BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>, HolderStackValidation VALIDATION_TYPE = HSV_ValidateNormalStackReq> 
-class BaseWrapper : public BaseHolder<TYPE, BASE, DEFAULTVALUE, IS_NULL, VALIDATION_TYPE>
+          UINT_PTR DEFAULTVALUE = 0, BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>>
+class BaseWrapper : public BaseHolder<TYPE, BASE, DEFAULTVALUE, IS_NULL>
 {
-    typedef BaseHolder<TYPE, BASE, DEFAULTVALUE, IS_NULL, VALIDATION_TYPE> BaseT;
+    typedef BaseHolder<TYPE, BASE, DEFAULTVALUE, IS_NULL> BaseT;
 
 
 #ifdef __GNUC__
@@ -642,7 +608,7 @@ class BaseWrapper : public BaseHolder<TYPE, BASE, DEFAULTVALUE, IS_NULL, VALIDAT
     {
         return !!(this->m_value != TYPE(value));
     }
-#ifdef __llvm__
+#ifdef __GNUC__
     // This handles the NULL value that is an int and clang
     // doesn't want to convert int to a pointer
     FORCEINLINE bool operator==(int value) const
@@ -653,7 +619,7 @@ class BaseWrapper : public BaseHolder<TYPE, BASE, DEFAULTVALUE, IS_NULL, VALIDAT
     {
         return !!(this->m_value != TYPE((void*)(SIZE_T)value));
     }
-#endif // __llvm__
+#endif // __GNUC__
     FORCEINLINE const TYPE &operator->() const
     {
         return this->m_value;
@@ -728,14 +694,12 @@ FORCEINLINE void SafeArrayDoNothing(SAFEARRAY* p)
 }
 
 
-
-
 //-----------------------------------------------------------------------------
 // Holder/Wrapper are the simplest way to define holders - they synthesizes a base class out of 
 // function pointers
 //-----------------------------------------------------------------------------
 
-template <typename TYPE, void (*ACQUIREF)(TYPE), void (*RELEASEF)(TYPE), HolderStackValidation VALIDATION_TYPE = HSV_ValidateNormalStackReq>  
+template <typename TYPE, void (*ACQUIREF)(TYPE), void (*RELEASEF)(TYPE)>
 class FunctionBase : protected HolderBase<TYPE>
 {
   protected:
@@ -752,17 +716,7 @@ class FunctionBase : protected HolderBase<TYPE>
 
     void DoRelease()
     {
-        // <TODO> Consider removing this stack validation since it is redundant with the
-        // one that is already being done in BaseHolder & BaseWrapper. </TODO>
-        if (VALIDATION_TYPE != HSV_NoValidation)
-        {
-            VALIDATE_HOLDER_STACK_CONSUMPTION_FOR_TYPE(VALIDATION_TYPE);
-            RELEASEF(this->m_value);
-        }
-        else
-        {
-            RELEASEF(this->m_value);
-        }
+        RELEASEF(this->m_value);
     }
 };  // class Function<>
 
@@ -773,17 +727,16 @@ template
         void (*RELEASEF)(TYPE),
         UINT_PTR DEFAULTVALUE = 0, 
         BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>,
-        HolderStackValidation VALIDATION_TYPE = HSV_ValidateNormalStackReq,
         // For legacy compat (see EEJitManager::WriterLockHolder), where default ctor
         // causes ACQUIREF(DEFAULTVALUE), but ACQUIREF ignores the argument and
         // operates on static or global value instead.
         bool DEFAULT_CTOR_ACQUIRE = true
     >
-class Holder : public BaseHolder<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF, VALIDATION_TYPE>,
-                                 DEFAULTVALUE, IS_NULL, VALIDATION_TYPE>
+class Holder : public BaseHolder<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF>,
+                                 DEFAULTVALUE, IS_NULL>
 {
-    typedef BaseHolder<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF, VALIDATION_TYPE>,
-                                 DEFAULTVALUE, IS_NULL, VALIDATION_TYPE> BaseT;
+    typedef BaseHolder<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF>,
+                                 DEFAULTVALUE, IS_NULL> BaseT;
 
   public:
     FORCEINLINE Holder()
@@ -823,17 +776,16 @@ template
         void (*RELEASEF)(TYPE),
         UINT_PTR DEFAULTVALUE = 0,
         BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>,
-        HolderStackValidation VALIDATION_TYPE = HSV_ValidateNormalStackReq,
         // For legacy compat (see EEJitManager::WriterLockHolder), where default ctor
         // causes ACQUIREF(DEFAULTVALUE), but ACQUIREF ignores the argument and
         // operates on static or global value instead.
         bool DEFAULT_CTOR_ACQUIRE = true
     >
-class Wrapper : public BaseWrapper<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF, VALIDATION_TYPE>,
-                                   DEFAULTVALUE, IS_NULL, VALIDATION_TYPE>
+class Wrapper : public BaseWrapper<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF>,
+                                   DEFAULTVALUE, IS_NULL>
 {
-    typedef BaseWrapper<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF, VALIDATION_TYPE>,
-                                   DEFAULTVALUE, IS_NULL, VALIDATION_TYPE> BaseT;
+    typedef BaseWrapper<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF>,
+                                   DEFAULTVALUE, IS_NULL> BaseT;
 
   public:
     FORCEINLINE Wrapper()
@@ -974,7 +926,6 @@ FORCEINLINE void DoTheRelease(TYPE *value)
 {
     if (value)
     {
-        VALIDATE_HOLDER_STACK_CONSUMPTION_FOR_TYPE(HSV_ValidateNormalStackReq);
         value->Release();
     }
 }
@@ -1221,7 +1172,7 @@ typedef Wrapper< bool *, BoolSet, BoolUnset > BoolFlagStateHolder;
 FORCEINLINE void CounterIncrease(RAW_KEYWORD(volatile) LONG* p) {InterlockedIncrement(p);};
 FORCEINLINE void CounterDecrease(RAW_KEYWORD(volatile) LONG* p) {InterlockedDecrement(p);};
 
-typedef Wrapper<RAW_KEYWORD(volatile) LONG*, CounterIncrease, CounterDecrease, (UINT_PTR)0, CompareDefault<RAW_KEYWORD(volatile) LONG*>, HSV_NoValidation> CounterHolder;
+typedef Wrapper<RAW_KEYWORD(volatile) LONG*, CounterIncrease, CounterDecrease, (UINT_PTR)0, CompareDefault<RAW_KEYWORD(volatile) LONG*>> CounterHolder;
 
 
 #ifndef FEATURE_PAL
index e7fbd519d9a7fe7d6d3a311a76f0fe012a612085..76a9897b534c90c29a48c77c1bf279141b3e6c19 100644 (file)
@@ -16,7 +16,7 @@ DEFINE_LOG_FACILITY(LF_GCALLOC           ,0x00000100)
 DEFINE_LOG_FACILITY(LF_CORDB             ,0x00000200)
 DEFINE_LOG_FACILITY(LF_CLASSLOADER       ,0x00000400)
 DEFINE_LOG_FACILITY(LF_CORPROF           ,0x00000800)
-DEFINE_LOG_FACILITY(LF_REMOTING          ,0x00001000)
+DEFINE_LOG_FACILITY(LF_DIAGNOSTICS_PORT  ,0x00001000)
 DEFINE_LOG_FACILITY(LF_DBGALLOC          ,0x00002000)
 DEFINE_LOG_FACILITY(LF_EH                ,0x00004000)
 DEFINE_LOG_FACILITY(LF_ENC               ,0x00008000)
index 4a430276da2f900d8e83cf5488a8887a6511717b..b7c2e0ba67750f81c6059330321a7c001b3ba3bf 100644 (file)
@@ -37,32 +37,15 @@ import "ocidl.idl";
 import "mscoree.idl";
 
 cpp_quote("#include <winapifamily.h>")
-cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
 
-/**************************************************************************************
- ** This should be the only flat public API exposed from mscoree going forward.      **
- ** The returned interface is likely to be implemented in a separate versioned DLL   **
- ** (mscorhst.dll living in the versioned directory for instance). Acceptable values **
- ** for riid in v4.0 are IID_ICLRMetaHost, IID_ICLRMetaHostPolicy and                **
- ** IID_ICLRDebugging.                                                               **
- **************************************************************************************/
 cpp_quote("STDAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, /*iid_is(riid)*/ LPVOID *ppInterface);")
 
-// CLSID CLRStrongName : uuid(B79B0ACD-F5CD-409b-B5A5-A16244610B92)
-cpp_quote("EXTERN_GUID(CLSID_CLRStrongName, 0xB79B0ACD, 0xF5CD, 0x409b, 0xB5, 0xA5, 0xA1, 0x62, 0x44, 0x61, 0x0B, 0x92);")
-
 // IID ICLRMetaHost : uuid(D332DB9E-B9B3-4125-8207-A14884F53216)
 cpp_quote("EXTERN_GUID(IID_ICLRMetaHost, 0xD332DB9E, 0xB9B3, 0x4125, 0x82, 0x07, 0xA1, 0x48, 0x84, 0xF5, 0x32, 0x16);")
 
 // CLSID_CLRMetaHost : uuid(9280188D-0E8E-4867-B30C-7FA83884E8DE)
 cpp_quote("EXTERN_GUID(CLSID_CLRMetaHost, 0x9280188d, 0xe8e, 0x4867, 0xb3, 0xc, 0x7f, 0xa8, 0x38, 0x84, 0xe8, 0xde);")
 
-// IID ICLRMetaHostPolicy : uuid(E2190695-77B2-492e-8E14-C4B3A7FDD593)
-cpp_quote("EXTERN_GUID(IID_ICLRMetaHostPolicy, 0xE2190695, 0x77B2, 0x492e, 0x8E, 0x14, 0xC4, 0xB3, 0xA7, 0xFD, 0xD5, 0x93);")
-
-// CLSID_CLRMetaHostPolicy : uuid(2EBCD49A-1B47-4a61-B13A-4A03701E594B)
-cpp_quote("EXTERN_GUID(CLSID_CLRMetaHostPolicy, 0x2ebcd49a, 0x1b47, 0x4a61, 0xb1, 0x3a, 0x4a, 0x3, 0x70, 0x1e, 0x59, 0x4b);")
-
 // IID ICLRDebugging : uuid(D28F3C5A-9634-4206-A509-477552EEFB10)
 cpp_quote("EXTERN_GUID(IID_ICLRDebugging, 0xd28f3c5a, 0x9634, 0x4206, 0xa5, 0x9, 0x47, 0x75, 0x52, 0xee, 0xfb, 0x10);")
 
@@ -72,37 +55,12 @@ cpp_quote("EXTERN_GUID(CLSID_CLRDebugging, 0xbacc578d, 0xfbdd, 0x48a4, 0x96, 0x9
 // IID ICLRRuntimeInfo : uuid(BD39D1D2-BA2F-486a-89B0-B4B0CB466891)
 cpp_quote("EXTERN_GUID(IID_ICLRRuntimeInfo, 0xBD39D1D2, 0xBA2F, 0x486a, 0x89, 0xB0, 0xB4, 0xB0, 0xCB, 0x46, 0x68, 0x91);")
 
-// IID ICLRStrongName : uuid(9FD93CCF-3280-4391-B3A9-96E1CDE77C8D)
-cpp_quote("EXTERN_GUID(IID_ICLRStrongName, 0x9FD93CCF, 0x3280, 0x4391, 0xB3, 0xA9, 0x96, 0xE1, 0xCD, 0xE7, 0x7C, 0x8D);")
-
-// IID ICLRStrongName2 : uuid(C22ED5C5-4B59-4975-90EB-85EA55C0069B)
-cpp_quote("EXTERN_GUID(IID_ICLRStrongName2, 0xC22ED5C5, 0x4B59, 0x4975, 0x90, 0xEB, 0x85, 0xEA, 0x55, 0xC0, 0x06, 0x9B);")
-
-// IID ICLRStrongName3 : uuid(22c7089b-bbd3-414a-b698-210f263f1fed)
-cpp_quote("EXTERN_GUID(IID_ICLRStrongName3, 0x22c7089b, 0xbbd3, 0x414a, 0xb6, 0x98, 0x21, 0x0f, 0x26, 0x3f, 0x1f, 0xed);")
-
-// CLSID for legacy debugging interface : uuid(DF8395B5-A4BA-450b-A77C-A9A47762C520}
-cpp_quote("EXTERN_GUID(CLSID_CLRDebuggingLegacy, 0xDF8395B5, 0xA4BA, 0x450b, 0xA7, 0x7C, 0xA9, 0xA4, 0x77, 0x62, 0xC5, 0x20);")
-
-// CLSID CLRProfiling interface : uuid{BD097ED8-733E-43fe-8ED7-A95FF9A8448C}
-cpp_quote("EXTERN_GUID(CLSID_CLRProfiling, 0xbd097ed8, 0x733e, 0x43fe, 0x8e, 0xd7, 0xa9, 0x5f, 0xf9, 0xa8, 0x44, 0x8c);")
-
 // IID ICLRDebuggingLibraryProvider interface : uuid{3151C08D-4D09-4f9b-8838-2880BF18FE51}
 cpp_quote("EXTERN_GUID(IID_ICLRDebuggingLibraryProvider, 0x3151c08d, 0x4d09, 0x4f9b, 0x88, 0x38, 0x28, 0x80, 0xbf, 0x18, 0xfe, 0x51);")
 
 // IID ICLRDebuggingLibraryProvider2 interface : uuid{E04E2FF1-DCFD-45D5-BCD1-16FFF2FAF7BA}
 cpp_quote("EXTERN_GUID(IID_ICLRDebuggingLibraryProvider2, 0xE04E2FF1, 0xDCFD, 0x45D5, 0xBC, 0xD1, 0x16, 0xFF, 0xF2, 0xFA, 0xF7, 0xBA);")
 
-typedef HRESULT(__stdcall * CLRCreateInstanceFnPtr)(
-        REFCLSID clsid,
-        REFIID riid,
-        LPVOID *ppInterface);
-
-typedef HRESULT(__stdcall * CreateInterfaceFnPtr)(
-        REFCLSID clsid,
-        REFIID riid,
-        LPVOID *ppInterface);
-
 // For use in ICLRMetaHost::RequestRuntimeLoadedNotification
 interface ICLRRuntimeInfo;
 
@@ -211,125 +169,6 @@ interface ICLRMetaHost : IUnknown
         [in] INT32 iExitCode);
 } // interface ICLRMetaHost
 
-typedef enum
-{
-    /**********************************************************************************
-     ** Functions will not take into account runtimes already loaded into the        **
-     ** process (thus guaranteed to give the same answer regardless of load order).  **
-     **********************************************************************************/
-    METAHOST_POLICY_HIGHCOMPAT                  = 0x00000000,
-
-    /**********************************************************************************
-     ** 0x00000000 - 0x00000004 reserved for future policies.                        **
-     **********************************************************************************/
-
-    /**********************************************************************************
-     ** Applies upgrade policy when an exact match is not found.                     **
-     **********************************************************************************/
-    METAHOST_POLICY_APPLY_UPGRADE_POLICY        = 0x00000008,
-
-    /**********************************************************************************
-     ** Binds as if the provided information were being use in a new process. This   **
-     ** allows a host to determine what runtime an EXE will bind to when launched.   **
-     **********************************************************************************/
-    METAHOST_POLICY_EMULATE_EXE_LAUNCH          = 0x00000010,
-
-    /**********************************************************************************
-     ** Produces an error dialog if GetRequestedRuntime is unable to find a runtime  **
-     ** compatible with the input parameters. This error dialog can take the form    **
-     ** of a dialog box that takes a user to an fwlink, or as a Windows feature      **
-     ** dialog asking if the user would like to enable the appropriate feature (when **
-     ** available, this dialog is preferred over the fwlink dialog).                 **
-     **********************************************************************************/
-    METAHOST_POLICY_SHOW_ERROR_DIALOG           = 0x00000020,
-
-    /**********************************************************************************
-     ** By default, GetRequestedRuntime will not fall back to the process image path **
-     ** (typically the EXE that was used to launch the process) when determining the **
-     ** runtime to bind to. Specify this flag to have GetRequestedRuntime implicitly **
-     ** use the process image (and any corresponding configuration file) as          **
-     ** additional input to the binding process.                                     **
-     **********************************************************************************/
-    METAHOST_POLICY_USE_PROCESS_IMAGE_PATH      = 0x00000040,
-
-    /**********************************************************************************
-     ** By default, we will not check whether the appropriate SKU is installed       **
-     ** unless SKU is specified in the config file entry.                            **
-     ** Setting this flag forces the check when no information is available in the   **
-     ** config file, allowing applications without config files to fail gracefully   **
-     ** on smaller SKUs than the default install of .NET                             **
-     **********************************************************************************/
-     METAHOST_POLICY_ENSURE_SKU_SUPPORTED       = 0x00000080,
-
-    /**********************************************************************************
-     ** By default, we ignore METAHOST_POLICY_SHOW_ERROR_DIALOG if                   **
-     ** SEM_FAILCRITICALERRORS is set                                                **
-     ** This flag tell us that a silent failure would be so undesirable that         **
-     ** the METAHOST_POLICY_SHOW_ERROR_DIALOG should be honored, even if for some    **
-     ** reason (e.g. inheritance from another process) SEM_FAILCRITICALERRORS is set **
-     **********************************************************************************/
-     METAHOST_POLICY_IGNORE_ERROR_MODE       = 0x00001000,
-
-}
-METAHOST_POLICY_FLAGS;
-
-/**************************************************************************************
- ** This enum describes the possible flags returned in GetRequestedRuntinme's        **
- ** pdwConfigFlags out parameter.
- **************************************************************************************/
-typedef enum
-{
-    /**********************************************************************************
-     ** If a config file is used during GetRequestedRuntime's binding process, these **
-     ** values indicate whether or not the startup tag has the                       **
-     ** useLegacyV2RuntimeActivationPolicy attribute set, and if so to what value.   **
-     **********************************************************************************/
-
-    // Indicates presence and value of useLegacyV2RuntimeActivationPolicy <startup> attr
-    METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_UNSET  = 0x00000000,
-    METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_TRUE   = 0x00000001,
-    METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_FALSE  = 0x00000002,
-    METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_MASK   = 0x00000003,
-}
-METAHOST_CONFIG_FLAGS;
-
-/**************************************************************************************
- ** ICLRMetaHostPolicy                                                               **
- ** Activated using mscoree!CLRCreateInstance. Implements a policy for determining   **
- ** a runtime based on various inputs (metadata, config stream, ...).                **
- **************************************************************************************/
-[
-    uuid(E2190695-77B2-492e-8E14-C4B3A7FDD593),
-    version(1.0),
-    helpstring("CLR meta hosting policy"),
-    local
-]
-interface ICLRMetaHostPolicy : IUnknown
-{
-    /**********************************************************************************
-     ** Returns requested runtime version and runtime (not necessarily of that       **
-     ** version) based on a managed binary, version, and config file.                **
-     ** The return value is S_OK if a compatible runtime was found and S_FALSE if    **
-     ** not. *ppRuntime will be NULL in the latter case.                             **
-     ** Supersedes: GetRequestedRuntimeInfo, GetRequestedRuntimeVersion,             **
-     **             CorBindToRuntimeHost, CorBindToRuntimeByCfg,                     **
-     **             GetCORRequiredVersion                                            **
-     **********************************************************************************/
-    HRESULT GetRequestedRuntime(
-        [in]  METAHOST_POLICY_FLAGS dwPolicyFlags,
-        [in]  LPCWSTR pwzBinary,                              // optional
-        [in]  IStream *pCfgStream,                            // optional
-        [in, out, size_is(*pcchVersion), annotation("_Inout_updates_all_opt_(*pcchVersion)")] 
-              LPWSTR pwzVersion,   // optional
-        [in, out]  DWORD *pcchVersion, 
-        [out, size_is(*pcchImageVersion), annotation("_Out_writes_all_opt_(*pcchImageVersion)")] 
-              LPWSTR pwzImageVersion, // image version to be used by compilers
-        [in, out]  DWORD *pcchImageVersion,
-        [out] DWORD *pdwConfigFlags,
-        [in]  REFIID  riid,   // IID_ICLRRuntimeInfo
-        [out, iid_is(riid), retval] LPVOID *ppRuntime);
-} // interface ICLRMetaHostPolicy
-
 /*************************************************************************************
  ** This structure defines the version of a CLR for debugging purposes.             **
  ** The wStructVersion field allows for future revisions to this structure to be    **
@@ -708,411 +547,3 @@ interface ICLRRuntimeInfo : IUnknown
         [out] BOOL *pbStarted,
         [out] DWORD *pdwStartupFlags);
 };
-
-/**************************************************************************************
- ** ICLRStrongName                                                                   **
- ** These are the strong name APIs exposed by mscoree refactored into an interface.  **
- ** The only change is the omission of StrongNameErrorInfo and having all methods    **
- ** return the COM standard HRESULT. TODO (low-pri):                                 **
- ** ideas what could be done here - we have an opportunity to make breaking changes, **
- ** cleanup etc.
- **************************************************************************************/
-[
-    uuid(9FD93CCF-3280-4391-B3A9-96E1CDE77C8D),
-    version(1.0),
-    helpstring("CLR strong name interface"),
-    local
-]
-interface ICLRStrongName : IUnknown
-{
-    /**********************************************************************************
-     ** Gets a hash of the specified assembly file, using the specified hash         **
-     ** algorithm.                                                                   **
-     ** Supersedes: GetHashFromAssemblyFile                                          **
-     **********************************************************************************/
-    HRESULT GetHashFromAssemblyFile(
-        [in] LPCSTR pszFilePath,
-        [in, out] unsigned int *piHashAlg,
-        [out, size_is(cchHash), length_is(*pchHash)] BYTE *pbHash,
-        [in]  DWORD cchHash,
-        [out] DWORD *pchHash);
-
-    /**********************************************************************************
-     ** Gets a hash of the specified assembly file, using the specified hash         **
-     ** algorithm (Unicode version).                                                 **
-     ** Supersedes: GetHashFromAssemblyFileW                                         **
-     **********************************************************************************/
-    HRESULT GetHashFromAssemblyFileW(
-        [in]  LPCWSTR pwzFilePath,
-        [in, out] unsigned int *piHashAlg,
-        [out, size_is(cchHash), length_is(*pchHash)] BYTE *pbHash,
-        [in]  DWORD     cchHash,
-        [out] DWORD     *pchHash);
-
-    /**********************************************************************************
-     ** Gets a hash of the assembly at the specified memory address, using the       **
-     ** specified hash algorithm.                                                    **
-     ** Supersedes: GetHashFromBlob                                                  **
-     **********************************************************************************/
-    HRESULT GetHashFromBlob(
-        [in]  BYTE    *pbBlob,
-        [in]  DWORD   cchBlob,
-        [in, out] unsigned int   *piHashAlg,
-        [out, size_is(cchHash), length_is(*pchHash)] BYTE *pbHash,
-        [in]  DWORD   cchHash,
-        [out] DWORD   *pchHash);
-
-    /**********************************************************************************
-     ** Generates a hash over the contents of the specified file.                    **
-     ** Supersedes: GetHashFromFile                                                  **
-     **********************************************************************************/
-    HRESULT GetHashFromFile(
-        [in]  LPCSTR   pszFilePath,
-        [in, out] unsigned int   *piHashAlg, 
-        [out, size_is(cchHash), length_is(*pchHash)] BYTE *pbHash,
-        [in]  DWORD    cchHash,    
-        [out] DWORD    *pchHash);
-
-    /**********************************************************************************
-     ** Generates a hash over the contents of the specified file (Unicode version).  **
-     ** Supersedes: GetHashFromFileW                                                 **
-     **********************************************************************************/
-    HRESULT GetHashFromFileW(
-        [in]  LPCWSTR   pwzFilePath,
-        [in, out] unsigned int   *piHashAlg,
-        [out, size_is(cchHash), length_is(*pchHash)] BYTE *pbHash,
-        [in]  DWORD     cchHash,
-        [out] DWORD     *pchHash);
-
-    /**********************************************************************************
-     ** Generates a hash over the contents of the file with the specified file       **
-     ** handle, using the specified hash algorithm.                                  **
-     ** Supersedes: GetHashFromHandle                                                **
-     **********************************************************************************/
-    HRESULT GetHashFromHandle(
-        [in]  HANDLE   hFile,
-        [in, out] unsigned int   *piHashAlg,
-        [out, size_is(cchHash), length_is(*pchHash)] BYTE *pbHash,
-        [in]  DWORD    cchHash,
-        [out] DWORD    *pchHash);
-
-    /**********************************************************************************
-     ** Determines whether two assemblies differ only by their strong name           **
-     ** signatures.                                                                  **
-     ** Supersedes: StrongNameCompareAssemblies                                      **
-     **********************************************************************************/
-    HRESULT StrongNameCompareAssemblies(
-        [in]  LPCWSTR   pwzAssembly1,
-        [in]  LPCWSTR   pwzAssembly2,
-        [out, retval] DWORD *pdwResult);
-
-    /**********************************************************************************
-     ** Frees memory that was allocated with a previous call to a strong name        **
-     ** function such as StrongNameGetPublicKey, StrongNameTokenFromPublicKey, or    **
-     ** StrongNameSignatureGeneration.                                               **
-     ** Supersedes: StrongNameFreeBuffer                                             **
-     **********************************************************************************/
-    HRESULT StrongNameFreeBuffer(
-        [in] BYTE *pbMemory);
-
-    /**********************************************************************************
-     ** Fills the specified buffer with the binary representation of the executable. **
-     ** Supersedes: StrongNameGetBlob                                                **
-     **********************************************************************************/
-    HRESULT StrongNameGetBlob(
-        [in]  LPCWSTR    pwzFilePath,
-        [in, out, size_is(*pcbBlob), length_is(*pcbBlob)] BYTE *pbBlob,
-        [in, out] DWORD  *pcbBlob);
-
-    /**********************************************************************************
-     ** Gets a binary representation of the assembly image at the specified memory   **
-     ** address.                                                                     **
-     ** Supersedes: StrongNameGetBlobFromImage                                       **
-     **********************************************************************************/
-    HRESULT StrongNameGetBlobFromImage(
-        [in, size_is(dwLength)] BYTE *pbBase,
-        [in] DWORD dwLength,
-        [out, size_is(*pcbBlob), length_is(*pcbBlob)] BYTE *pbBlob,
-        [in, out] DWORD *pcbBlob);
-
-    /**********************************************************************************
-     ** Gets the public key from a private/public key pair.                          **
-     ** Supersedes: StrongNameGetPublicKey                                           **
-     **********************************************************************************/
-    HRESULT StrongNameGetPublicKey(
-        [in]  LPCWSTR   pwzKeyContainer,
-        [in]  BYTE      *pbKeyBlob,
-        [in]  ULONG     cbKeyBlob,
-        [out] BYTE      **ppbPublicKeyBlob,
-        [out] ULONG     *pcbPublicKeyBlob);
-
-    /**********************************************************************************
-     ** Gets the buffer size required for a hash, using the specified hash           **
-     ** algorithm.                                                                   **
-     ** Supersedes: StrongNameHashSize                                               **
-     **********************************************************************************/
-    HRESULT StrongNameHashSize(
-        [in]  ULONG   ulHashAlg,
-        [out, retval] DWORD *pcbSize);
-
-    /**********************************************************************************
-     ** Deletes the specified key container.                                         **
-     ** Supersedes: StrongNameKeyDelete                                              **
-     **********************************************************************************/
-    HRESULT StrongNameKeyDelete(
-        [in] LPCWSTR pwzKeyContainer);
-
-    /**********************************************************************************
-     ** Creates a new public/private key pair for strong name use.                   **
-     ** Supersedes: StrongNameKeyGen                                                 **
-     **********************************************************************************/
-    HRESULT StrongNameKeyGen(
-        [in]  LPCWSTR   pwzKeyContainer,
-        [in]  DWORD     dwFlags,
-        [out] BYTE      **ppbKeyBlob,
-        [out] ULONG     *pcbKeyBlob);
-
-    /**********************************************************************************
-     ** Generates a new public/private key pair with the specified key size, for     **
-     ** strong name use.                                                             **
-     ** Supersedes: StrongNameKeyGenEx                                               **
-     **********************************************************************************/
-    HRESULT StrongNameKeyGenEx(
-        [in]  LPCWSTR   pwzKeyContainer,
-        [in]  DWORD     dwFlags,
-        [in]  DWORD     dwKeySize,
-        [out] BYTE      **ppbKeyBlob,
-        [out] ULONG     *pcbKeyBlob);
-
-    /**********************************************************************************
-     ** Imports a public/private key pair into a container.                          **
-     ** Supersedes: StrongNameKeyInstall                                             **
-     **********************************************************************************/
-    HRESULT StrongNameKeyInstall(
-        [in]  LPCWSTR   pwzKeyContainer,
-        [in]  BYTE      *pbKeyBlob,
-        [in]  ULONG     cbKeyBlob);
-
-    /**********************************************************************************
-     ** Generates a strong name signature for the specified assembly.                **
-     ** Supersedes: StrongNameSignatureGeneration                                    **
-     **********************************************************************************/
-    HRESULT StrongNameSignatureGeneration(
-        [in]  LPCWSTR   pwzFilePath,
-        [in]  LPCWSTR   pwzKeyContainer,
-        [in]  BYTE      *pbKeyBlob,
-        [in]  ULONG     cbKeyBlob,
-        [out] BYTE      **ppbSignatureBlob,
-        [out] ULONG     *pcbSignatureBlob);
-
-    /**********************************************************************************
-     ** Generates a strong name signature for the specified assembly, according to   **
-     ** the specified flags.                                                         **
-     ** Supersedes: StrongNameSignatureGenerationEx                                  **
-     **********************************************************************************/
-    HRESULT StrongNameSignatureGenerationEx(
-        [in]  LPCWSTR   wszFilePath,
-        [in]  LPCWSTR   wszKeyContainer,
-        [in]  BYTE      *pbKeyBlob,
-        [in]  ULONG     cbKeyBlob,
-        [out] BYTE      **ppbSignatureBlob,
-        [out] ULONG     *pcbSignatureBlob,
-        [in]  DWORD     dwFlags);
-
-    /**********************************************************************************
-     ** Returns the size of the strong name signature.                               **
-     ** Supersedes: StrongNameSignatureSize                                          **
-     **********************************************************************************/
-    HRESULT StrongNameSignatureSize(
-        [in]  BYTE   *pbPublicKeyBlob,
-        [in]  ULONG  cbPublicKeyBlob, 
-        [in]  DWORD  *pcbSize);
-
-    /**********************************************************************************
-     ** Gets a value indicating whether the assembly manifest at the supplied path   **
-     ** contains a strong name signature, which is verified according to the         **
-     ** specified flags.                                                             **
-     ** Supersedes: StrongNameSignatureVerification                                  **
-     **********************************************************************************/
-    HRESULT StrongNameSignatureVerification(
-        [in]  LPCWSTR   pwzFilePath,
-        [in]  DWORD     dwInFlags,
-        [out, retval] DWORD *pdwOutFlags);
-
-    /**********************************************************************************
-     ** Gets a value indicating whether the assembly manifest at the supplied path   **
-     ** contains a strong name signature.                                            **
-     ** Supersedes: StrongNameSignatureVerificationEx                                **
-     **********************************************************************************/
-    HRESULT StrongNameSignatureVerificationEx(
-        [in]  LPCWSTR   pwzFilePath,
-        [in]  BOOLEAN   fForceVerification,
-        [out, retval] BOOLEAN *pfWasVerified);
-
-    /**********************************************************************************
-     ** Verifies that an assembly that has already been mapped to memory is valid    **
-     ** for the associated public key.                                               **
-     ** Supersedes: StrongNameSignatureVerificationFromImage                         **
-     **********************************************************************************/
-    HRESULT StrongNameSignatureVerificationFromImage(
-        [in]  BYTE    *pbBase,
-        [in]  DWORD   dwLength,
-        [in]  DWORD   dwInFlags,
-        [out, retval] DWORD *pdwOutFlags);
-
-    /**********************************************************************************
-     ** Creates a strong name token from the specified assembly file.                **
-     ** Supersedes: StrongNameTokenFromAssembly                                      **
-     **********************************************************************************/
-    HRESULT StrongNameTokenFromAssembly(
-        [in]  LPCWSTR   pwzFilePath,
-        [out] BYTE      **ppbStrongNameToken,
-        [out] ULONG     *pcbStrongNameToken);
-
-    /**********************************************************************************
-     ** Creates a strong name token from the specified assembly file, and returns    **
-     ** the public key that the token represents.                                    **
-     ** Supersedes: StrongNameTokenFromAssemblyEx                                    **
-     **********************************************************************************/
-    HRESULT StrongNameTokenFromAssemblyEx(
-        [in]  LPCWSTR   pwzFilePath,
-        [out] BYTE      **ppbStrongNameToken,
-        [out] ULONG     *pcbStrongNameToken,
-        [out] BYTE      **ppbPublicKeyBlob,
-        [out] ULONG     *pcbPublicKeyBlob);
-    /**********************************************************************************
-     ** Gets a token representing a public key. A strong name token is the shortened **
-     ** form of a public key.                                                        **
-     ** Supersedes: StrongNameTokenFromPublicKey                                     **
-     **********************************************************************************/
-    HRESULT StrongNameTokenFromPublicKey(
-        [in]  BYTE    *pbPublicKeyBlob,
-        [in]  ULONG   cbPublicKeyBlob,
-        [out] BYTE    **ppbStrongNameToken,
-        [out] ULONG   *pcbStrongNameToken);
-};  // interface ICLRStrongName
-
-/**************************************************************************************
- ** ICLRStrongName2                                                                  **
- ** Strongname Api's                                                                 **
- **************************************************************************************/
-[
-    uuid(C22ED5C5-4B59-4975-90EB-85EA55C0069B),
-    version(1.0),
-    helpstring("CLR strong name interface 2"),
-    local
-]
-interface ICLRStrongName2 : IUnknown
-{
-    /**********************************************************************************
-     ** Gets the public key from a private/public key pair, specifying a hash        **
-     ** algorithm and a signature algorithm.                                         **
-     **********************************************************************************/
-    HRESULT StrongNameGetPublicKeyEx(
-        [in]      LPCWSTR   pwzKeyContainer,
-        [in]      BYTE      *pbKeyBlob,
-        [in]      ULONG     cbKeyBlob,
-        [out]     BYTE      **ppbPublicKeyBlob,
-        [out]     ULONG     *pcbPublicKeyBlob,
-        [in]      ULONG     uHashAlgId, // specify algorithm, or set to 0 for default
-        [in]      ULONG     uReserved); // reserved for future use, always set to 0
-
-    /**********************************************************************************
-     ** Verify the signature of a strongly named assembly, providing a mapping from  **
-     ** the ECMA key to a real key                                                   **
-     **********************************************************************************/
-    HRESULT StrongNameSignatureVerificationEx2(
-        [in] LPCWSTR    wszFilePath,
-        [in] BOOLEAN    fForceVerification,
-        [in] BYTE      *pbEcmaPublicKey,
-        [in] DWORD      cbEcmaPublicKey,
-        [out] BOOLEAN   *pfWasVerified);
-};  // interface ICLRStrongName2
-
-/*************************************************************************************
-** ICLRStrongName3                                                                  **
-** StrongName digest signing APIs                                                   **
-**************************************************************************************/
-[
-    uuid(22c7089b-bbd3-414a-b698-210f263f1fed),
-    version(1.0),
-    helpstring("CLR strong name digest signing interface"),
-    local
-]
-interface ICLRStrongName3 : IUnknown
-{
-    // Generate the digest of an input assembly, which can be signed with StrongNameDigestSign
-    HRESULT StrongNameDigestGenerate(
-        [in] LPCWSTR    wszFilePath,
-        [out] BYTE**    ppbDigestBlob,
-        [out] ULONG*    pcbDigestBlob,
-        [in] DWORD      dwFlags);
-
-    // Sign an the digest of an assembly calculated by StrongNameDigestGenerate
-    HRESULT StrongNameDigestSign(
-        [in] LPCWSTR                        wszKeyContainer,
-        [in, size_is(cbKeyBlob)] BYTE*      pbKeyBlob,
-        [in] ULONG                          cbKeyBlob,
-        [in, size_is(cbDigestBlob)] BYTE*   pbDigestBlob,
-        [in] ULONG                          cbDigestBlob,
-        [in] DWORD                          hashAlgId,
-        [out] BYTE**                        ppbSignatureBlob,
-        [out] ULONG*                        pcbSignatureBlob,
-        [in] DWORD dwFlags);
-
-    // Embed a digest signature generated with StrongNameDigestSign into an assembly
-    HRESULT StrongNameDigestEmbed(
-        [in] LPCWSTR                          wszFilePath,
-        [in, size_is(cbSignatureBlob)] BYTE*  pbSignatureBlob,
-        [in] ULONG                            cbSignatureBlob);
-};
-
-[
-    uuid(5288DA6A-A8D3-43a1-8365-37DB0E7D5943),
-    version(1.0),
-]
-library CLRMetaHost
-{
-    interface ICLRMetaHost;
-    interface ICLRMetaHostPolicy;
-    interface ICLRDebuggingLibraryProvider;
-    interface ICLRDebugging;
-    interface ICLRRuntimeInfo;
-    interface ICLRStrongName;
-
-    // Scenario: EXE activation
-    // 1. ICLRMetaHostPolicy::GetRequestedRuntime
-    // 2. ICLRRuntimeInfo::GetProcAddress("ExeMain")
-    // 3. ExeMain() - TODO: Add a hosting API to execute an EXE?
-
-    // Scenario: COM activation
-    // 1. <get version info from registry>
-    // 2. ICLRMetaHostPolicy::GetRequestedRuntime
-    // 3. ICLRRuntimeInfo::GetInterface(IID_ICLRRuntimeHost)
-    // 4. ICLRRuntimeHost::Start
-    // 5. ICLRRuntimeInfo::GetProcAddress("ClrCreateManagedInstance")
-    // 6. pClrCreateManagedInstance()
-
-    // Scenario: Hosting with custom policy
-    // 1. ICLRMetaHost::GetFileVersion
-    // 2. ICLRMetaHost::EnumerateInstalledRuntimes
-    // 3. ICLRRuntimeInfo::IsLoaded/IsStarted
-    // ...
-
-    // Scenario: Debugger attach for v1.0 to v4 using v2 lookalike interface
-    // ICLRMetaHost::EnumerateLoadedRuntimes
-    // ICLRRuntimeInfo::GetInterface(CLSID_CLRDebuggingLegacy, IID_ICorDebug)
-    
-    // Scenario: Profiler attach for v4
-    // ICLRMetaHost::EnumerateLoadedRuntimes
-    
-    // Scenario: An installer needs to modify configuration of supported runtimes
-    // 1. ICLRMetaHost::EnumerateInstalledRuntimes
-    // 2. ICLRRuntimeInfo::GetVersionString
-    // 3. <policy>
-    // 4. ICLRRuntimeInfo::GetRuntimeDirectory
-    // 5. <modify the config file under the runtime dir>
-
-};  // library CLRMetaHost
-
-cpp_quote("#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
index 48eada4f6fc274d16e9d6233d6febfa036b42e3e..33ded4247f7fb73f3960ff8d31fc7905d4b79aa2 100644 (file)
@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 /* -------------------------------------------------------------------------- *
- * Microsoft .Net Framework Service
+ * Microsoft .NET Framework Service
  * -------------------------------------------------------------------------- */
 
 #ifndef IN_MSCOREE
index 7a47b886c4898c88e84d23e0e2a25a00e8773754..925a5a25288f88ae2a058ab808a7eee822ba703f 100644 (file)
 #define _DEBUG_IMPL 1
 #endif
 
+#if __GNUC__
+#ifndef __cdecl
+#define __cdecl        __attribute__((__cdecl__))
+#endif
+#endif
+
+#ifndef NOTHROW_DECL
+#ifdef _MSC_VER
+#define NOTHROW_DECL __declspec(nothrow)
+#else
+#define NOTHROW_DECL __attribute__((nothrow))
+#endif // !_MSC_VER
+#endif // !NOTHROW_DECL
+
+#ifndef NOINLINE
+#ifdef _MSC_VER
+#define NOINLINE __declspec(noinline)
+#else
+#define NOINLINE __attribute__((noinline))
+#endif // !_MSC_VER
+#endif // !NOINLINE
+
+#define ANALYZER_NORETURN
+
 //
 // CPP_ASSERT() can be used within a class definition, to perform a
 // compile-time assertion involving private names within the class.
 #if defined(SOURCE_FORMATTING)
 #define SELECTANY extern
 #else
+#if defined(__GNUC__)
+#define SELECTANY extern __attribute__((weak))
+#else
 #define SELECTANY extern __declspec(selectany)
 #endif
+#endif
 #if defined(SOURCE_FORMATTING)
 #define __annotation(x)
 #endif
         
 
-#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(JIT64_BUILD) && !defined(CROSS_COMPILE) && !defined(_TARGET_ARM_) // @ARMTODO: no contracts for speed
+#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(JIT64_BUILD) && !defined(CROSS_COMPILE) && !defined(DISABLE_CONTRACTS)
 #define PAL_TRY_HANDLER_DBG_BEGIN                                               \
     BOOL ___oldOkayToThrowValue = FALSE;                                        \
-    SO_INFRASTRUCTURE_CODE(BOOL ___oldSOTolerantState = FALSE;)                \
     ClrDebugState *___pState = ::GetClrDebugState();                            \
     __try                                                                       \
     {                                                                           \
         ___oldOkayToThrowValue = ___pState->IsOkToThrow();                      \
-        SO_INFRASTRUCTURE_CODE(___oldSOTolerantState = ___pState->IsSOTolerant();) \
         ___pState->SetOkToThrow();                                        \
         PAL_ENTER_THROWS_REGION;
 
 // Special version that avoids touching the debug state after doing work in a DllMain for process or thread detach.
 #define PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason)                              \
     BOOL ___oldOkayToThrowValue = FALSE;                                        \
-    SO_INFRASTRUCTURE_CODE(BOOL ___oldSOTolerantState = FALSE;)                \
     ClrDebugState *___pState = NULL;                                            \
     if (_reason != DLL_PROCESS_ATTACH)                                          \
         ___pState = CheckClrDebugState();                                       \
         if (___pState)                                                          \
         {                                                                       \
             ___oldOkayToThrowValue = ___pState->IsOkToThrow();                  \
-            SO_INFRASTRUCTURE_CODE(___oldSOTolerantState = ___pState->IsSOTolerant();) \
             ___pState->SetOkToThrow();                                        \
         }                                                                       \
         if ((_reason == DLL_PROCESS_DETACH) || (_reason == DLL_THREAD_DETACH))  \
         {                                                                       \
             _ASSERTE(___pState == CheckClrDebugState());                        \
             ___pState->SetOkToThrow( ___oldOkayToThrowValue );                \
-            SO_INFRASTRUCTURE_CODE(___pState->SetSOTolerance( ___oldSOTolerantState );) \
         }                                                                       \
     }
 
-#define PAL_ENDTRY_NAKED_DBG                                                    \
-    if (__exHandled)                                                            \
-    {                                                                           \
-        RESTORE_SO_TOLERANCE_STATE;                                             \
-    }                                                                           \
-    
+#define PAL_ENDTRY_NAKED_DBG
+
 #else
 #define PAL_TRY_HANDLER_DBG_BEGIN                   ANNOTATION_TRY_BEGIN;
 #define PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason)  ANNOTATION_TRY_BEGIN;
index 372f467cbd84c60194e9a3016d0a019962a03b60..701fad3b4e8fed16ad3faaffdb7f1137dc7db0e8 100644 (file)
 #if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(JIT64_BUILD) && !defined(_ARM_) // @ARMTODO
 #define WIN_PAL_TRY_HANDLER_DBG_BEGIN                                           \
     BOOL ___oldOkayToThrowValue = FALSE;                                        \
-    BOOL ___oldSOTolerantState = FALSE;                                         \
     ClrDebugState *___pState = GetClrDebugState();                              \
     __try                                                                       \
     {                                                                           \
         ___oldOkayToThrowValue = ___pState->IsOkToThrow();                      \
-        ___oldSOTolerantState = ___pState->IsSOTolerant();                      \
         ___pState->SetOkToThrow(TRUE);                                          \
         ANNOTATION_TRY_BEGIN;
 
         if (___pState)                                                          \
         {                                                                       \
             ___oldOkayToThrowValue = ___pState->IsOkToThrow();                  \
-            ___oldSOTolerantState = ___pState->IsSOTolerant();                  \
             ___pState->SetOkToThrow(TRUE);                                      \
         }                                                                       \
         if ((_reason == DLL_PROCESS_DETACH) || (_reason == DLL_THREAD_DETACH))  \
         }                                                                       \
     }
 
-#define WIN_PAL_ENDTRY_NAKED_DBG                                                \
-    if (__exHandled)                                                            \
-    {                                                                           \
-        RESTORE_SO_TOLERANCE_STATE;                                             \
-    }                                                                           \
-    
+#define WIN_PAL_ENDTRY_NAKED_DBG
+
 #else
 #define WIN_PAL_TRY_HANDLER_DBG_BEGIN                   ANNOTATION_TRY_BEGIN;
 #define WIN_PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason)  ANNOTATION_TRY_BEGIN;
index fd56780b08bd851e287c229f85c603aeb37ec880..2e51009e26209c3630c3dac2dff1ccae7d4046e5 100644 (file)
@@ -7,6 +7,10 @@
 #ifndef __PREDEFTLSSLOT_H__
 #define __PREDEFTLSSLOT_H__
 
+// ******************************************************************************
+// WARNING!!!: This header is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/predeftlsslot.h
+// ******************************************************************************
 
 // And here are the predefined slots for accessing TLS from various DLLs of the CLR.
 // Note that we want to support combinations of Debug and Retail DLLs for testing
@@ -20,7 +24,7 @@ enum PredefinedTlsSlots
     TlsIdx_JitLogEnv,
     TlsIdx_IceCap,
     TlsIdx_StressLog,
-    TlsIdx_StackProbe,
+    TlsIdx_Unused,
     TlsIdx_Check,
     TlsIdx_ForbidGCLoaderUseCount,
     TlsIdx_ClrDebugState,         // Pointer to ClrDebugState* structure
@@ -55,8 +59,6 @@ enum PredefinedTlsSlots
     TlsIdx_PEXCEPTION_RECORD,
     TlsIdx_PCONTEXT,
 
-    TlsIdx_SOIntolerantTransitionHandler, // The thread is entering SO intolerant code.  This one is used by
-                                          // Thread::IsSOIntolerant to decide the SO mode of the thread.
     MAX_PREDEFINED_TLS_SLOT
 };
 
index 09e765c3d3aa658afdc371eec865c266c1ab1ffa..4cf7f4a92ae8b4b7c52cea0d331e765e69e584be 100644 (file)
 #define SCAN_WIDEN2(x) L ## x
 #define SCAN_WIDEN(x) SCAN_WIDEN2(x)
 
+#ifndef NOINLINE
+#if __GNUC__
+#define NOINLINE __attribute__((noinline))
+#else
+#define NOINLINE __declspec(noinline)
+#endif
+#endif
+
 //
 // PDB annotations for the static contract analysis tool. These are seperated
 // from Contract.h to allow their inclusion in any part of the system.
@@ -51,7 +59,6 @@
 #define ANNOTATION_IGNORE_LOCK              __annotation(W("CAN_TAKE_LOCK"), W("CANNOT_TAKE_LOCK"), W("CONDITIONAL_EXEMPT"))
 #define ANNOTATION_IGNORE_FAULT             __annotation(W("FAULT"), W("FORBID_FAULT"), W("CONDITIONAL_EXEMPT"))
 #define ANNOTATION_IGNORE_TRIGGER           __annotation(W("GC_TRIGGERS"), W("GC_NOTRIGGER"), W("CONDITIONAL_EXEMPT"))
-#define ANNOTATION_IGNORE_SO                __annotation(W("SO_TOLERANT"), W("SO_INTOLERANT"), W("CONDITIONAL_EXEMPT"))
 #define ANNOTATION_VIOLATION(violationmask) __annotation(W("VIOLATION(") L#violationmask W(")"))
 #define ANNOTATION_UNCHECKED(thecheck)      __annotation(W("UNCHECKED(") L#thecheck W(")"))
 
@@ -84,9 +91,6 @@
 #define ANNOTATION_FN_FORBID_FAULT          __annotation(W("FORBID_FAULT ") SCAN_WIDEN(__FUNCTION__))
 #define ANNOTATION_FN_GC_TRIGGERS           __annotation(W("GC_TRIGGERS ") SCAN_WIDEN(__FUNCTION__))
 #define ANNOTATION_FN_GC_NOTRIGGER          __annotation(W("GC_NOTRIGGER ") SCAN_WIDEN(__FUNCTION__))
-#define ANNOTATION_FN_SO_TOLERANT           __annotation(W("SO_TOLERANT ") SCAN_WIDEN(__FUNCTION__))
-#define ANNOTATION_FN_SO_INTOLERANT         __annotation(W("SO_INTOLERANT ") SCAN_WIDEN(__FUNCTION__))
-#define ANNOTATION_FN_SO_NOT_MAINLINE       __annotation(W("SO_NOT_MAINLINE ") SCAN_WIDEN(__FUNCTION__))
 #define ANNOTATION_FN_MODE_COOPERATIVE      __annotation(W("MODE_COOPERATIVE ") SCAN_WIDEN(__FUNCTION__))
 #define ANNOTATION_FN_MODE_PREEMPTIVE       __annotation(W("MODE_PREEMPTIVE ") SCAN_WIDEN(__FUNCTION__))
 #define ANNOTATION_FN_MODE_ANY              __annotation(W("MODE_ANY ") SCAN_WIDEN(__FUNCTION__))
 #define ANNOTATION_IGNORE_LOCK              { }
 #define ANNOTATION_IGNORE_FAULT             { }
 #define ANNOTATION_IGNORE_TRIGGER           { }
-#define ANNOTATION_IGNORE_SO                { }
 #define ANNOTATION_VIOLATION(violationmask) { }
 #define ANNOTATION_UNCHECKED(thecheck)      { }
 
 #define ANNOTATION_FN_FORBID_FAULT          { }
 #define ANNOTATION_FN_GC_TRIGGERS           { }
 #define ANNOTATION_FN_GC_NOTRIGGER          { }
-#define ANNOTATION_FN_SO_TOLERANT           { }
-#define ANNOTATION_FN_SO_INTOLERANT         { }
-#define ANNOTATION_FN_SO_NOT_MAINLINE       { }
 #define ANNOTATION_FN_MODE_COOPERATIVE      { }
 #define ANNOTATION_FN_MODE_PREEMPTIVE       { }
 #define ANNOTATION_FN_MODE_ANY              { }
 #define ANNOTATION_SO_PROBE_BEGIN(probeAmount) { }
 #define ANNOTATION_SO_PROBE_END             { }
 
-#define ANNOTATION_SO_TOLERANT              { }
-#define ANNOTATION_SO_INTOLERANT            { }
-#define ANNOTATION_SO_NOT_MAINLINE          { }
-#define ANNOTATION_SO_NOT_MAINLINE_BEGIN    { }
-#define ANNOTATION_SO_NOT_MAINLINE_END      { }
 #define ANNOTATION_ENTRY_POINT              { }
 #ifdef _DEBUG
 #define ANNOTATION_DEBUG_ONLY               { }
 #define STATIC_CONTRACT_LIMITED_METHOD      ANNOTATION_FN_LEAF
 #define STATIC_CONTRACT_WRAPPER             ANNOTATION_FN_WRAPPER
 
-#ifdef FEATURE_STACK_PROBE // Static SO contracts only required when SO Infrastructure code is present
-#define STATIC_CONTRACT_SO_INTOLERANT       ANNOTATION_FN_SO_INTOLERANT
-#define STATIC_CONTRACT_SO_TOLERANT         ANNOTATION_FN_SO_TOLERANT
-#define STATIC_CONTRACT_SO_NOT_MAINLINE     ANNOTATION_FN_SO_NOT_MAINLINE
-
-#define STATIC_CONTRACT_ENTRY_POINT         ANNOTATION_ENTRY_POINT; ANNOTATION_FN_SO_TOLERANT
-#else // FEATURE_STACK_PROBE
-#define STATIC_CONTRACT_SO_INTOLERANT
-#define STATIC_CONTRACT_SO_TOLERANT
-#define STATIC_CONTRACT_SO_NOT_MAINLINE
 #define STATIC_CONTRACT_ENTRY_POINT
-#endif // FEATURE_STACK_PROBE
 
 #ifdef _DEBUG
 #define STATIC_CONTRACT_DEBUG_ONLY                                  \
     ANNOTATION_DEBUG_ONLY;                                          \
     STATIC_CONTRACT_CANNOT_TAKE_LOCK;                               \
-    ANNOTATION_VIOLATION(TakesLockViolation);                       \
-    ANNOTATION_FN_SO_NOT_MAINLINE;
+    ANNOTATION_VIOLATION(TakesLockViolation);
 #else
 #define STATIC_CONTRACT_DEBUG_ONLY 
 #endif
@@ -236,12 +219,11 @@ namespace StaticContract
 {
     struct ScanThrowMarkerStandard
     {
-        __declspec(noinline) ScanThrowMarkerStandard()
+        NOINLINE ScanThrowMarkerStandard()
         {
             METHOD_CANNOT_BE_FOLDED_DEBUG;
             STATIC_CONTRACT_THROWS;
             STATIC_CONTRACT_GC_NOTRIGGER;
-            STATIC_CONTRACT_SO_TOLERANT;
         }
 
         static void used()
@@ -251,7 +233,7 @@ namespace StaticContract
 
     struct ScanThrowMarkerTerminal
     {
-        __declspec(noinline) ScanThrowMarkerTerminal()
+        NOINLINE ScanThrowMarkerTerminal()
         {
             METHOD_CANNOT_BE_FOLDED_DEBUG;
         }
@@ -263,7 +245,7 @@ namespace StaticContract
 
     struct ScanThrowMarkerIgnore
     {
-        __declspec(noinline) ScanThrowMarkerIgnore()
+        NOINLINE ScanThrowMarkerIgnore()
         {
             METHOD_CANNOT_BE_FOLDED_DEBUG;
         }
@@ -289,47 +271,16 @@ typedef StaticContract::ScanThrowMarkerStandard ScanThrowMarker;
 #define STATIC_CONTRACT_THROWS_TERMINAL                             \
     typedef StaticContract::ScanThrowMarkerTerminal ScanThrowMarker; if (0) ScanThrowMarker::used();
 
-#if defined(_DEBUG) && !defined(DACCESS_COMPILE) && defined(FEATURE_STACK_PROBE) && !defined(_TARGET_ARM_) // @ARMTODO
-extern void EnsureSOIntolerantOK(const char *szFunction, const char *szFile, int lineNum);
-
-extern BOOL (*g_fpShouldValidateSOToleranceOnThisThread)();
-
-// @todo  Is there any checks we can do here?
-#define ENSURE_SHOULD_NOT_PROBE_FOR_SO
-
-#define CHECK_IF_SO_INTOLERANT_OK \
-    EnsureSOIntolerantOK(__FUNCTION__, __FILE__, __LINE__);
-
-// Even if we can't have a full-blown contract, we can at least check
-// if its ok to run an SO-Intolerant function.
-#undef STATIC_CONTRACT_SO_INTOLERANT                                           
-#define STATIC_CONTRACT_SO_INTOLERANT                                           \
-    ANNOTATION_FN_SO_INTOLERANT;                                                \
-    CHECK_IF_SO_INTOLERANT_OK;
-
-#undef STATIC_CONTRACT_SO_NOT_MAINLINE
-#define STATIC_CONTRACT_SO_NOT_MAINLINE                                         \
-    ENSURE_SHOULD_NOT_PROBE_FOR_SO                                              \
-    ANNOTATION_FN_SO_NOT_MAINLINE
-
-#else
-#define EnsureSOIntolerantOK(x,y,z)
-
-#endif
-
-
 #ifdef _MSC_VER
 #define SCAN_IGNORE_THROW                   typedef StaticContract::ScanThrowMarkerIgnore ScanThrowMarker; ANNOTATION_IGNORE_THROW
 #define SCAN_IGNORE_LOCK                    ANNOTATION_IGNORE_LOCK
 #define SCAN_IGNORE_FAULT                   ANNOTATION_IGNORE_FAULT
 #define SCAN_IGNORE_TRIGGER                 ANNOTATION_IGNORE_TRIGGER
-#define SCAN_IGNORE_SO                      ANNOTATION_IGNORE_SO
 #else
 #define SCAN_IGNORE_THROW
 #define SCAN_IGNORE_LOCK
 #define SCAN_IGNORE_FAULT
 #define SCAN_IGNORE_TRIGGER
-#define SCAN_IGNORE_SO
 #endif
 
 
@@ -340,21 +291,21 @@ template <UINT COUNT>
 class BlockMarker
 {
 public:
-    __declspec(noinline) void MarkBlock()
+    NOINLINE void MarkBlock()
     {
         ANNOTATION_MARK_BLOCK_ANNOTATION;
         METHOD_CANNOT_BE_FOLDED_DEBUG;
         return;
     }
 
-    __declspec(noinline) void UseMarkedBlockAnnotation()
+    NOINLINE void UseMarkedBlockAnnotation()
     {
         ANNOTATION_USE_BLOCK_ANNOTATION;
         METHOD_CANNOT_BE_FOLDED_DEBUG;
         return;
     }
 
-    __declspec(noinline) void EndUseMarkedBlockAnnotation()
+    NOINLINE void EndUseMarkedBlockAnnotation()
     {
         ANNOTATION_END_USE_BLOCK_ANNOTATION;
         METHOD_CANNOT_BE_FOLDED_DEBUG;
index d109778a65bc6d5db33c0f545e784ae83dbbd0eb..bbf2e00d515870ca7b3540e56e88ea4ac5bab0e8 100644 (file)
 /* The log has a very simple structure, and it meant to be dumped from a NTSD 
    extention (eg. strike). There is no memory allocation system calls etc to purtub things */
 
-/* see the tools/strike/stressdump.cpp for the dumper utility that parses this log */
+// ******************************************************************************
+// WARNING!!!: This header is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/stresslog.h
+// Parser: https://github.com/dotnet/diagnostics/blob/master/src/SOS/Strike/stressLogDump.cpp
+// ******************************************************************************
+
 
 /*************************************************************************************/
 
             LOG((facility, level, msg, data1, data2, data3, data4, data5, data6, data7));               \
             } while(0)
 
-#define STRESS_LOG_COND0(facility, level, msg) do {                           \
+#define STRESS_LOG_COND0(facility, level, cond, msg) do {                     \
             if (StressLog::LogOn(facility, level) && (cond))                  \
                 StressLog::LogMsg(level, facility, 0, msg);                   \
             LOG((facility, level, msg));                                      \
@@ -397,7 +402,7 @@ typedef USHORT
     static StressLog theLog;    // We only have one log, and this is it
 };
 
-typedef Holder<CRITSEC_COOKIE, StressLog::Enter, StressLog::Leave, NULL, CompareDefault<CRITSEC_COOKIE>, HSV_NoValidation> StressLogLockHolder;
+typedef Holder<CRITSEC_COOKIE, StressLog::Enter, StressLog::Leave, NULL, CompareDefault<CRITSEC_COOKIE>> StressLogLockHolder;
 
 #if defined(DACCESS_COMPILE)
 inline BOOL StressLog::LogOn(unsigned facility, unsigned level)
index e47c78ce2db38131ba159a74b71d94343c94aae9..60034602c3e1ed8add56e0845c044084db767f7f 100644 (file)
 
 #if 0
     #define APPDOMAIN_STATE
-    #define BREAK_ON_UNLOAD
-    #define AD_LOG_MEMORY
-    #define AD_NO_UNLOAD
-    #define AD_SNAPSHOT
-    #define BREAK_META_ACCESS
-    #define AD_BREAK_ON_CANNOT_UNLOAD
-    #define BREAK_ON_CLSLOAD
 
     // Enable to track details of EESuspension
     #define TIME_SUSPEND
index 429e41c1513f31e9f20af5d222f35a7cd87ccfd2..98e18cff498d00cbfbac7c04bfc6828e469d2f62 100644 (file)
@@ -8,7 +8,10 @@
 // Encapsulates TLS access for maximum performance. 
 //
 
-
+// ******************************************************************************
+// WARNING!!!: This header is also used by the coreclr repo.
+// See: https://github.com/dotnet/coreclr/blob/master/src/inc/tls.h
+// ******************************************************************************
 
 #ifndef __tls_h__
 #define __tls_h__