diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6d3f2efaf848ce..015825df43d7a6 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,19 +3,19 @@ "isRoot": true, "tools": { "coverlet.console": { - "version": "1.7.2", + "version": "3.1.0", "commands": [ "coverlet" ] }, "dotnet-reportgenerator-globaltool": { - "version": "4.5.8", + "version": "5.0.2", "commands": [ "reportgenerator" ] }, "microsoft.dotnet.xharness.cli": { - "version": "1.0.0-prerelease.21622.1", + "version": "1.0.0-prerelease.22062.1", "commands": [ "xharness" ] diff --git a/.gitignore b/.gitignore index c1a783db2aa7c9..6627d2c2d0a75b 100644 --- a/.gitignore +++ b/.gitignore @@ -187,6 +187,7 @@ node_modules/ *.metaproj.tmp bin.localpkg/ src/mono/wasm/runtime/dotnet.d.ts.sha256 +src/mono/sample/wasm/browser-nextjs/public/ # RIA/Silverlight projects Generated_Code/ diff --git a/Directory.Build.props b/Directory.Build.props index 0983ba4ae36f89..e9e6fc4e362346 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -31,6 +31,7 @@ arm armel arm64 + loongarch64 s390x wasm x64 @@ -157,26 +158,27 @@ - <_toolRuntimeRID Condition="'$(CrossBuild)' == 'true'">$(_hostOS.ToLowerInvariant)-$(_hostArch) - <_toolRuntimeRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64 - <_toolRuntimeRID Condition="'$(_toolRuntimeRID)' == ''">$(_runtimeOS)-$(_hostArch) + <_toolsRID Condition="'$(CrossBuild)' == 'true'">$(_hostOS.ToLowerInvariant)-$(_hostArch) + <_toolsRID Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_runtimeOS)-x64 + <_toolsRID Condition="'$(_toolsRID)' == ''">$(_runtimeOS)-$(_hostArch) - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser'">linux-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'windows'">win-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'osx'">osx-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'browser'">linux-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'windows'">win-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'browser' and '$(HostOS)' == 'osx'">osx-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android'">linux-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'windows'">win-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'osx'">osx-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'android'">linux-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'windows'">win-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'android' and '$(HostOS)' == 'osx'">osx-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'iOSSimulator' or '$(_runtimeOS)' == 'tvos' or '$(_runtimeOS)' == 'tvOSSimulator'">osx-x64 + <_toolsRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'iOSSimulator' or '$(_runtimeOS)' == 'tvos' or '$(_runtimeOS)' == 'tvOSSimulator'">osx-x64 - - linux-$(_hostArch) - $(_toolRuntimeRID) + + linux-$(_hostArch) + $(_toolsRID) + $(ToolsRID) $(_packageOS)-$(TargetArchitecture) diff --git a/docs/coding-guidelines/interop-guidelines.md b/docs/coding-guidelines/interop-guidelines.md index 997aa1fd3772a8..55d4e9ddcae0ab 100644 --- a/docs/coding-guidelines/interop-guidelines.md +++ b/docs/coding-guidelines/interop-guidelines.md @@ -166,6 +166,12 @@ Using enums instead of partial, static classes can lead to needing lots of casts When defining the P/Invoke signatures and structs, we follow the guidelines in the [interop best practices documentation](https://docs.microsoft.com/en-us/dotnet/standard/native-interop/best-practices). +The runtime repo makes use of [source-generated p/invokes](../design/features/source-generator-pinvokes.md) whenever possible (see [the compatibility doc](../design/libraries/DllImportGenerator/Compatibility.md) for unsupported scenarios). Methods should be marked `GeneratedDllImport` and be `static` and `partial`. + +If implicit framework references are disabled (as is the case for most libraries projects), explicit references to the below are required for marshalling arrays: + - `System.Memory` + - `System.Runtime.CompilerServices.Unsafe` + ## UNIX shims Often, various UNIX flavors offer the same API from the point-of-view of compatibility with C/C++ source code, but they do not have the same ABI. e.g. Fields can be laid out differently, constants can have different numeric values, exports can be named differently, etc. There are not only differences between operating systems (Mac OS X vs. Ubuntu vs. FreeBSD), but also differences related to the underlying processor architecture (x64 vs. x86 vs. ARM). @@ -174,6 +180,8 @@ This leaves us with a situation where we can't write portable P/Invoke declarati To address this, we're moving to a model where all UNIX interop from dotnet/runtime starts with a P/Invoke to a C++ lib written specifically for dotnet/runtime. These libs -- System.*.Native.so (aka "shims") -- are intended to be very thin layers over underlying platform libraries. Generally, they are not there to add any significant abstraction, but to create a stable ABI such that the same IL assembly can work across UNIX flavors. +The System.Native shims are a private implementation detail of the Microsoft.NETCore.App shared framework and are intended only for use by code inside of the shared framework. Calling into the shims from external to Microsoft.NETCore.App has similar risks to using private reflection, with no guarantees from version to version or even patch to patch of stable exports. Assemblies that ship outside of the shared framework (e.g. Microsoft.Extensions.*) must not directly access the shims. + Guidelines for shim C++ API: - Keep them as "thin"/1:1 as possible. diff --git a/docs/design/mono/debugger.md b/docs/design/mono/debugger.md index 3a3a2936b79eb4..2268d81bf1047b 100644 --- a/docs/design/mono/debugger.md +++ b/docs/design/mono/debugger.md @@ -18,4 +18,11 @@ Web Assembly Debugger supports usage of following attributes: - Stepping In/Over: results in an additional stepping need to proceed to the next line.

- __System.Diagnostics.DebuggerDisplay__ - __System.Diagnostics.DebuggerTypeProxy__ -- ... \ No newline at end of file +- __System.Diagnostics.DebuggerBrowsable__ ([doc](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggerbrowsableattribute?view=net-6.0)) + - Collapsed - displayed normally. + - RootHidden: + - Simple type - not displayed in the debugger window. + - Collection / Array - the values of a collection are displayed in a flat view, using the naming convention: *rootName[idx]*. + + - Never - not displayed in the debugger window. + diff --git a/docs/workflow/Codespaces.md b/docs/workflow/Codespaces.md index 391cd4087429e6..858da337216f25 100644 --- a/docs/workflow/Codespaces.md +++ b/docs/workflow/Codespaces.md @@ -5,13 +5,11 @@ Codespaces allows you to develop in a Docker container running in the cloud. You dotnet/runtime runs a nightly GitHub Action to build the latest code in the repo. This allows you to immediately start developing and testing after creating a codespace without having to build the whole repo. When the machine is created, it will have built the repo using the code as of 6 AM UTC that morning. -**NOTE**: In order to use a prebuilt codespace, when you create your machine be sure to select an **`8 core`** machine. - 1. From https://github.com/dotnet/runtime, drop-down the `Code` button and select the `Codespaces` tab. ![New codespace button](https://docs.github.com/assets/images/help/codespaces/new-codespace-button.png) -2. Select `8-core` for the Machine type. This will ensure you get a "pre built" image. +2. Select the Machine type. For dotnet/runtime, it is recommended to select at least a `4-core` machine. You can also verify that a "Prebuild" is ready. ![Codespace machine size](./codespace-machine-size.png) diff --git a/docs/workflow/codespace-machine-size.png b/docs/workflow/codespace-machine-size.png index 07945fb9ff672d..d0687c85b05f36 100644 Binary files a/docs/workflow/codespace-machine-size.png and b/docs/workflow/codespace-machine-size.png differ diff --git a/docs/workflow/debugging/coreclr/debugging-aot-compilers.md b/docs/workflow/debugging/coreclr/debugging-aot-compilers.md index 048d571df45f21..d21fa21a5cb77b 100644 --- a/docs/workflow/debugging/coreclr/debugging-aot-compilers.md +++ b/docs/workflow/debugging/coreclr/debugging-aot-compilers.md @@ -19,7 +19,7 @@ Built in debugging aids in the managed compilers --------------------------------- - When debugging a multi-threaded component of the compiler and not investigating a multi-threading issue itself, it is generally advisable to disable the use of multiple threads. -To do this use the `--parallelism 1` switch (for crossgen2) or `--singlethreaded` (for ILC) to specify that the maximum parallelism of the process shall be 1. +To do this use the `--parallelism 1` switch to specify that the maximum parallelism of the process shall be 1. - When debugging the behavior of compiling a single method, the compiler may be instructed to only compile a single method. This is done via the various --singlemethod options @@ -172,3 +172,7 @@ devenv /debugexe C:\git2\runtime\.dotnet\dotnet.exe "c:\git2\runtime\artifacts\t ``` This will launch the Visual Studio debugger, with a solution setup for debugging the dotnet.exe process. By default this solution will debug the native code of the process only. To debug the managed components, edit the properties on the solution and set the `Debugger Type` to `Managed (.NET Core, .NET 5+)` or `Mixed (.NET Core, .NET 5+)`. + +# Debugging compilation graph + +The AOT compilation is driven by a dependency graph. If you need to troubleshoot the dependency graph (to figure out why something was or wasn't generated) you can follow [this guide](debuging-compiler-dependency-analysis.md) diff --git a/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md b/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md new file mode 100644 index 00000000000000..cc918c391f62a1 --- /dev/null +++ b/docs/workflow/debugging/coreclr/debuging-compiler-dependency-analysis.md @@ -0,0 +1,47 @@ +Debugging Compiler Dependency Analysis +============================ + +The general technique is to identify what node is missing from the graph or is erroneously present in the graph, and change the dependency analysis logic to adjust the graph. This document describes the various ways of debugging to identify what's happening. + +Analysis techniques for the dependency graph. +1. Use the DependencyGraphViewer tool (if running on Windows). This tool is located in `src/coreclr/tools/aot/DependencyGraphViewer` + - This is the only convenient way to examine the graph while also simultaneously debugging the compiler. + - While this is currently Windows only due to use of WinForms, it would be fairly straightforward to make a command line based tool. + - Dependency graph does not support multiple simultaneous logging facilities, so make sure that you do not set IlcGenerateDgmlFile or invoke ILCompiler with the DGML generation turned on. +2. Pass command line switches to the compiler to generate a dependency graph dgml file. This will produce the same data as is viewable in the viewer tool, but in a textual xml format. + - Future efforts may make the xml file loadable by the viewer tool. +3. Instrument the compiler dependency analysis. (This may be necessary in cases where the viewer is unable to provide sufficient information about why the graph is structured as it is.) + +DependencyGraphViewer +==================================== + +This application allows viewing the dependency graph produced by the AOT compilation. + +Usage instructions: +1. Launch the process as an administrator +2. Run the compiler +- The compiler can be run to completion, or stopped. +3. Explore through the graph + +# Graphs View # +- Choose one of the graphs that appears in the Dependency Graphs view to explore. As compilers execute, new graphs will automatically appear here. +- The set of graphs loaded into the process is limited by available memory space. To clear the used memory, close all windows of the application. + +# Graph View # +- In the Dependency Graph view, enter a regular expression in the text box, and then press ""Filter"". This will display a list of the nodes in the graph which have names which match the regular expression. +- Commonly, if there is a object file symbol associated with the node it should be used as part of the regular expression. See the various implementations of GetName in the compiler for naming behavior. +- Additionally, the event source marking mode assigns an Id to each node, and that is found as the mark object on the node, so if a specific id is known, just type that in, and it will appear in the window. (This is for use when using this tool in parallel with debugging the compiler. + +# Single Node Exploration # +Once the interesting node(s) have been identified in the dependency graph window, select one of them, and then press Explore. + - In the Node Explorer window, the Dependent nodes (the ones which dependend on the current node are the nodes displayed above, and the Dependee nodes (the nodes that this node depends on) are displayed below. Each node in the list is paired with a textual reason as to why that edge in the graph exists. + - Select a node to explore further and press the corresponding button to make it happen. + +WhyDGML +======= +This tool can be used to visualize paths from a node of interest to the roots. To use it, pass command line option to the compiler to generate the DGML file (`--dgmllog name_of_output_file`) and then use this tool to find the path to the root. If you're looking at an optimized NativeAOT compilation, `--scandgmllog` might be preferable since it will have more details. +The input to the tool is the DGML file and name of a node of interest. The output is the list of reasons why that node was included. + +This tool located in folder `src/coreclr/tools/aot/WhyDgml` + +See https://github.com/dotnet/corert/pull/7962 for example of usage and output. diff --git a/docs/workflow/requirements/freebsd-requirements.md b/docs/workflow/requirements/freebsd-requirements.md index 941b949a252878..c14c1c1a27cf01 100644 --- a/docs/workflow/requirements/freebsd-requirements.md +++ b/docs/workflow/requirements/freebsd-requirements.md @@ -1,13 +1,12 @@ -Requirements to build dotnet/runtime on FreeBSD +Requirements to build and run dotnet/runtime on FreeBSD ===================== -This guide will walk you through the requirements needed to build dotnet/runtime on FreeBSD. We'll start by showing how to set up your environment from scratch. +This guide will walk you through the requirements needed to build and run dotnet/runtime on FreeBSD. We'll start by showing how to set up your environment from scratch. Since there is no official build and FreeBSD package, native build on FreeBSD is not trivial. There are generally three options, sorted by ease of use: - cross-compile on Linux using Docker - cross-compile on Linux using Toolchain - build on FreeBSD - Environment =========== @@ -65,3 +64,46 @@ sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake openssl nin Additionally, working dotnet cli with SDK is needed. On other platforms this would be downloaded automatically during build but it is not currently available for FreeBSD. It needs to be built once on supported platform or obtained via community resources. +Running on FreeBSD +------------------- +Install the following packages: +- icu +- libunwind +- lttng-ust (optional, debug support) +- krb5 +- openssl (optional, SSL support) +- libinotify +- terminfo-db (optional, terminal colors) + +The lines to install all the packages above using package manager. + +```sh +sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 openssl terminfo-db +``` + +Extract the SDK: +The canonical location for the SDK is `/usr/share/dotnet` + +"VERSION" is the SDK version being unpacked. + +```sh +sudo mkdir /usr/share/dotnet +tar xf /tmp/dotnet-sdk-VERSION-freebsd-x64.tar.gz -C /usr/share/dotnet/ +``` + +NuGet Packages: +The canonical location for the NuGet packages is `/var/cache/nuget` + +"VERSION" is the same version as the SDK from above. + +- Microsoft.NETCore.App.Host.freebsd-x64.VERSION.nupkg +- Microsoft.NETCore.App.Runtime.freebsd-x64.VERSION.nupkg +- Microsoft.AspNetCore.App.Runtime.freebsd-x64.VERSION.nupkg + +Add the following line to any `NuGet.config` you are using under the `` section: + +```xml + +``` + +Finally, either add `/usr/share/dotnet` to your PATH or create a symbolic for `/usr/share/dotnet/dotnet` diff --git a/eng/CodeAnalysis.src.globalconfig b/eng/CodeAnalysis.src.globalconfig index 400c8c432c21bf..0fc9bf8e5a7eeb 100644 --- a/eng/CodeAnalysis.src.globalconfig +++ b/eng/CodeAnalysis.src.globalconfig @@ -1444,7 +1444,7 @@ dotnet_diagnostic.IDE0057.severity = suggestion dotnet_diagnostic.IDE0058.severity = silent # IDE0059: Unnecessary assignment of a value -dotnet_diagnostic.IDE0059.severity = suggestion +dotnet_diagnostic.IDE0059.severity = warning # IDE0060: Remove unused parameter dotnet_diagnostic.IDE0060.severity = silent diff --git a/eng/Subsets.props b/eng/Subsets.props index f0bb31a28aea72..772fbfcb995329 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -243,7 +243,7 @@ - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e3a571f451cdea..a2cfe2c769fe8f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,8 +1,8 @@ - + https://github.com/dotnet/icu - d9371f17932fbf828f1d1e2f21a99b64ba40eba5 + aae7d341a8ee7841ed0cb1cf298ab17fe04c187b https://github.com/dotnet/msquic @@ -16,159 +16,159 @@ https://github.com/dotnet/wcf 7f504aabb1988e9a093c1e74d8040bd52feb2f01 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + e7e0ebc663c70ccb19c331af50d418a06dc92df8 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + e7e0ebc663c70ccb19c331af50d418a06dc92df8 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + e7e0ebc663c70ccb19c331af50d418a06dc92df8 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + e7e0ebc663c70ccb19c331af50d418a06dc92df8 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + e7e0ebc663c70ccb19c331af50d418a06dc92df8 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + e7e0ebc663c70ccb19c331af50d418a06dc92df8 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + e7e0ebc663c70ccb19c331af50d418a06dc92df8 - + https://github.com/dotnet/llvm-project - ef5d90bc37b53288e32d78dbf34eae32cd0893d3 + e7e0ebc663c70ccb19c331af50d418a06dc92df8 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 - + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 https://github.com/microsoft/vstest 140434f7109d357d0158ade9e5164a4861513965 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 https://github.com/dotnet/llvm-project @@ -202,53 +202,57 @@ https://github.com/dotnet/llvm-project 662aff66999c435aec09c58643e9fd703eadc3e0 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + a2af6294767b4a3f4c2ce787c5dda2abeeda7a00 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + a2af6294767b4a3f4c2ce787c5dda2abeeda7a00 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + a2af6294767b4a3f4c2ce787c5dda2abeeda7a00 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + a2af6294767b4a3f4c2ce787c5dda2abeeda7a00 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + a2af6294767b4a3f4c2ce787c5dda2abeeda7a00 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + a2af6294767b4a3f4c2ce787c5dda2abeeda7a00 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + a2af6294767b4a3f4c2ce787c5dda2abeeda7a00 - + https://github.com/dotnet/runtime - 834b278911962102919b3a7dec22ca6cb26bfa8a + a2af6294767b4a3f4c2ce787c5dda2abeeda7a00 - + https://github.com/dotnet/linker - 41467d340a3345f08cb8ba67c20c1ea40c57682f + 1a6468ff722c8d362f37638989ec01ab9975ac28 - + https://github.com/dotnet/xharness - 7ad8d01a879af9437a7c33d01409bd761700cdad + d33e67a6c2cc5fe415917c6f9bd17046a929dcc0 - + https://github.com/dotnet/xharness - 7ad8d01a879af9437a7c33d01409bd761700cdad + d33e67a6c2cc5fe415917c6f9bd17046a929dcc0 - + + https://github.com/dotnet/xharness + d33e67a6c2cc5fe415917c6f9bd17046a929dcc0 + + https://github.com/dotnet/arcade - 0cd94b1d02c03377d99f3739beb191591f6abee5 + 34bc5b1611e13bd0ee6a9f38ab8524d2ee489be5 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -266,13 +270,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-optimization 91d6b3c1f51888d166701510189505f35714665c - + https://github.com/dotnet/hotreload-utils - f0d838421286fed81005fd4ddf6562555b641b3b + 5bc948c6242bc9423c3269d122dcdf0ad6c06a83 - + https://github.com/dotnet/runtime-assets - f6e023ee68f858cd020a13dc9dfc13ba6a82b64b + a597df23119faf540d95cebab14b82f084c47384 https://github.com/dotnet/roslyn-analyzers diff --git a/eng/Versions.props b/eng/Versions.props index 47d31b37c8e334..8bc9373cc09ac7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,50 +42,50 @@ 3.11.0 - 4.0.0-4.final - 4.0.0-4.final + 4.0.1 + 4.0.1 3.3.2 - 4.0.0-4.final - 4.0.0-4.final + 4.0.1 + 4.0.1 7.0.0-preview1.21613.1 2.0.0-alpha.1.21525.11 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 2.5.1-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 - 7.0.0-beta.21621.3 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 2.5.1-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 + 7.0.0-beta.22056.6 6.0.0-preview.1.102 - 7.0.0-alpha.1.21620.1 - 7.0.0-alpha.1.21620.1 - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22059.2 + 7.0.0-alpha.1.22059.2 + 7.0.0-alpha.1.22059.2 3.1.0 - 7.0.0-alpha.1.21620.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 - 1.0.0-alpha.1.21630.1 + 7.0.0-alpha.1.22059.2 + 1.0.0-alpha.1.22060.1 + 1.0.0-alpha.1.22060.1 + 1.0.0-alpha.1.22060.1 + 1.0.0-alpha.1.22060.1 + 1.0.0-alpha.1.22060.1 + 1.0.0-alpha.1.22060.1 + 1.0.0-alpha.1.22060.1 + 1.0.0-alpha.1.22060.1 5.0.0 4.3.0 @@ -120,24 +120,24 @@ 5.0.0 5.0.0 4.9.0-rc2.21473.1 - 7.0.0-alpha.1.21620.1 - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22059.2 + 7.0.0-alpha.1.22059.2 4.5.4 4.5.0 - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22059.2 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 - 7.0.0-beta.21620.3 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 + 7.0.0-beta.22060.1 1.0.0-prerelease.21577.2 1.0.0-prerelease.21577.2 @@ -160,12 +160,13 @@ 1.0.1-prerelease-00006 16.9.0-preview-20201201-01 - 1.0.0-prerelease.21622.1 - 1.0.0-prerelease.21622.1 - 1.0.2-alpha.0.21620.2 + 1.0.0-prerelease.22062.1 + 1.0.0-prerelease.22062.1 + 1.0.0-prerelease.22062.1 + 1.0.2-alpha.0.22060.2 2.4.2-pre.9 2.4.2 - 1.3.0 + 3.1.0 12.0.3 2.0.4 4.12.0 @@ -175,10 +176,10 @@ 6.0.0-preview-20211019.1 - 7.0.100-1.21620.1 + 7.0.100-1.22053.1 $(MicrosoftNETILLinkTasksVersion) - 7.0.0-alpha.1.21620.1 + 7.0.0-alpha.1.22060.1 7.0.0-alpha.1.21529.3 diff --git a/eng/build.sh b/eng/build.sh index f1ef5958fdbc92..ea8e3089e95f4d 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -17,7 +17,7 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" usage() { echo "Common settings:" - echo " --arch (-a) Target platform: x86, x64, arm, armel, arm64, s390x or wasm." + echo " --arch (-a) Target platform: x86, x64, arm, armel, arm64, loongarch64, s390x or wasm." echo " [Default: Your machine's architecture.]" echo " --binaryLog (-bl) Output binary log." echo " --cross Optional argument to signify cross compilation." @@ -206,12 +206,12 @@ while [[ $# > 0 ]]; do fi passedArch="$(echo "$2" | tr "[:upper:]" "[:lower:]")" case "$passedArch" in - x64|x86|arm|armel|arm64|s390x|wasm) + x64|x86|arm|armel|arm64|loongarch64|s390x|wasm) arch=$passedArch ;; *) echo "Unsupported target architecture '$2'." - echo "The allowed values are x86, x64, arm, armel, arm64, s390x, and wasm." + echo "The allowed values are x86, x64, arm, armel, arm64, loongarch64, s390x, and wasm." exit 1 ;; esac diff --git a/eng/common/cross/arm/tizen-build-rootfs.sh b/eng/common/cross/arm/tizen-build-rootfs.sh new file mode 100644 index 00000000000000..9fdb32e920e22c --- /dev/null +++ b/eng/common/cross/arm/tizen-build-rootfs.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -e + +__ARM_HARDFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +__TIZEN_CROSSDIR="$__ARM_HARDFP_CrossDir/tizen" + +if [[ -z "$ROOTFS_DIR" ]]; then + echo "ROOTFS_DIR is not defined." + exit 1; +fi + +TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp +mkdir -p $TIZEN_TMP_DIR + +# Download files +echo ">>Start downloading files" +VERBOSE=1 $__ARM_HARDFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR +echo "<>Start constructing Tizen rootfs" +TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` +cd $ROOTFS_DIR +for f in $TIZEN_RPM_FILES; do + rpm2cpio $f | cpio -idm --quiet +done +echo "<>Start configuring Tizen rootfs" +ln -sfn asm-arm ./usr/include/asm +patch -p1 < $__TIZEN_CROSSDIR/tizen.patch +echo "</dev/null; then + VERBOSE=0 +fi + +Log() +{ + if [ $VERBOSE -ge $1 ]; then + echo ${@:2} + fi +} + +Inform() +{ + Log 1 -e "\x1B[0;34m$@\x1B[m" +} + +Debug() +{ + Log 2 -e "\x1B[0;32m$@\x1B[m" +} + +Error() +{ + >&2 Log 0 -e "\x1B[0;31m$@\x1B[m" +} + +Fetch() +{ + URL=$1 + FILE=$2 + PROGRESS=$3 + if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then + CURL_OPT="--progress-bar" + else + CURL_OPT="--silent" + fi + curl $CURL_OPT $URL > $FILE +} + +hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; } +hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; } +hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; } + +TMPDIR=$1 +if [ ! -d $TMPDIR ]; then + TMPDIR=./tizen_tmp + Debug "Create temporary directory : $TMPDIR" + mkdir -p $TMPDIR +fi + +TIZEN_URL=http://download.tizen.org/snapshots/tizen +BUILD_XML=build.xml +REPOMD_XML=repomd.xml +PRIMARY_XML=primary.xml +TARGET_URL="http://__not_initialized" + +Xpath_get() +{ + XPATH_RESULT='' + XPATH=$1 + XML_FILE=$2 + RESULT=$(xmllint --xpath $XPATH $XML_FILE) + if [[ -z ${RESULT// } ]]; then + Error "Can not find target from $XML_FILE" + Debug "Xpath = $XPATH" + exit 1 + fi + XPATH_RESULT=$RESULT +} + +fetch_tizen_pkgs_init() +{ + TARGET=$1 + PROFILE=$2 + Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE" + + TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs + if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi + mkdir -p $TMP_PKG_DIR + + PKG_URL=$TIZEN_URL/$PROFILE/latest + + BUILD_XML_URL=$PKG_URL/$BUILD_XML + TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML + TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML + TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML + TMP_PRIMARYGZ=${TMP_PRIMARY}.gz + + Fetch $BUILD_XML_URL $TMP_BUILD + + Debug "fetch $BUILD_XML_URL to $TMP_BUILD" + + TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()" + Xpath_get $TARGET_XPATH $TMP_BUILD + TARGET_PATH=$XPATH_RESULT + TARGET_URL=$PKG_URL/$TARGET_PATH + + REPOMD_URL=$TARGET_URL/repodata/repomd.xml + PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)' + + Fetch $REPOMD_URL $TMP_REPOMD + + Debug "fetch $REPOMD_URL to $TMP_REPOMD" + + Xpath_get $PRIMARY_XPATH $TMP_REPOMD + PRIMARY_XML_PATH=$XPATH_RESULT + PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH + + Fetch $PRIMARY_URL $TMP_PRIMARYGZ + + Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ" + + gunzip $TMP_PRIMARYGZ + + Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY" +} + +fetch_tizen_pkgs() +{ + ARCH=$1 + PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)' + + PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())' + + for pkg in ${@:2} + do + Inform "Fetching... $pkg" + XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg} + XPATH=${XPATH/_ARCH_/$ARCH} + Xpath_get $XPATH $TMP_PRIMARY + PKG_PATH=$XPATH_RESULT + + XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg} + XPATH=${XPATH/_ARCH_/$ARCH} + Xpath_get $XPATH $TMP_PRIMARY + CHECKSUM=$XPATH_RESULT + + PKG_URL=$TARGET_URL/$PKG_PATH + PKG_FILE=$(basename $PKG_PATH) + PKG_PATH=$TMPDIR/$PKG_FILE + + Debug "Download $PKG_URL to $PKG_PATH" + Fetch $PKG_URL $PKG_PATH true + + echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null + if [ $? -ne 0 ]; then + Error "Fail to fetch $PKG_URL to $PKG_PATH" + Debug "Checksum = $CHECKSUM" + exit 1 + fi + done +} + +Inform "Initialize arm base" +fetch_tizen_pkgs_init standard base +Inform "fetch common packages" +fetch_tizen_pkgs armv7hl gcc gcc-devel-static glibc glibc-devel libicu libicu-devel libatomic linux-glibc-devel keyutils keyutils-devel libkeyutils +Inform "fetch coreclr packages" +fetch_tizen_pkgs armv7hl lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu +Inform "fetch corefx packages" +fetch_tizen_pkgs armv7hl libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel + +Inform "Initialize standard unified" +fetch_tizen_pkgs_init standard unified +Inform "fetch corefx packages" +fetch_tizen_pkgs armv7hl gssdp gssdp-devel tizen-release + diff --git a/eng/common/cross/arm/tizen/tizen.patch b/eng/common/cross/arm/tizen/tizen.patch new file mode 100644 index 00000000000000..fb12ade7250ae9 --- /dev/null +++ b/eng/common/cross/arm/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) ) diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 5102245b7b5e3f..e94d13d62ef64d 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -185,8 +185,8 @@ while :; do __LLDB_Package="liblldb-6.0-dev" ;; tizen) - if [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then - echo "Tizen is available only for armel and arm64." + if [ "$__BuildArch" != "arm" ] && [ "$__BuildArch" != "armel" ] && [ "$__BuildArch" != "arm64" ]; then + echo "Tizen is available only for arm, armel and arm64." usage; exit 1; fi diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 9d22fc92693031..f7878dddd39211 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -34,6 +34,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm") else() set(TOOLCHAIN "arm-linux-gnueabihf") endif() + if(TIZEN) + set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf/9.2.0") + endif() elseif(TARGET_ARCH_NAME STREQUAL "arm64") set(CMAKE_SYSTEM_PROCESSOR aarch64) if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl) @@ -66,6 +69,10 @@ endif() # Specify include paths if(TIZEN) + if(TARGET_ARCH_NAME STREQUAL "arm") + include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) + include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7hl-tizen-linux-gnueabihf) + endif() if(TARGET_ARCH_NAME STREQUAL "armel") include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi) @@ -160,7 +167,7 @@ if(LINUX) add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}") endif() -if(TARGET_ARCH_NAME STREQUAL "armel") +if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$") if(TIZEN) add_toolchain_linker_flag("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib") @@ -215,7 +222,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") endif() if(TIZEN) - if(TARGET_ARCH_NAME MATCHES "^(armel|arm64)$") + if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$") add_compile_options(-Wno-deprecated-declarations) # compile-time option add_compile_options(-D__extern_always_inline=inline) # compile-time option endif() diff --git a/eng/common/generate-graph-files.ps1 b/eng/common/generate-graph-files.ps1 deleted file mode 100644 index 0728b1a8b570d6..00000000000000 --- a/eng/common/generate-graph-files.ps1 +++ /dev/null @@ -1,86 +0,0 @@ -Param( - [Parameter(Mandatory=$true)][string] $barToken, # Token generated at https://maestro-prod.westus2.cloudapp.azure.com/Account/Tokens - [Parameter(Mandatory=$true)][string] $gitHubPat, # GitHub personal access token from https://github.com/settings/tokens (no auth scopes needed) - [Parameter(Mandatory=$true)][string] $azdoPat, # Azure Dev Ops tokens from https://dev.azure.com/dnceng/_details/security/tokens (code read scope needed) - [Parameter(Mandatory=$true)][string] $outputFolder, # Where the graphviz.txt file will be created - [string] $darcVersion, # darc's version - [string] $graphvizVersion = '2.38', # GraphViz version - [switch] $includeToolset # Whether the graph should include toolset dependencies or not. i.e. arcade, optimization. For more about - # toolset dependencies see https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#toolset-vs-product-dependencies -) - -function CheckExitCode ([string]$stage) -{ - $exitCode = $LASTEXITCODE - if ($exitCode -ne 0) { - Write-PipelineTelemetryError -Category 'Arcade' -Message "Something failed in stage: '$stage'. Check for errors above. Exiting now..." - ExitWithExitCode $exitCode - } -} - -try { - $ErrorActionPreference = 'Stop' - . $PSScriptRoot\tools.ps1 - - Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') - - Push-Location $PSScriptRoot - - Write-Host 'Installing darc...' - . .\darc-init.ps1 -darcVersion $darcVersion - CheckExitCode 'Running darc-init' - - $engCommonBaseDir = Join-Path $PSScriptRoot 'native\' - $graphvizInstallDir = CommonLibrary\Get-NativeInstallDirectory - $nativeToolBaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external' - $installBin = Join-Path $graphvizInstallDir 'bin' - - Write-Host 'Installing dot...' - .\native\install-tool.ps1 -ToolName graphviz -InstallPath $installBin -BaseUri $nativeToolBaseUri -CommonLibraryDirectory $engCommonBaseDir -Version $graphvizVersion -Verbose - - $darcExe = "$env:USERPROFILE\.dotnet\tools" - $darcExe = Resolve-Path "$darcExe\darc.exe" - - Create-Directory $outputFolder - - # Generate 3 graph descriptions: - # 1. Flat with coherency information - # 2. Graphviz (dot) file - # 3. Standard dependency graph - $graphVizFilePath = "$outputFolder\graphviz.txt" - $graphVizImageFilePath = "$outputFolder\graph.png" - $normalGraphFilePath = "$outputFolder\graph-full.txt" - $flatGraphFilePath = "$outputFolder\graph-flat.txt" - $baseOptions = @( '--github-pat', "$gitHubPat", '--azdev-pat', "$azdoPat", '--password', "$barToken" ) - - if ($includeToolset) { - Write-Host 'Toolsets will be included in the graph...' - $baseOptions += @( '--include-toolset' ) - } - - Write-Host 'Generating standard dependency graph...' - & "$darcExe" get-dependency-graph @baseOptions --output-file $normalGraphFilePath - CheckExitCode 'Generating normal dependency graph' - - Write-Host 'Generating flat dependency graph and graphviz file...' - & "$darcExe" get-dependency-graph @baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath - CheckExitCode 'Generating flat and graphviz dependency graph' - - Write-Host "Generating graph image $graphVizFilePath" - $dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe" - & "$dotFilePath" -Tpng -o"$graphVizImageFilePath" "$graphVizFilePath" - CheckExitCode 'Generating graphviz image' - - Write-Host "'$graphVizFilePath', '$flatGraphFilePath', '$normalGraphFilePath' and '$graphVizImageFilePath' created!" -} -catch { - if (!$includeToolset) { - Write-Host 'This might be a toolset repo which includes only toolset dependencies. ' -NoNewline -ForegroundColor Yellow - Write-Host 'Since -includeToolset is not set there is no graph to create. Include -includeToolset and try again...' -ForegroundColor Yellow - } - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'Arcade' -Message $_ - ExitWithExitCode 1 -} finally { - Pop-Location -} \ No newline at end of file diff --git a/eng/common/sdl/configure-sdl-tool.ps1 b/eng/common/sdl/configure-sdl-tool.ps1 index 8a68fc24b11b0d..bdbf49e6c71de8 100644 --- a/eng/common/sdl/configure-sdl-tool.ps1 +++ b/eng/common/sdl/configure-sdl-tool.ps1 @@ -15,7 +15,9 @@ Param( # Optional: Additional params to add to any tool using CredScan. [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional params to add to any tool using PoliCheck. - [string[]] $PoliCheckAdditionalRunConfigParams + [string[]] $PoliCheckAdditionalRunConfigParams, + # Optional: Additional params to add to any tool using CodeQL/Semmle. + [string[]] $CodeQLAdditionalRunConfigParams ) $ErrorActionPreference = 'Stop' @@ -78,6 +80,11 @@ try { $tool.Args += "`"Target < $TargetDirectory`"" } $tool.Args += $PoliCheckAdditionalRunConfigParams + } elseif ($tool.Name -eq 'semmle' -or $tool.Name -eq 'codeql') { + if ($targetDirectory) { + $tool.Args += "`"SourceCodeDirectory < $TargetDirectory`"" + } + $tool.Args += $CodeQLAdditionalRunConfigParams } # Create variable pointing to the args array directly so we can use splat syntax later. diff --git a/eng/common/sdl/execute-all-sdl-tools.ps1 b/eng/common/sdl/execute-all-sdl-tools.ps1 index e5bef8ebd3a3b4..4797e012c7d2f7 100644 --- a/eng/common/sdl/execute-all-sdl-tools.ps1 +++ b/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -34,6 +34,7 @@ Param( [string] $GuardianLoggerLevel='Standard', # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") [string[]] $PoliCheckAdditionalRunConfigParams, # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") + [string[]] $CodeQLAdditionalRunConfigParams, # Optional: Additional Params to custom build a Semmle/CodeQL run config in the format @("xyz < abc","sdf < 1") [bool] $BreakOnFailure=$False # Optional: Fail the build if there were errors during the run ) @@ -105,7 +106,8 @@ try { -AzureDevOpsAccessToken $AzureDevOpsAccessToken ` -GuardianLoggerLevel $GuardianLoggerLevel ` -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams ` - -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams + -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams ` + -CodeQLAdditionalRunConfigParams $CodeQLAdditionalRunConfigParams if ($BreakOnFailure) { Exit-IfNZEC "Sdl" } diff --git a/eng/common/templates/job/generate-graph-files.yml b/eng/common/templates/job/generate-graph-files.yml deleted file mode 100644 index e54ce956f9088e..00000000000000 --- a/eng/common/templates/job/generate-graph-files.yml +++ /dev/null @@ -1,48 +0,0 @@ -parameters: - # Optional: dependencies of the job - dependsOn: '' - - # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool - pool: {} - - # Optional: Include toolset dependencies in the generated graph files - includeToolset: false - -jobs: -- job: Generate_Graph_Files - - dependsOn: ${{ parameters.dependsOn }} - - displayName: Generate Graph Files - - pool: ${{ parameters.pool }} - - variables: - # Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT - # DotNet-AllOrgs-Darc-Pats provides: dn-bot-devdiv-dnceng-rw-code-pat - - group: Publish-Build-Assets - - group: DotNet-AllOrgs-Darc-Pats - - name: _GraphArguments - value: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) - -azdoPat $(dn-bot-devdiv-dnceng-rw-code-pat) - -barToken $(MaestroAccessToken) - -outputFolder '$(Build.StagingDirectory)/GraphFiles/' - - ${{ if ne(parameters.includeToolset, 'false') }}: - - name: _GraphArguments - value: ${{ variables._GraphArguments }} -includeToolset - - steps: - - task: PowerShell@2 - displayName: Generate Graph Files - inputs: - filePath: eng\common\generate-graph-files.ps1 - arguments: $(_GraphArguments) - continueOnError: true - - task: PublishBuildArtifacts@1 - displayName: Publish Graph to Artifacts - inputs: - PathtoPublish: '$(Build.StagingDirectory)/GraphFiles' - PublishLocation: Container - ArtifactName: GraphFiles - continueOnError: true - condition: always() diff --git a/eng/common/templates/jobs/codeql-build.yml b/eng/common/templates/jobs/codeql-build.yml new file mode 100644 index 00000000000000..f7dc5ea4aaa63c --- /dev/null +++ b/eng/common/templates/jobs/codeql-build.yml @@ -0,0 +1,31 @@ +parameters: + # See schema documentation in /Documentation/AzureDevOps/TemplateSchema.md + continueOnError: false + # Required: A collection of jobs to run - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job + jobs: [] + # Optional: if specified, restore and use this version of Guardian instead of the default. + overrideGuardianVersion: '' + +jobs: +- template: /eng/common/templates/jobs/jobs.yml + parameters: + enableMicrobuild: false + enablePublishBuildArtifacts: false + enablePublishTestResults: false + enablePublishBuildAssets: false + enablePublishUsingPipelines: false + enableTelemetry: true + + variables: + - group: Publish-Build-Assets + # The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in + # sync with the packages.config file. + - name: DefaultGuardianVersion + value: 0.109.0 + - name: GuardianPackagesConfigFile + value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config + - name: GuardianVersion + value: ${{ coalesce(parameters.overrideGuardianVersion, '$(DefaultGuardianVersion)') }} + + jobs: ${{ parameters.jobs }} + diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml index 8dd1fdbd144a06..ff4ab75c886dc7 100644 --- a/eng/common/templates/jobs/jobs.yml +++ b/eng/common/templates/jobs/jobs.yml @@ -87,13 +87,3 @@ jobs: runAsPublic: ${{ parameters.runAsPublic }} publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }} - - - ${{ if eq(parameters.graphFileGeneration.enabled, true) }}: - - template: ../job/generate-graph-files.yml - parameters: - continueOnError: ${{ parameters.continueOnError }} - includeToolset: ${{ parameters.graphFileGeneration.includeToolset }} - dependsOn: - - Asset_Registry_Publish - pool: - vmImage: 'windows-2019' diff --git a/eng/common/templates/steps/execute-codeql.yml b/eng/common/templates/steps/execute-codeql.yml new file mode 100644 index 00000000000000..3930b1630214b3 --- /dev/null +++ b/eng/common/templates/steps/execute-codeql.yml @@ -0,0 +1,32 @@ +parameters: + # Language that should be analyzed. Defaults to csharp + language: csharp + # Build Commands + buildCommands: '' + overrideParameters: '' # Optional: to override values for parameters. + additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")' + # Optional: if specified, restore and use this version of Guardian instead of the default. + overrideGuardianVersion: '' + # Optional: if true, publish the '.gdn' folder as a pipeline artifact. This can help with in-depth + # diagnosis of problems with specific tool configurations. + publishGuardianDirectoryToPipeline: false + # The script to run to execute all SDL tools. Use this if you want to use a script to define SDL + # parameters rather than relying on YAML. It may be better to use a local script, because you can + # reproduce results locally without piecing together a command based on the YAML. + executeAllSdlToolsScript: 'eng/common/sdl/execute-all-sdl-tools.ps1' + # There is some sort of bug (has been reported) in Azure DevOps where if this parameter is named + # 'continueOnError', the parameter value is not correctly picked up. + # This can also be remedied by the caller (post-build.yml) if it does not use a nested parameter + # optional: determines whether to continue the build if the step errors; + sdlContinueOnError: false + +steps: +- template: /eng/common/templates/steps/execute-sdl.yml + parameters: + overrideGuardianVersion: ${{ parameters.overrideGuardianVersion }} + executeAllSdlToolsScript: ${{ parameters.executeAllSdlToolsScript }} + overrideParameters: ${{ parameters.overrideParameters }} + additionalParameters: '${{ parameters.additionalParameters }} + -CodeQLAdditionalRunConfigParams @("BuildCommands < ${{ parameters.buildCommands }}", "Language < ${{ parameters.language }}")' + publishGuardianDirectoryToPipeline: ${{ parameters.publishGuardianDirectoryToPipeline }} + sdlContinueOnError: ${{ parameters.sdlContinueOnError }} \ No newline at end of file diff --git a/eng/generators.targets b/eng/generators.targets index 4c32554b5e2195..843842937ef3f7 100644 --- a/eng/generators.targets +++ b/eng/generators.targets @@ -84,10 +84,6 @@ true $(DefineConstants);DLLIMPORTGENERATOR_INTERNALUNSAFE - - - $(DefineConstants);DLLIMPORTGENERATOR_ENABLED - diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index 8f1a746752a347..373091b13a0014 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -197,7 +197,7 @@ usage() echo "" echo "Common Options:" echo "" - echo "BuildArch can be: -arm, -armel, -arm64, -s390x, x64, x86, -wasm" + echo "BuildArch can be: -arm, -armel, -arm64, -loongarch64, -s390x, x64, x86, -wasm" echo "BuildType can be: -debug, -checked, -release" echo "-os: target OS (defaults to running OS)" echo "-bindir: output directory (defaults to $__ProjectRoot/artifacts)" @@ -377,6 +377,10 @@ while :; do __BuildArch=x64 ;; + loongarch64|-loongarch64) + __BuildArch=loongarch64 + ;; + s390x|-s390x) __BuildArch=s390x ;; diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 5a20591cc025bb..fad1ac58d39c88 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -216,6 +216,9 @@ elseif (CLR_CMAKE_HOST_ARCH_ARM) elseif (CLR_CMAKE_HOST_ARCH_ARM64) set(ARCH_HOST_NAME arm64) add_definitions(-DHOST_ARM64 -DHOST_64BIT) +elseif (CLR_CMAKE_HOST_ARCH_LOONGARCH64) + set(ARCH_HOST_NAME loongarch64) + add_definitions(-DHOST_LOONGARCH64 -DHOST_64BIT) elseif (CLR_CMAKE_HOST_ARCH_S390X) set(ARCH_HOST_NAME s390x) add_definitions(-DHOST_S390X -DHOST_64BIT -DBIGENDIAN) @@ -237,6 +240,8 @@ if (CLR_CMAKE_HOST_UNIX) message("Detected Linux ARM") elseif(CLR_CMAKE_HOST_UNIX_ARM64) message("Detected Linux ARM64") + elseif(CLR_CMAKE_HOST_UNIX_LOONGARCH64) + message("Detected Linux LOONGARCH64") elseif(CLR_CMAKE_HOST_UNIX_X86) message("Detected Linux i686") elseif(CLR_CMAKE_HOST_UNIX_S390X) @@ -301,6 +306,11 @@ elseif (CLR_CMAKE_TARGET_ARCH_I386) set(ARCH_SOURCES_DIR i386) add_compile_definitions($<$>>:TARGET_X86>) add_compile_definitions($<$>>:TARGET_32BIT>) +elseif (CLR_CMAKE_TARGET_ARCH_LOONGARCH64) + set(ARCH_TARGET_NAME loongarch64) + set(ARCH_SOURCES_DIR loongarch64) + add_compile_definitions($<$>>:TARGET_LOONGARCH64>) + add_compile_definitions($<$>>:TARGET_64BIT>) elseif (CLR_CMAKE_TARGET_ARCH_S390X) set(ARCH_TARGET_NAME s390x) set(ARCH_SOURCES_DIR s390x) diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index f5c8abe66991a0..cdf33430b49f11 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -43,6 +43,8 @@ if(CLR_CMAKE_HOST_OS STREQUAL Linux) set(CLR_CMAKE_HOST_UNIX_ARM 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) set(CLR_CMAKE_HOST_UNIX_ARM64 1) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64) + set(CLR_CMAKE_HOST_UNIX_LOONGARCH64 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL i686 OR CMAKE_SYSTEM_PROCESSOR STREQUAL x86) set(CLR_CMAKE_HOST_UNIX_X86 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL s390x) @@ -218,6 +220,9 @@ if(CLR_CMAKE_HOST_UNIX_ARM) elseif(CLR_CMAKE_HOST_UNIX_ARM64) set(CLR_CMAKE_HOST_ARCH_ARM64 1) set(CLR_CMAKE_HOST_ARCH "arm64") +elseif(CLR_CMAKE_HOST_UNIX_LOONGARCH64) + set(CLR_CMAKE_HOST_ARCH_LOONGARCH64 1) + set(CLR_CMAKE_HOST_ARCH "loongarch64") elseif(CLR_CMAKE_HOST_UNIX_AMD64) set(CLR_CMAKE_HOST_ARCH_AMD64 1) set(CLR_CMAKE_HOST_ARCH "x64") @@ -268,6 +273,8 @@ if (CLR_CMAKE_TARGET_ARCH STREQUAL x64) set(CLR_CMAKE_TARGET_ARCH_I386 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm64) set(CLR_CMAKE_TARGET_ARCH_ARM64 1) + elseif(CLR_CMAKE_TARGET_ARCH STREQUAL loongarch64) + set(CLR_CMAKE_TARGET_ARCH_LOONGARCH64 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm) set(CLR_CMAKE_TARGET_ARCH_ARM 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armel) @@ -374,6 +381,8 @@ if(CLR_CMAKE_TARGET_UNIX) set(CLR_CMAKE_TARGET_UNIX_ARM 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm64) set(CLR_CMAKE_TARGET_UNIX_ARM64 1) + elseif(CLR_CMAKE_TARGET_ARCH STREQUAL loongarch64) + set(CLR_CMAKE_TARGET_UNIX_LOONGARCH64 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL x86) set(CLR_CMAKE_TARGET_UNIX_X86 1) elseif(CLR_CMAKE_TARGET_ARCH STREQUAL s390x) diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index 87b4d15734bf69..4e68a9be01e8c9 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -4,7 +4,7 @@ function(clr_unknown_arch) elseif(CLR_CROSS_COMPONENTS_BUILD) message(FATAL_ERROR "Only AMD64, I386 host are supported for linux cross-architecture component. Found: ${CMAKE_SYSTEM_PROCESSOR}") else() - message(FATAL_ERROR "Only AMD64, ARM64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}") + message(FATAL_ERROR "Only AMD64, ARM64, LOONGARCH64 and ARM are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}") endif() endfunction() @@ -94,6 +94,10 @@ function(find_unwind_libs UnwindLibs) find_library(UNWIND_ARCH NAMES unwind-aarch64) endif() + if(CLR_CMAKE_HOST_ARCH_LOONGARCH64) + find_library(UNWIND_ARCH NAMES unwind-loongarch64) + endif() + if(CLR_CMAKE_HOST_ARCH_AMD64) find_library(UNWIND_ARCH NAMES unwind-x86_64) endif() diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh index fc4078fa3a9aa4..586534be1c8aa9 100644 --- a/eng/native/init-os-and-arch.sh +++ b/eng/native/init-os-and-arch.sh @@ -37,6 +37,10 @@ case "$CPUName" in arch=arm64 ;; + loongarch64) + arch=loongarch64 + ;; + amd64|x86_64) arch=x64 ;; diff --git a/eng/native/tryrun.cmake b/eng/native/tryrun.cmake index 96199969da69c9..e8a04c5698ad35 100644 --- a/eng/native/tryrun.cmake +++ b/eng/native/tryrun.cmake @@ -68,7 +68,7 @@ if(DARWIN) else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!") endif() -elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|s390x|x86)$" OR FREEBSD OR ILLUMOS) +elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|loongarch64|s390x|x86)$" OR FREEBSD OR ILLUMOS) set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1) set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 0) set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0) @@ -146,9 +146,9 @@ elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|s390x|x86)$" OR FREEBSD OR IL set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0) endif() else() - message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, s390x and x86 are supported!") + message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, loongarch64, s390x and x86 are supported!") endif() -if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x") +if(TARGET_ARCH_NAME STREQUAL "x86" OR TARGET_ARCH_NAME STREQUAL "s390x" OR TARGET_ARCH_NAME STREQUAL "loongarch64") set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0) endif() diff --git a/eng/packaging.targets b/eng/packaging.targets index 6d2bbce10da346..667837fbff1067 100644 --- a/eng/packaging.targets +++ b/eng/packaging.targets @@ -23,6 +23,10 @@ '$(PreReleaseVersionLabel)' != 'servicing' and '$(GitHubRepositoryName)' != 'runtimelab'">true false + + true $(XmlDocFileRoot)1033\$(AssemblyName).xml true @@ -259,7 +263,7 @@ diff --git a/eng/pipelines/coreclr/perf_slow.yml b/eng/pipelines/coreclr/perf_slow.yml index e8410af6d361f9..04994eac96a44b 100644 --- a/eng/pipelines/coreclr/perf_slow.yml +++ b/eng/pipelines/coreclr/perf_slow.yml @@ -137,10 +137,11 @@ jobs: buildConfig: release container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 runtimeFlavor: mono + runtimeVariant: 'llvmaot' platforms: - Linux_arm64 jobParameters: - buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) + buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true nameSuffix: AOT isOfficialBuild: false extraStepsTemplate: /eng/pipelines/common/upload-artifact-step.yml diff --git a/eng/pipelines/coreclr/superpmi-collect.yml b/eng/pipelines/coreclr/superpmi-collect.yml index 0d41f151d6b554..8918ee8cbfcd39 100644 --- a/eng/pipelines/coreclr/superpmi-collect.yml +++ b/eng/pipelines/coreclr/superpmi-collect.yml @@ -30,8 +30,7 @@ jobs: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml buildConfig: checked platforms: - # Linux tests are built on the OSX machines. - # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -46,6 +45,16 @@ jobs: - Linux_x64 - windows_x64 +# superpmi-collect-job that targets macOS/arm64 depends on coreclr binaries produced by the macOS/x64 job +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml + buildConfig: checked + platforms: + - OSX_x64 + jobParameters: + testGroup: outerloop + - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -62,6 +71,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -83,6 +93,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -105,6 +116,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -127,6 +139,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 - Linux_arm - Linux_arm64 - Linux_x64 @@ -148,6 +161,7 @@ jobs: platforms: # Linux tests are built on the OSX machines. # - OSX_x64 + - OSX_arm64 #TODO: Need special handling of running "benchmark build" from inside TMP folder on helix machine. # - Linux_arm # - Linux_arm64 diff --git a/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml b/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml index 1ac235f6f6d08e..be05b52b6b1859 100644 --- a/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml +++ b/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml @@ -106,7 +106,7 @@ jobs: steps: - ${{ parameters.steps }} - - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_collect_setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 50 # size in MB + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_collect_setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -platform $(osGroup) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -collection_type $(CollectionType) -max_size 50 # size in MB displayName: ${{ format('SuperPMI setup ({0})', parameters.osGroup) }} # Create required directories for merged mch collection and superpmi logs @@ -159,6 +159,10 @@ jobs: artifactName: 'SuperPMI_Collection_$(CollectionName)_$(CollectionType)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' displayName: ${{ format('Upload artifacts SuperPMI {0}-{1} collection', parameters.collectionName, parameters.collectionType) }} + # Ensure the Python azure-storage-blob package is installed before doing the upload. + - script: $(PipScript) install --user --upgrade pip && $(PipScript) install --user azure.storage.blob==12.5.0 --force-reinstall + displayName: Upgrade Pip to latest and install azure-storage-blob Python package + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -log_level DEBUG -arch $(archType) -build_type $(buildConfig) -mch_files $(MergedMchFileLocation)$(CollectionName).$(CollectionType).$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper) displayName: ${{ format('Upload SuperPMI {0}-{1} collection to Azure Storage', parameters.collectionName, parameters.collectionType) }} env: diff --git a/eng/pipelines/coreclr/templates/superpmi-collect-job.yml b/eng/pipelines/coreclr/templates/superpmi-collect-job.yml index 6c990a25ff4aa3..652d17af08eba5 100644 --- a/eng/pipelines/coreclr/templates/superpmi-collect-job.yml +++ b/eng/pipelines/coreclr/templates/superpmi-collect-job.yml @@ -84,8 +84,8 @@ jobs: - template: /eng/pipelines/common/download-artifact-step.yml parameters: unpackFolder: '$(Build.SourcesDirectory)/artifacts/tests/libraries_zipped/$(osGroup).$(archType).$(buildConfigUpper)' - artifactFileName: 'libraries_test_assets_${{ parameters.osGroup }}_x64_Release$(archiveExtension)' - artifactName: ${{ format('libraries_test_assets_{0}_x64_Release', parameters.osGroup) }} + artifactFileName: 'libraries_test_assets_${{ parameters.osGroup }}_$(archType)_Release$(archiveExtension)' + artifactName: ${{ format('libraries_test_assets_{0}_$(archType)_Release', parameters.osGroup) }} displayName: 'generic libraries test artifacts' # Unzip individual test projects diff --git a/eng/pipelines/runtime-manual.yml b/eng/pipelines/runtime-manual.yml index a4391cff70da59..d6182de37f3bed 100644 --- a/eng/pipelines/runtime-manual.yml +++ b/eng/pipelines/runtime-manual.yml @@ -488,9 +488,7 @@ jobs: timeoutInMinutes: 180 condition: >- or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml @@ -498,6 +496,8 @@ jobs: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) scenarios: + - normal + - WasmTestOnBrowser - WasmTestOnNodeJs condition: >- or( diff --git a/eng/run-test.sh b/eng/run-test.sh index 64474cc435af16..0475cff40cd839 100644 --- a/eng/run-test.sh +++ b/eng/run-test.sh @@ -31,7 +31,7 @@ usage() echo " default: Debug" echo " --os OS to run (FreeBSD, Linux, NetBSD, illumos or Solaris)" echo " default: detect current OS" - echo " --arch Architecture to run (x64, arm, armel, x86, arm64)" + echo " --arch Architecture to run (x64, arm, armel, x86, arm64, loongarch64)" echo " default: detect current architecture" echo echo "Execution options:" diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets index 9dd37bef8fa1c3..4213c84e709d9c 100644 --- a/eng/targetingpacks.targets +++ b/eng/targetingpacks.targets @@ -33,7 +33,7 @@ LatestRuntimeFrameworkVersion="$(ProductVersion)" RuntimeFrameworkName="$(LocalFrameworkOverrideName)" RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.**RID**" - RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64" + RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64" TargetFramework="$(NetCoreAppCurrent)" TargetingPackName="$(LocalFrameworkOverrideName).Ref" TargetingPackVersion="$(ProductVersion)" @@ -43,13 +43,13 @@ RuntimeFrameworkName="$(LocalFrameworkOverrideName)" LatestRuntimeFrameworkVersion="$(ProductVersion)" RuntimePackNamePatterns="$(LocalFrameworkOverrideName).Runtime.Mono.**RID**" - RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86" + RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-loongarch64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;maccatalyst-x64;maccatalyst-arm64;browser-wasm;ios-arm64;ios-arm;iossimulator-arm64;iossimulator-x64;iossimulator-x86;tvos-arm64;tvossimulator-arm64;tvossimulator-x64;android-arm64;android-arm;android-x64;android-x86" RuntimePackLabels="Mono" Condition="'@(KnownRuntimePack)' == '' or !@(KnownRuntimePack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))"/> - @@ -169,6 +168,7 @@ + diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 192363c4b170a1..da8da1d2f4bfa9 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -198,7 +198,8 @@ + AfterTargets="ComputeResolvedFilesToPublishList" + Condition="'$(TestFramework)' == 'xunit'"> <_runnerFilesToPublish Include="$(AndroidTestRunnerDir)*" Condition="'$(TargetOS)' == 'Android'" /> <_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'iOSSimulator' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'tvOSSimulator'" /> diff --git a/eng/testing/tests.props b/eng/testing/tests.props index a6a9034a8099d2..86c661d4bb2813 100644 --- a/eng/testing/tests.props +++ b/eng/testing/tests.props @@ -38,6 +38,10 @@ + + + + $(RunTestsCommand) --runtime-path "$(NetCoreAppCurrentTestHostPath.TrimEnd('\/'))" $(RunTestsCommand) --rsp-file "$(TestRspFile)" - "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS.ToLowerInvariant()) $(TestProjectName) $(AdditionalXHarnessArguments) +
+ + + "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) $(TargetOS.ToLowerInvariant()) $(TestProjectName) + $(RunTestsCommand) $(Configuration) $(AdditionalXHarnessArguments) + $(RunTestsCommand) $(AdditionalXHarnessArguments) "$(RunScriptOutputPath)" $(JSEngine) $(AssemblyName).dll $(Scenario) diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 273ab76ef90a3f..191d2c2295690f 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -47,7 +47,8 @@ <_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode) <_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs) - <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps'">--run WasmTestRunner.dll $(AssemblyName).dll + <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps' and '$(WasmMainAssemblyFileName)' == ''">--run WasmTestRunner.dll $(AssemblyName).dll + <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(WasmMainAssemblyFileName)' != ''">--run $(WasmMainAssemblyFileName) <_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll <_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs) diff --git a/global.json b/global.json index e2c9f881274f55..f191cfdd2e3525 100644 --- a/global.json +++ b/global.json @@ -12,12 +12,12 @@ "python3": "3.7.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.21621.3", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21621.3", - "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21621.3", - "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.21621.3", + "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.22056.6", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22056.6", + "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22056.6", + "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22056.6", "Microsoft.Build.NoTargets": "3.1.0", "Microsoft.Build.Traversal": "3.0.23", - "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.21620.1" + "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.22059.2" } } diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj index f62c8b95b7c143..e1230d59401d86 100644 --- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -78,6 +78,10 @@ AnyCPU $(DefineConstants);TARGET_ARM64 + + AnyCPU + $(DefineConstants);TARGET_LOONGARCH64 + diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs index 240a78ecfdde75..977d73e5c3b990 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs @@ -15,7 +15,7 @@ namespace System { [NonVersionable] - public unsafe partial struct RuntimeTypeHandle : ISerializable + public unsafe partial struct RuntimeTypeHandle : IEquatable, ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. internal RuntimeTypeHandle GetNativeHandle() @@ -814,7 +814,7 @@ RuntimeMethodHandleInternal Value } [NonVersionable] - public unsafe partial struct RuntimeMethodHandle : ISerializable + public unsafe partial struct RuntimeMethodHandle : IEquatable, ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. internal static IRuntimeMethodInfo EnsureNonNullMethodInfo(IRuntimeMethodInfo method) @@ -1139,7 +1139,7 @@ internal sealed class RuntimeFieldInfoStub : IRuntimeFieldInfo } [NonVersionable] - public unsafe struct RuntimeFieldHandle : ISerializable + public unsafe struct RuntimeFieldHandle : IEquatable, ISerializable { // Returns handle for interop with EE. The handle is guaranteed to be non-null. internal RuntimeFieldHandle GetNativeHandle() diff --git a/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs b/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs index 8da9217b477bc0..28af4119833668 100644 --- a/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs +++ b/src/coreclr/ToolBox/SOS/DacTableGen/diautil.cs @@ -619,7 +619,7 @@ private String GetTypeString(IDiaSymbol s) else if (tag == SymTagEnum.SymTagBaseType) { BasicType bt = (BasicType) s.baseType; - str.AppendFormat("(base type={0}, len={1:d})", bt.ToString(), s.length); + str.Append($"(base type={bt}, len={s.length:d})"); } else if (tag == SymTagEnum.SymTagArrayType) { @@ -677,7 +677,7 @@ private String GetTypeString(IDiaSymbol s) try { succ = true; - str.AppendFormat("[{0:d}]", s.length/s.type.length ); + str.Append($"[{s.length/s.type.length:d}]"); } catch (Exception) { diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp index ad4830fa73b1ab..061d3d6a77b927 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -494,7 +494,7 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeInstantiationArgument(CORINFO_CLAS // If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters // If fAssembly=TRUE, suffix with a comma and the full assembly qualification // return size of representation -int interceptor_ICJI::appendClassName(__deref_inout_ecount(*pnBufLen) char16_t** ppBuf, +int interceptor_ICJI::appendClassName(_Outptr_result_buffer_(*pnBufLen) char16_t** ppBuf, int* pnBufLen, CORINFO_CLASS_HANDLE cls, bool fNamespace, @@ -1257,7 +1257,7 @@ HRESULT interceptor_ICJI::GetErrorHRESULT(struct _EXCEPTION_POINTERS* pException // Fetches the message of the current exception // Returns the size of the message (including terminating null). This can be // greater than bufferLength if the buffer is insufficient. -uint32_t interceptor_ICJI::GetErrorMessage(__inout_ecount(bufferLength) char16_t *buffer, uint32_t bufferLength) +uint32_t interceptor_ICJI::GetErrorMessage(_Inout_updates_(bufferLength) char16_t *buffer, uint32_t bufferLength) { mc->cr->AddCall("GetErrorMessage"); return original_ICorJitInfo->GetErrorMessage(buffer, bufferLength); @@ -1367,7 +1367,7 @@ unsigned interceptor_ICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */ // this function is for debugging only. size_t interceptor_ICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */ mdToken metaTOK, /* IN */ - __out_ecount(FQNameCapacity) char* szFQName, /* OUT */ + _Out_writes_(FQNameCapacity) char* szFQName, /* OUT */ size_t FQNameCapacity /* IN */ ) { @@ -1716,13 +1716,6 @@ uint32_t interceptor_ICJI::getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field return temp; } -// Sets another object to intercept calls to "self" and current method being compiled -void interceptor_ICJI::setOverride(ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod) -{ - mc->cr->AddCall("setOverride"); - original_ICorJitInfo->setOverride(pOverride, currentMethod); -} - // Adds an active dependency from the context method's module to the given module // This is internal callback for the EE. JIT should not call it directly. void interceptor_ICJI::addActiveDependency(CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo) diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp index 88e0e03e42d989..657575cce71fe3 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp @@ -1184,14 +1184,6 @@ uint32_t interceptor_ICJI::getFieldThreadLocalStoreID( return original_ICorJitInfo->getFieldThreadLocalStoreID(field, ppIndirection); } -void interceptor_ICJI::setOverride( - ICorDynamicInfo* pOverride, - CORINFO_METHOD_HANDLE currentMethod) -{ - mcs->AddCall("setOverride"); - original_ICorJitInfo->setOverride(pOverride, currentMethod); -} - void interceptor_ICJI::addActiveDependency( CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo) diff --git a/src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp index 16926858871788..294750ccde5c1a 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp @@ -1036,13 +1036,6 @@ uint32_t interceptor_ICJI::getFieldThreadLocalStoreID( return original_ICorJitInfo->getFieldThreadLocalStoreID(field, ppIndirection); } -void interceptor_ICJI::setOverride( - ICorDynamicInfo* pOverride, - CORINFO_METHOD_HANDLE currentMethod) -{ - original_ICorJitInfo->setOverride(pOverride, currentMethod); -} - void interceptor_ICJI::addActiveDependency( CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo) diff --git a/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp index 3ff21d07fb59f0..16c66a6a398476 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp @@ -426,7 +426,7 @@ CORINFO_CLASS_HANDLE MyICJI::getTypeInstantiationArgument(CORINFO_CLASS_HANDLE c // If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters // If fAssembly=TRUE, suffix with a comma and the full assembly qualification // return size of representation -int MyICJI::appendClassName(__deref_inout_ecount(*pnBufLen) char16_t** ppBuf, +int MyICJI::appendClassName(_Outptr_result_buffer_(*pnBufLen) char16_t** ppBuf, int* pnBufLen, CORINFO_CLASS_HANDLE cls, bool fNamespace, @@ -1099,7 +1099,7 @@ HRESULT MyICJI::GetErrorHRESULT(struct _EXCEPTION_POINTERS* pExceptionPointers) // Fetches the message of the current exception // Returns the size of the message (including terminating null). This can be // greater than bufferLength if the buffer is insufficient. -uint32_t MyICJI::GetErrorMessage(__inout_ecount(bufferLength) char16_t* buffer, uint32_t bufferLength) +uint32_t MyICJI::GetErrorMessage(_Inout_updates_(bufferLength) char16_t* buffer, uint32_t bufferLength) { jitInstance->mc->cr->AddCall("GetErrorMessage"); LogError("Hit unimplemented GetErrorMessage"); @@ -1214,7 +1214,7 @@ unsigned MyICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */ // this function is for debugging only. size_t MyICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */ mdToken metaTOK, /* IN */ - __out_ecount(FQNameCapacity) char* szFQName, /* OUT */ + _Out_writes_(FQNameCapacity) char* szFQName, /* OUT */ size_t FQNameCapacity /* IN */ ) { @@ -1490,14 +1490,6 @@ uint32_t MyICJI::getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** p return jitInstance->mc->repGetFieldThreadLocalStoreID(field, ppIndirection); } -// Sets another object to intercept calls to "self" and current method being compiled -void MyICJI::setOverride(ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod) -{ - jitInstance->mc->cr->AddCall("setOverride"); - LogError("Hit unimplemented setOverride"); - DebugBreakorAV(115); -} - // Adds an active dependency from the context method's module to the given module // This is internal callback for the EE. JIT should not call it directly. void MyICJI::addActiveDependency(CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo) diff --git a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp index 169d0a268483b7..242771fe796c85 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp +++ b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.cpp @@ -134,7 +134,7 @@ BOOL GetRegistryLongValue(HKEY hKeyParent, LPCWSTR szKey, LPCWSTR szName, long* // Note: // //---------------------------------------------------------------------------- -HRESULT GetCurrentModuleFileName(__out_ecount(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer) +HRESULT GetCurrentModuleFileName(_Out_writes_(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer) { LIMITED_METHOD_CONTRACT; @@ -252,7 +252,7 @@ void GetDebuggerSettingInfo(LPWSTR wszDebuggerString, DWORD cchDebuggerString, B // * wszDebuggerString can be NULL. When wszDebuggerString is NULL, pcchDebuggerString should // * point to a DWORD of zero. pcchDebuggerString cannot be NULL, and the DWORD pointed by // * pcchDebuggerString will store the used or required string buffer size in characters. -HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, *pcchDebuggerString) +HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *pcchDebuggerString) LPWSTR wszDebuggerString, DWORD* pcchDebuggerString, BOOL* pfAuto) diff --git a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h index f941151b2e5493..a7f1eec42765de 100644 --- a/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h +++ b/src/coreclr/ToolBox/superpmi/superpmi/jitdebugger.h @@ -14,14 +14,14 @@ BOOL GetRegistryLongValue(HKEY hKeyParent, // Parent key. long* pValue, // Put value here, if found. BOOL fReadNonVirtualizedKey); // Whether to read 64-bit hive on WOW64 -HRESULT GetCurrentModuleFileName(__out_ecount(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer); +HRESULT GetCurrentModuleFileName(_Out_writes_(*pcchBuffer) LPWSTR pBuffer, __inout DWORD* pcchBuffer); #ifndef _WIN64 BOOL RunningInWow64(); #endif BOOL IsCurrentModuleFileNameInAutoExclusionList(); -HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, *pcchDebuggerString) +HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *pcchDebuggerString) LPWSTR wszDebuggerString, DWORD* pcchDebuggerString, BOOL* pfAuto); diff --git a/src/coreclr/binder/textualidentityparser.cpp b/src/coreclr/binder/textualidentityparser.cpp index 5d85a0a71cf377..f69e0bf66b202b 100644 --- a/src/coreclr/binder/textualidentityparser.cpp +++ b/src/coreclr/binder/textualidentityparser.cpp @@ -77,7 +77,7 @@ namespace BINDER_SPACE } } - inline void BinToUnicodeHex(const BYTE *pSrc, UINT cSrc, __out_ecount(2*cSrc) LPWSTR pDst) + inline void BinToUnicodeHex(const BYTE *pSrc, UINT cSrc, _Out_writes_(2*cSrc) LPWSTR pDst) { UINT x; UINT y; diff --git a/src/coreclr/build-runtime.sh b/src/coreclr/build-runtime.sh index 09529929492821..8d42b92ce95c0a 100755 --- a/src/coreclr/build-runtime.sh +++ b/src/coreclr/build-runtime.sh @@ -50,6 +50,8 @@ build_cross_architecture_components() __SkipCrossArchBuild=0 elif [[ "$__BuildArch" == "arm64" && "$__CrossArch" == "x64" ]]; then __SkipCrossArchBuild=0 + elif [[ "$__BuildArch" == "loongarch64" && "$__CrossArch" == "x64" ]]; then + __SkipCrossArchBuild=0 else # not supported return diff --git a/src/coreclr/classlibnative/bcltype/arraynative.cpp b/src/coreclr/classlibnative/bcltype/arraynative.cpp index 738fd98c7f9e76..ca60fa978a626c 100644 --- a/src/coreclr/classlibnative/bcltype/arraynative.cpp +++ b/src/coreclr/classlibnative/bcltype/arraynative.cpp @@ -1154,23 +1154,25 @@ FCIMPL2_IV(void, ArrayNative::InitializeArray, ArrayBase* pArrayRef, FCALLRuntim } FCIMPLEND -FCIMPL3(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetType, INT32* count) +FCIMPL3_VVI(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetTypeUnsafe, INT32* count) { FCALL_CONTRACT; struct { REFLECTFIELDREF refField; + REFLECTCLASSBASEREF refClass; } gc; gc.refField = (REFLECTFIELDREF)ObjectToOBJECTREF(FCALL_RFH_TO_REFLECTFIELD(structField)); + gc.refClass = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(FCALL_RTH_TO_REFLECTCLASS(targetTypeUnsafe)); void* data; - HELPER_METHOD_FRAME_BEGIN_RET_1(gc); + HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc); FieldDesc* pField = (FieldDesc*)gc.refField->GetField(); if (!pField->IsRVA()) COMPlusThrow(kArgumentException); - TypeHandle targetTypeHandle = FCALL_RTH_TO_REFLECTCLASS(targetType)->GetType(); + TypeHandle targetTypeHandle = gc.refClass->GetType(); if (!CorTypeInfo::IsPrimitiveType(targetTypeHandle.GetSignatureCorElementType()) && !targetTypeHandle.IsEnum()) COMPlusThrow(kArgumentException); @@ -1180,8 +1182,9 @@ FCIMPL3(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structField // Report the RVA field to the logger. g_IBCLogger.LogRVADataAccess(pField); - _ASSERTE(data != NULL && count != NULL); data = pField->GetStaticAddressHandle(NULL); + _ASSERTE(data != NULL); + _ASSERTE(count != NULL); if (AlignUp((UINT_PTR)data, targetTypeSize) != (UINT_PTR)data) COMPlusThrow(kArgumentException); diff --git a/src/coreclr/classlibnative/bcltype/arraynative.h b/src/coreclr/classlibnative/bcltype/arraynative.h index 6a1c8979525cdb..bd74be3d3ea6ac 100644 --- a/src/coreclr/classlibnative/bcltype/arraynative.h +++ b/src/coreclr/classlibnative/bcltype/arraynative.h @@ -48,7 +48,7 @@ class ArrayNative // This method will acquire data to create a span from a TypeHandle // to a field. - static FCDECL3(void*, GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetType, INT32* count); + static FCDECL3_VVI(void*, GetSpanDataFrom, FCALLRuntimeFieldHandle structField, FCALLRuntimeTypeHandle targetTypeUnsafe, INT32* count); private: // Helper for CreateInstance diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake index 50aab221c8032e..d5fc9f5e1ee8e5 100644 --- a/src/coreclr/clrdefinitions.cmake +++ b/src/coreclr/clrdefinitions.cmake @@ -191,12 +191,12 @@ if (CLR_CMAKE_TARGET_ARCH_AMD64) add_definitions(-DUNIX_AMD64_ABI_ITF) endif (CLR_CMAKE_TARGET_ARCH_AMD64) add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS) -if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) +if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64) add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP) -endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) -if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) +endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64) +if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64) add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES) -endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) +endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64) if(NOT CLR_CMAKE_TARGET_UNIX) add_definitions(-DFEATURE_WIN32_REGISTRY) @@ -240,6 +240,7 @@ function(set_target_definitions_to_custom_os_and_arch) elseif (TARGETDETAILS_ARCH STREQUAL "x86") target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_X86_ABI) elseif (TARGETDETAILS_ARCH STREQUAL "arm64") + elseif (TARGETDETAILS_ARCH STREQUAL "loongarch64") endif() if ((TARGETDETAILS_ARCH STREQUAL "arm64") AND (TARGETDETAILS_OS STREQUAL "unix_osx")) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE OSX_ARM64_ABI) @@ -260,6 +261,10 @@ function(set_target_definitions_to_custom_os_and_arch) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM64) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) + elseif(TARGETDETAILS_ARCH STREQUAL "loongarch64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_LOONGARCH64) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) elseif((TARGETDETAILS_ARCH STREQUAL "arm") OR (TARGETDETAILS_ARCH STREQUAL "armel")) target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM) endif() diff --git a/src/coreclr/debug/createdump/crashinfomac.cpp b/src/coreclr/debug/createdump/crashinfomac.cpp index ad9c247e37dfdc..3ada3bd767c964 100644 --- a/src/coreclr/debug/createdump/crashinfomac.cpp +++ b/src/coreclr/debug/createdump/crashinfomac.cpp @@ -277,6 +277,9 @@ void CrashInfo::VisitSegment(MachOModule& module, const segment_command_64& segm uint64_t start = segment.vmaddr + module.LoadBias(); uint64_t end = start + segment.vmsize; + // Add this module segment to the set used by the thread unwinding to lookup the module base address for an ip. + AddModuleAddressRange(start, end, module.BaseAddress()); + // Round to page boundary start = start & PAGE_MASK; _ASSERTE(start > 0); @@ -297,9 +300,6 @@ void CrashInfo::VisitSegment(MachOModule& module, const segment_command_64& segm } // Add this module segment to the module mappings list m_moduleMappings.insert(moduleRegion); - - // Add this module segment to the set used by the thread unwinding to lookup the module base address for an ip. - AddModuleAddressRange(start, end, module.BaseAddress()); } else { diff --git a/src/coreclr/debug/createdump/stackframe.h b/src/coreclr/debug/createdump/stackframe.h index 75e20d93120c0c..00c3a1cfb7fd8f 100644 --- a/src/coreclr/debug/createdump/stackframe.h +++ b/src/coreclr/debug/createdump/stackframe.h @@ -66,9 +66,16 @@ struct StackFrame } } +// See comment in threadinfo.cpp UnwindNativeFrames function +#if defined(__aarch64__) + #define STACK_POINTER_MASK ~0x7 +#else + #define STACK_POINTER_MASK ~0x0 +#endif + inline uint64_t ModuleAddress() const { return m_moduleAddress; } inline uint64_t InstructionPointer() const { return m_instructionPointer; } - inline uint64_t StackPointer() const { return m_stackPointer; } + inline uint64_t StackPointer() const { return m_stackPointer & STACK_POINTER_MASK; } inline uint32_t NativeOffset() const { return m_nativeOffset; } inline uint32_t Token() const { return m_token; } inline uint32_t ILOffset() const { return m_ilOffset; } diff --git a/src/coreclr/debug/createdump/threadinfo.cpp b/src/coreclr/debug/createdump/threadinfo.cpp index 82509f52750653..e64eafc8d29a96 100644 --- a/src/coreclr/debug/createdump/threadinfo.cpp +++ b/src/coreclr/debug/createdump/threadinfo.cpp @@ -53,6 +53,16 @@ ThreadInfo::UnwindNativeFrames(CONTEXT* pContext) uint64_t ip = 0, sp = 0; GetFrameLocation(pContext, &ip, &sp); +#if defined(__aarch64__) + // ARM64 can have frames with the same SP but different IPs. Increment sp so it gets added to the stack + // frames in the correct order and to prevent the below loop termination on non-increasing sp. Since stack + // pointers are always 8 byte align, this increase is masked off in StackFrame::StackPointer() to get the + // original stack pointer. + if (sp == previousSp && ip != previousIp) + { + sp++; + } +#endif if (ip == 0 || sp <= previousSp) { TRACE_VERBOSE("Unwind: sp not increasing or ip == 0 sp %p ip %p\n", (void*)sp, (void*)ip); break; diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp index f9ec95c1f41838..9aaf6e6e4cb171 100644 --- a/src/coreclr/debug/daccess/daccess.cpp +++ b/src/coreclr/debug/daccess/daccess.cpp @@ -92,10 +92,10 @@ BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved) } HRESULT -ConvertUtf8(__in LPCUTF8 utf8, +ConvertUtf8(_In_ LPCUTF8 utf8, ULONG32 bufLen, ULONG32* nameLen, - __out_ecount_part_opt(bufLen, *nameLen) PWSTR buffer) + _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer) { if (nameLen) { @@ -118,9 +118,9 @@ ConvertUtf8(__in LPCUTF8 utf8, } HRESULT -AllocUtf8(__in_opt LPCWSTR wstr, +AllocUtf8(_In_opt_ LPCWSTR wstr, ULONG32 srcChars, - __deref_out LPUTF8* utf8) + _Outptr_ LPUTF8* utf8) { ULONG32 chars = WszWideCharToMultiByte(CP_UTF8, 0, wstr, srcChars, NULL, 0, NULL, NULL); @@ -165,7 +165,7 @@ HRESULT GetFullClassNameFromMetadata(IMDInternalImport* mdImport, mdTypeDef classToken, ULONG32 bufferChars, - __inout_ecount(bufferChars) LPUTF8 buffer) + _Inout_updates_(bufferChars) LPUTF8 buffer) { HRESULT hr; LPCUTF8 baseName, namespaceName; @@ -179,7 +179,7 @@ HRESULT GetFullMethodNameFromMetadata(IMDInternalImport* mdImport, mdMethodDef methodToken, ULONG32 bufferChars, - __inout_ecount(bufferChars) LPUTF8 buffer) + _Inout_updates_(bufferChars) LPUTF8 buffer) { HRESULT status; HRESULT hr; @@ -228,13 +228,13 @@ GetFullMethodNameFromMetadata(IMDInternalImport* mdImport, } HRESULT -SplitFullName(__in_z __in PCWSTR fullName, +SplitFullName(_In_z_ PCWSTR fullName, SplitSyntax syntax, ULONG32 memberDots, - __deref_out_opt LPUTF8* namespaceName, - __deref_out_opt LPUTF8* typeName, - __deref_out_opt LPUTF8* memberName, - __deref_out_opt LPUTF8* params) + _Outptr_opt_ LPUTF8* namespaceName, + _Outptr_opt_ LPUTF8* typeName, + _Outptr_opt_ LPUTF8* memberName, + _Outptr_opt_ LPUTF8* params) { HRESULT status; PCWSTR paramsStart, memberStart, memberEnd, typeStart; @@ -401,7 +401,7 @@ SplitFullName(__in_z __in PCWSTR fullName, } int -CompareUtf8(__in LPCUTF8 str1, __in LPCUTF8 str2, __in ULONG32 nameFlags) +CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags) { if (nameFlags & CLRDATA_BYNAME_CASE_INSENSITIVE) { @@ -469,8 +469,8 @@ MetaEnum::End(void) HRESULT MetaEnum::NextToken(mdToken* token, - __deref_opt_out_opt LPCUTF8* namespaceName, - __deref_opt_out_opt LPCUTF8* name) + _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName, + _Outptr_opt_result_maybenull_ LPCUTF8* name) { HRESULT hr; if (!m_mdImport) @@ -584,8 +584,8 @@ MetaEnum::NextDomainToken(AppDomain** appDomain, } HRESULT -MetaEnum::NextTokenByName(__in_opt LPCUTF8 namespaceName, - __in_opt LPCUTF8 name, +MetaEnum::NextTokenByName(_In_opt_ LPCUTF8 namespaceName, + _In_opt_ LPCUTF8 name, ULONG32 nameFlags, mdToken* token) { @@ -617,8 +617,8 @@ MetaEnum::NextTokenByName(__in_opt LPCUTF8 namespaceName, } HRESULT -MetaEnum::NextDomainTokenByName(__in_opt LPCUTF8 namespaceName, - __in_opt LPCUTF8 name, +MetaEnum::NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName, + _In_opt_ LPCUTF8 name, ULONG32 nameFlags, AppDomain** appDomain, mdToken* token) { @@ -755,7 +755,7 @@ SplitName::Clear(void) } HRESULT -SplitName::SplitString(__in_opt PCWSTR fullName) +SplitName::SplitString(_In_opt_ PCWSTR fullName) { if (m_syntax == SPLIT_NO_NAME) { @@ -800,7 +800,7 @@ WCHAR* wcrscan(LPCWSTR beg, LPCWSTR end, WCHAR ch) // sepName to point to the second '+' character in the string. When sepName // points to the first '+' character this function will return "Outer" in // pResult and sepName will point one WCHAR before fullName. -HRESULT NextEnclosingClasName(LPCWSTR fullName, __deref_inout LPWSTR& sepName, __deref_out LPUTF8 *pResult) +HRESULT NextEnclosingClasName(LPCWSTR fullName, _Outref_ LPWSTR& sepName, _Outptr_ LPUTF8 *pResult) { if (sepName < fullName) { @@ -994,7 +994,7 @@ SplitName::FindField(IMDInternalImport* mdInternal) } HRESULT -SplitName::AllocAndSplitString(__in_opt PCWSTR fullName, +SplitName::AllocAndSplitString(_In_opt_ PCWSTR fullName, SplitSyntax syntax, ULONG32 nameFlags, ULONG32 memberDots, @@ -1024,7 +1024,7 @@ SplitName::AllocAndSplitString(__in_opt PCWSTR fullName, } HRESULT -SplitName::CdStartMethod(__in_opt PCWSTR fullName, +SplitName::CdStartMethod(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, mdTypeDef typeToken, @@ -1138,7 +1138,7 @@ SplitName::CdNextDomainMethod(CLRDATA_ENUM* handle, } HRESULT -SplitName::CdStartField(__in_opt PCWSTR fullName, +SplitName::CdStartField(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, ULONG32 fieldFlags, IXCLRDataTypeInstance* fromTypeInst, @@ -1241,7 +1241,7 @@ SplitName::CdNextField(ClrDataAccess* dac, IXCLRDataValue** value, ULONG32 nameBufRetLen, ULONG32* nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet) { @@ -1419,7 +1419,7 @@ SplitName::CdNextDomainField(ClrDataAccess* dac, } HRESULT -SplitName::CdStartType(__in_opt PCWSTR fullName, +SplitName::CdStartType(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, AppDomain* appDomain, @@ -3698,7 +3698,7 @@ ClrDataAccess::GetRuntimeNameByAddress( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *symbolLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ], + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement) { HRESULT status; @@ -4317,7 +4317,7 @@ ClrDataAccess::GetDataByAddress( /* [in] */ IXCLRDataTask* tlsTask, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataValue **value, /* [out] */ CLRDATA_ADDRESS *displacement) { @@ -5642,7 +5642,7 @@ ClrDataAccess::GetFullMethodName( IN MethodDesc* methodDesc, IN ULONG32 symbolChars, OUT ULONG32* symbolLen, - __out_ecount_part_opt(symbolChars, *symbolLen) LPWSTR symbol + _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol ) { StackSString s; @@ -5690,7 +5690,7 @@ ClrDataAccess::GetJitHelperName( #define JITHELPER(code,fn,sig) #code, #include }; - static_assert_no_msg(COUNTOF(s_rgHelperNames) == CORINFO_HELP_COUNT); + static_assert_no_msg(ARRAY_SIZE(s_rgHelperNames) == CORINFO_HELP_COUNT); #ifdef TARGET_UNIX if (!dynamicHelpersOnly) @@ -5737,7 +5737,7 @@ ClrDataAccess::RawGetMethodName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *symbolLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ], + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement) { #ifdef TARGET_ARM @@ -5745,7 +5745,7 @@ ClrDataAccess::RawGetMethodName( address &= ~THUMB_CODE; #endif - const UINT k_cch64BitHexFormat = COUNTOF("1234567812345678"); + const UINT k_cch64BitHexFormat = ARRAY_SIZE("1234567812345678"); HRESULT status; if (flags != 0) @@ -5887,7 +5887,7 @@ ClrDataAccess::RawGetMethodName( // Printf failed. Estimate a size that will be at least big enough to hold the name if (symbolLen) { - size_t cchSymbol = COUNTOF(s_wszFormatNameWithStubManager) + + size_t cchSymbol = ARRAY_SIZE(s_wszFormatNameWithStubManager) + wcslen(wszStubManagerName) + k_cch64BitHexFormat + 1; @@ -5950,7 +5950,7 @@ ClrDataAccess::RawGetMethodName( // Printf failed. Estimate a size that will be at least big enough to hold the name if (symbolLen) { - size_t cchSymbol = COUNTOF(s_wszFormatNameAddressOnly) + + size_t cchSymbol = ARRAY_SIZE(s_wszFormatNameAddressOnly) + k_cch64BitHexFormat + 1; @@ -6460,7 +6460,7 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly, DWORD &dwDataSize, DWORD &dwRvaHint, bool &isNGEN, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath) { SUPPORTS_DAC_HOST_ONLY; @@ -6524,7 +6524,7 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly, bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly, DWORD &dwTimeStamp, DWORD &dwSize, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath) { SUPPORTS_DAC_HOST_ONLY; @@ -6548,7 +6548,7 @@ bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly, // In the end we add given ilExtension. // This dependecy is based on Apollo installer behavior. bool ClrDataAccess::GetILImageNameFromNgenImage( LPCWSTR ilExtension, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath) { if (wszFilePath == NULL || cchFilePath == 0) @@ -7565,9 +7565,9 @@ typedef struct _WER_RUNTIME_EXCEPTION_INFORMATION // else detailed error code. // //---------------------------------------------------------------------------- -STDAPI OutOfProcessExceptionEventGetWatsonBucket(__in PDWORD pContext, - __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - __out GenericModeBlock * pGMB) +STDAPI OutOfProcessExceptionEventGetWatsonBucket(_In_ PDWORD pContext, + _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, + _Out_ GenericModeBlock * pGMB) { HANDLE hProcess = pExceptionInformation->hProcess; HANDLE hThread = pExceptionInformation->hThread; @@ -7656,12 +7656,12 @@ STDAPI OutOfProcessExceptionEventGetWatsonBucket(__in PDWORD pContext, // Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224). // //---------------------------------------------------------------------------- -STDAPI OutOfProcessExceptionEventCallback(__in PDWORD pContext, - __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - __out BOOL * pbOwnershipClaimed, - __out_ecount(*pchSize) PWSTR pwszEventName, +STDAPI OutOfProcessExceptionEventCallback(_In_ PDWORD pContext, + _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, + _Out_ BOOL * pbOwnershipClaimed, + _Out_writes_(*pchSize) PWSTR pwszEventName, __inout PDWORD pchSize, - __out PDWORD pdwSignatureCount) + _Out_ PDWORD pdwSignatureCount) { SUPPORTS_DAC_HOST_ONLY; @@ -7748,12 +7748,12 @@ STDAPI OutOfProcessExceptionEventCallback(__in PDWORD pContext, // Since this is called by external modules it's important that we don't let any exceptions leak out (see Win8 95224). // //---------------------------------------------------------------------------- -STDAPI OutOfProcessExceptionEventSignatureCallback(__in PDWORD pContext, - __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - __in DWORD dwIndex, - __out_ecount(*pchName) PWSTR pwszName, +STDAPI OutOfProcessExceptionEventSignatureCallback(_In_ PDWORD pContext, + _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, + _In_ DWORD dwIndex, + _Out_writes_(*pchName) PWSTR pwszName, __inout PDWORD pchName, - __out_ecount(*pchValue) PWSTR pwszValue, + _Out_writes_(*pchValue) PWSTR pwszValue, __inout PDWORD pchValue) { SUPPORTS_DAC_HOST_ONLY; @@ -7873,12 +7873,12 @@ STDAPI OutOfProcessExceptionEventSignatureCallback(__in PDWORD pContext, // this function are of the pwszName and pwszValue buffers. // //---------------------------------------------------------------------------- -STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(__in PDWORD pContext, - __in const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - __out BOOL * pbCustomDebuggerNeeded, - __out_ecount_opt(*pchSize) PWSTR pwszDebuggerLaunch, +STDAPI OutOfProcessExceptionEventDebuggerLaunchCallback(_In_ PDWORD pContext, + _In_ const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, + _Out_ BOOL * pbCustomDebuggerNeeded, + _Out_writes_opt_(*pchSize) PWSTR pwszDebuggerLaunch, __inout PDWORD pchSize, - __out BOOL * pbAutoLaunchDebugger) + _Out_ BOOL * pbAutoLaunchDebugger) { SUPPORTS_DAC_HOST_ONLY; diff --git a/src/coreclr/debug/daccess/dacfn.cpp b/src/coreclr/debug/daccess/dacfn.cpp index e1b83aba17e20c..11f798ed04c199 100644 --- a/src/coreclr/debug/daccess/dacfn.cpp +++ b/src/coreclr/debug/daccess/dacfn.cpp @@ -89,7 +89,7 @@ DacExceptionFilter(Exception* ex, ClrDataAccess* access, } void __cdecl -DacWarning(__in char* format, ...) +DacWarning(_In_ char* format, ...) { char text[256]; va_list args; diff --git a/src/coreclr/debug/daccess/dacimpl.h b/src/coreclr/debug/daccess/dacimpl.h index 948bef16e498da..57a4dc1bbab8fc 100644 --- a/src/coreclr/debug/daccess/dacimpl.h +++ b/src/coreclr/debug/daccess/dacimpl.h @@ -222,22 +222,22 @@ struct METH_EXTENTS CLRDATA_ADDRESS_RANGE extents[1]; }; -HRESULT ConvertUtf8(__in LPCUTF8 utf8, +HRESULT ConvertUtf8(_In_ LPCUTF8 utf8, ULONG32 bufLen, ULONG32* nameLen, - __out_ecount_part_opt(bufLen, *nameLen) PWSTR buffer); -HRESULT AllocUtf8(__in_opt LPCWSTR wstr, + _Out_writes_to_opt_(bufLen, *nameLen) PWSTR buffer); +HRESULT AllocUtf8(_In_opt_ LPCWSTR wstr, ULONG32 srcChars, - __deref_out LPUTF8* utf8); + _Outptr_ LPUTF8* utf8); HRESULT GetFullClassNameFromMetadata(IMDInternalImport* mdImport, mdTypeDef classToken, ULONG32 bufferChars, - __inout_ecount(bufferChars) LPUTF8 buffer); + _Inout_updates_(bufferChars) LPUTF8 buffer); HRESULT GetFullMethodNameFromMetadata(IMDInternalImport* mdImport, mdMethodDef methodToken, ULONG32 bufferChars, - __inout_ecount(bufferChars) LPUTF8 buffer); + _Inout_updates_(bufferChars) LPUTF8 buffer); enum SplitSyntax { @@ -247,15 +247,15 @@ enum SplitSyntax SPLIT_NO_NAME, }; -HRESULT SplitFullName(__in_z __in PCWSTR fullName, +HRESULT SplitFullName(_In_z_ PCWSTR fullName, SplitSyntax syntax, ULONG32 memberDots, - __deref_out_opt LPUTF8* namespaceName, - __deref_out_opt LPUTF8* typeName, - __deref_out_opt LPUTF8* memberName, - __deref_out_opt LPUTF8* params); + _Outptr_opt_ LPUTF8* namespaceName, + _Outptr_opt_ LPUTF8* typeName, + _Outptr_opt_ LPUTF8* memberName, + _Outptr_opt_ LPUTF8* params); -int CompareUtf8(__in LPCUTF8 str1, __in LPCUTF8 str2, __in ULONG32 nameFlags); +int CompareUtf8(_In_ LPCUTF8 str1, _In_ LPCUTF8 str2, _In_ ULONG32 nameFlags); #define INH_STATIC \ (CLRDATA_VALUE_ALL_KINDS | \ @@ -304,16 +304,16 @@ class MetaEnum void End(void); HRESULT NextToken(mdToken* token, - __deref_opt_out_opt LPCUTF8* namespaceName, - __deref_opt_out_opt LPCUTF8* name); + _Outptr_opt_result_maybenull_ LPCUTF8* namespaceName, + _Outptr_opt_result_maybenull_ LPCUTF8* name); HRESULT NextDomainToken(AppDomain** appDomain, mdToken* token); - HRESULT NextTokenByName(__in_opt LPCUTF8 namespaceName, - __in_opt LPCUTF8 name, + HRESULT NextTokenByName(_In_opt_ LPCUTF8 namespaceName, + _In_opt_ LPCUTF8 name, ULONG32 nameFlags, mdToken* token); - HRESULT NextDomainTokenByName(__in_opt LPCUTF8 namespaceName, - __in_opt LPCUTF8 name, + HRESULT NextDomainTokenByName(_In_opt_ LPCUTF8 namespaceName, + _In_opt_ LPCUTF8 name, ULONG32 nameFlags, AppDomain** appDomain, mdToken* token); @@ -410,7 +410,7 @@ class SplitName void Delete(void); void Clear(void); - HRESULT SplitString(__in_opt PCWSTR fullName); + HRESULT SplitString(_In_opt_ PCWSTR fullName); bool FindType(IMDInternalImport* mdInternal); bool FindMethod(IMDInternalImport* mdInternal); @@ -421,13 +421,13 @@ class SplitName return CompareUtf8(str1, str2, m_nameFlags); } - static HRESULT AllocAndSplitString(__in_opt PCWSTR fullName, + static HRESULT AllocAndSplitString(_In_opt_ PCWSTR fullName, SplitSyntax syntax, ULONG32 nameFlags, ULONG32 memberDots, SplitName** split); - static HRESULT CdStartMethod(__in_opt PCWSTR fullName, + static HRESULT CdStartMethod(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, mdTypeDef typeToken, @@ -441,7 +441,7 @@ class SplitName AppDomain** appDomain, mdMethodDef* token); - static HRESULT CdStartField(__in_opt PCWSTR fullName, + static HRESULT CdStartField(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, ULONG32 fieldFlags, IXCLRDataTypeInstance* fromTypeInst, @@ -462,14 +462,14 @@ class SplitName IXCLRDataValue** value, ULONG32 nameBufRetLen, ULONG32* nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet); static HRESULT CdNextDomainField(ClrDataAccess* dac, CLRDATA_ENUM* handle, IXCLRDataValue** value); - static HRESULT CdStartType(__in_opt PCWSTR fullName, + static HRESULT CdStartType(_In_opt_ PCWSTR fullName, ULONG32 nameFlags, Module* mod, AppDomain* appDomain, @@ -901,7 +901,7 @@ class ClrDataAccess /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement); virtual HRESULT STDMETHODCALLTYPE StartEnumAppDomains( @@ -972,7 +972,7 @@ class ClrDataAccess /* [in] */ IXCLRDataTask* tlsTask, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataValue **value, /* [out] */ CLRDATA_ADDRESS *displacement); @@ -1080,10 +1080,10 @@ class ClrDataAccess virtual HRESULT STDMETHODCALLTYPE GetAppDomainStoreData(struct DacpAppDomainStoreData *data); virtual HRESULT STDMETHODCALLTYPE GetAppDomainList(unsigned int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetAppDomainData(CLRDATA_ADDRESS addr, struct DacpAppDomainData *data); - virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], int *fetched); virtual HRESULT STDMETHODCALLTYPE GetAssemblyData(CLRDATA_ADDRESS baseDomainPtr, CLRDATA_ADDRESS assembly, struct DacpAssemblyData *data); - virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetThreadData(CLRDATA_ADDRESS thread, struct DacpThreadData *data); virtual HRESULT STDMETHODCALLTYPE GetThreadFromThinlockID(UINT thinLockId, CLRDATA_ADDRESS *pThread); virtual HRESULT STDMETHODCALLTYPE GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower, CLRDATA_ADDRESS *upper, CLRDATA_ADDRESS *fp); @@ -1091,27 +1091,27 @@ class ClrDataAccess virtual HRESULT STDMETHODCALLTYPE GetMethodDescData(CLRDATA_ADDRESS methodDesc, CLRDATA_ADDRESS ip, struct DacpMethodDescData *data, ULONG cRevertedRejitVersions, DacpReJitData * rgRevertedRejitData, ULONG * pcNeededRevertedRejitData); virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD); - virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromFrame(CLRDATA_ADDRESS frameAddr, CLRDATA_ADDRESS * ppMD); virtual HRESULT STDMETHODCALLTYPE GetCodeHeaderData(CLRDATA_ADDRESS ip, struct DacpCodeHeaderData *data); virtual HRESULT STDMETHODCALLTYPE GetThreadpoolData(struct DacpThreadpoolData *data); virtual HRESULT STDMETHODCALLTYPE GetWorkRequestData(CLRDATA_ADDRESS addrWorkRequest, struct DacpWorkRequestData *data); virtual HRESULT STDMETHODCALLTYPE GetObjectData(CLRDATA_ADDRESS objAddr, struct DacpObjectData *data); - virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *stringData, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *className, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_z __inout_ecount(count) WCHAR *mtName, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *stringData, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *className, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, _Inout_updates_z_(count) WCHAR *mtName, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData *data); virtual HRESULT STDMETHODCALLTYPE GetMethodTableFieldData(CLRDATA_ADDRESS mt, struct DacpMethodTableFieldData *data); virtual HRESULT STDMETHODCALLTYPE GetMethodTableTransparencyData(CLRDATA_ADDRESS mt, struct DacpMethodTableTransparencyData *data); virtual HRESULT STDMETHODCALLTYPE GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS *value); virtual HRESULT STDMETHODCALLTYPE GetFieldDescData(CLRDATA_ADDRESS fieldDesc, struct DacpFieldDescData *data); - virtual HRESULT STDMETHODCALLTYPE GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z __inout_ecount(count) WCHAR *frameName, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, _Inout_updates_z_(count) WCHAR *frameName, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetModule(CLRDATA_ADDRESS addr, IXCLRDataModule **mod); virtual HRESULT STDMETHODCALLTYPE GetModuleData(CLRDATA_ADDRESS moduleAddr, struct DacpModuleData *data); virtual HRESULT STDMETHODCALLTYPE TraverseModuleMap(ModuleMapType mmt, CLRDATA_ADDRESS moduleAddr, MODULEMAPTRAVERSE pCallback, LPVOID token); virtual HRESULT STDMETHODCALLTYPE GetMethodDescFromToken(CLRDATA_ADDRESS moduleAddr, mdToken token, CLRDATA_ADDRESS *methodDesc); virtual HRESULT STDMETHODCALLTYPE GetPEFileBase(CLRDATA_ADDRESS addr, CLRDATA_ADDRESS *base); - virtual HRESULT STDMETHODCALLTYPE GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *fileName, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *fileName, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetAssemblyModuleList(CLRDATA_ADDRESS assembly, unsigned int count, CLRDATA_ADDRESS modules[], unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetGCHeapData(struct DacpGcHeapData *data); virtual HRESULT STDMETHODCALLTYPE GetGCHeapList(unsigned int count, CLRDATA_ADDRESS heaps[], unsigned int *pNeeded); @@ -1127,7 +1127,7 @@ class ClrDataAccess virtual HRESULT STDMETHODCALLTYPE TraverseEHInfo(CLRDATA_ADDRESS ip, DUMPEHINFO pCallback, LPVOID token); virtual HRESULT STDMETHODCALLTYPE GetStressLogAddress(CLRDATA_ADDRESS *stressLog); virtual HRESULT STDMETHODCALLTYPE GetJitManagerList(unsigned int count, struct DacpJitManagerInfo managers[], unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, __out_z __inout_ecount(count) char *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, _Inout_updates_z_(count) char *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetJumpThunkTarget(T_CONTEXT *ctx, CLRDATA_ADDRESS *targetIP, CLRDATA_ADDRESS *targetMD); virtual HRESULT STDMETHODCALLTYPE TraverseLoaderHeap(CLRDATA_ADDRESS loaderHeapAddr, VISITHEAP pCallback); virtual HRESULT STDMETHODCALLTYPE GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, struct DacpJitCodeHeapInfo codeHeaps[], unsigned int *pNeeded); @@ -1152,17 +1152,17 @@ class ClrDataAccess virtual HRESULT STDMETHODCALLTYPE GetDacModuleHandle(HMODULE *phModule); virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *paths, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *configFile, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, __out_z __inout_ecount(count) WCHAR *base, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *paths, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *configFile, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, _Inout_updates_z_(count) WCHAR *base, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pContext, HRESULT *pResult); - virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded); - virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetStackReferences(DWORD osThreadID, ISOSStackRefEnum **ppEnum); - virtual HRESULT STDMETHODCALLTYPE GetRegisterName(int regNum, unsigned int count, __out_z __inout_ecount(count) WCHAR *buffer, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE GetRegisterName(int regNum, unsigned int count, _Inout_updates_z_(count) WCHAR *buffer, unsigned int *pNeeded); virtual HRESULT STDMETHODCALLTYPE GetHandleEnum(ISOSHandleEnum **ppHandleEnum); virtual HRESULT STDMETHODCALLTYPE GetHandleEnumForTypes(unsigned int types[], unsigned int count, ISOSHandleEnum **ppHandleEnum); @@ -1244,12 +1244,12 @@ class ClrDataAccess HRESULT GetFullMethodName(IN MethodDesc* methodDesc, IN ULONG32 symbolChars, IN ULONG32* symbolLen, - __out_ecount_part_opt(symbolChars, *symbolLen) LPWSTR symbol); + _Out_writes_to_opt_(symbolChars, *symbolLen) LPWSTR symbol); HRESULT RawGetMethodName(/* [in] */ CLRDATA_ADDRESS address, /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ], /* [out] */ CLRDATA_ADDRESS* displacement); HRESULT FollowStubStep( @@ -1512,17 +1512,17 @@ class ClrDataAccess DWORD &dwDataSize, DWORD &dwRvaHint, bool &isNGEN, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, DWORD cchFilePath); static bool GetILImageInfoFromNgenPEFile(PEAssembly *pPEAssembly, DWORD &dwTimeStamp, DWORD &dwSize, - __out_ecount(cchPath) LPWSTR wszPath, + _Out_writes_(cchPath) LPWSTR wszPath, const DWORD cchPath); #if defined(FEATURE_CORESYSTEM) static bool GetILImageNameFromNgenImage(LPCWSTR ilExtension, - __out_ecount(cchFilePath) LPWSTR wszFilePath, + _Out_writes_(cchFilePath) LPWSTR wszFilePath, const DWORD cchFilePath); #endif // FEATURE_CORESYSTEM }; @@ -2348,7 +2348,7 @@ class ClrDataAppDomain : public IXCLRDataAppDomain virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetUniqueID( /* [out] */ ULONG64 *id); @@ -2429,17 +2429,17 @@ class ClrDataAssembly : public IXCLRDataAssembly virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetFileName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetDisplayName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetFlags( /* [out] */ ULONG32 *flags); @@ -2601,12 +2601,12 @@ class ClrDataModule : public IXCLRDataModule, IXCLRDataModule2 virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetFileName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetVersionId( /* [out] */ GUID* vid); @@ -2747,7 +2747,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [out][in] */ CLRDATA_ENUM *handle, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags, /* [out] */ mdFieldDef *token); @@ -2756,7 +2756,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [out][in] */ CLRDATA_ENUM *handle, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags, /* [out] */ IXCLRDataModule** tokenScope, @@ -2791,7 +2791,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [in] */ mdFieldDef token, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32* flags); @@ -2800,7 +2800,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [in] */ mdFieldDef token, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32* flags); @@ -2808,7 +2808,7 @@ class ClrDataTypeDefinition : public IXCLRDataTypeDefinition /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope( /* [out] */ mdTypeDef *token, @@ -2918,7 +2918,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token); virtual HRESULT STDMETHODCALLTYPE StartEnumStaticFieldsByName( @@ -2952,7 +2952,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance /* [out] */ IXCLRDataValue **value, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataModule** tokenScope, /* [out] */ mdFieldDef *token); @@ -2985,7 +2985,7 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetStaticFieldByToken2( /* [in] */ IXCLRDataModule* tokenScope, @@ -2994,13 +2994,13 @@ class ClrDataTypeInstance : public IXCLRDataTypeInstance /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetModule( /* [out] */ IXCLRDataModule **mod); @@ -3095,7 +3095,7 @@ class ClrDataMethodDefinition : public IXCLRDataMethodDefinition /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope( /* [out] */ mdMethodDef *token, @@ -3200,7 +3200,7 @@ class ClrDataMethodInstance : public IXCLRDataMethodInstance /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetFlags( /* [out] */ ULONG32 *flags); @@ -3304,7 +3304,7 @@ class ClrDataTask : public IXCLRDataTask virtual HRESULT STDMETHODCALLTYPE GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetUniqueID( /* [out] */ ULONG64 *id); @@ -3500,7 +3500,7 @@ class ClrDataFrame : public IXCLRDataFrame, /* [out] */ IXCLRDataValue **arg, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetNumLocalVariables( /* [out] */ ULONG32 *numLocals); @@ -3510,7 +3510,7 @@ class ClrDataFrame : public IXCLRDataFrame, /* [out] */ IXCLRDataValue **localVariable, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]); virtual HRESULT STDMETHODCALLTYPE GetNumTypeArguments( /* [out] */ ULONG32 *numTypeArgs); @@ -3523,7 +3523,7 @@ class ClrDataFrame : public IXCLRDataFrame, /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetMethodInstance( /* [out] */ IXCLRDataMethodInstance **method); @@ -3620,7 +3620,7 @@ class ClrDataExceptionState : public IXCLRDataExceptionState virtual HRESULT STDMETHODCALLTYPE GetString( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *strLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]); virtual HRESULT STDMETHODCALLTYPE IsSameState( /* [in] */ EXCEPTION_RECORD64 *exRecord, @@ -3724,7 +3724,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token); virtual HRESULT STDMETHODCALLTYPE GetNumFields2( @@ -3742,7 +3742,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token); virtual HRESULT STDMETHODCALLTYPE EnumField2( @@ -3750,7 +3750,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataModule** tokenScope, /* [out] */ mdFieldDef *token); @@ -3783,7 +3783,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetFieldByToken2( /* [in] */ IXCLRDataModule* tokenScope, @@ -3791,7 +3791,7 @@ class ClrDataValue : public IXCLRDataValue /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]); virtual HRESULT STDMETHODCALLTYPE GetAssociatedValue( /* [out] */ IXCLRDataValue **assocValue); @@ -3802,7 +3802,7 @@ class ClrDataValue : public IXCLRDataValue virtual HRESULT STDMETHODCALLTYPE GetString( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *strLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]); + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]); virtual HRESULT STDMETHODCALLTYPE GetArrayProperties( /* [out] */ ULONG32 *rank, @@ -3844,7 +3844,7 @@ class ClrDataValue : public IXCLRDataValue IXCLRDataValue** pubValue, ULONG32 nameBufRetLen, ULONG32* nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet); @@ -3854,7 +3854,7 @@ class ClrDataValue : public IXCLRDataValue IXCLRDataValue** pubValue, ULONG32 nameBufRetLen, ULONG32* nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef* tokenRet) { diff --git a/src/coreclr/debug/daccess/inspect.cpp b/src/coreclr/debug/daccess/inspect.cpp index 21afb220103cb6..0a3138c5b77dbd 100644 --- a/src/coreclr/debug/daccess/inspect.cpp +++ b/src/coreclr/debug/daccess/inspect.cpp @@ -574,7 +574,7 @@ ClrDataValue::GetFieldByIndex( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token) { // XXX Microsoft - Obsolete method, never implemented. @@ -661,7 +661,7 @@ ClrDataValue::EnumField( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token) { return EnumField2(handle, field, nameBufLen, nameLen, nameBuf, @@ -674,7 +674,7 @@ ClrDataValue::EnumField2( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataModule** tokenScope, /* [out] */ mdFieldDef *token) { @@ -839,7 +839,7 @@ ClrDataValue::GetFieldByToken( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { return GetFieldByToken2(NULL, token, field, bufLen, nameLen, nameBuf); } @@ -851,7 +851,7 @@ ClrDataValue::GetFieldByToken2( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { HRESULT status; @@ -1029,7 +1029,7 @@ HRESULT STDMETHODCALLTYPE ClrDataValue::GetString( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *strLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]) { HRESULT status; @@ -1381,7 +1381,7 @@ ClrDataValue::NewFromFieldDesc(ClrDataAccess* dac, IXCLRDataValue** pubValue, ULONG32 nameBufRetLen, ULONG32 *nameLenRet, - __out_ecount_part_opt(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], + _Out_writes_to_opt_(nameBufRetLen, *nameLenRet) WCHAR nameBufRet[ ], IXCLRDataModule** tokenScopeRet, mdFieldDef *tokenRet) { @@ -1991,7 +1991,7 @@ ClrDataTypeDefinition::EnumField( /* [out][in] */ CLRDATA_ENUM *handle, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags, /* [out] */ mdFieldDef *token) @@ -2005,7 +2005,7 @@ ClrDataTypeDefinition::EnumField2( /* [out][in] */ CLRDATA_ENUM *handle, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags, /* [out] */ IXCLRDataModule** tokenScope, @@ -2180,7 +2180,7 @@ ClrDataTypeDefinition::GetFieldByToken( /* [in] */ mdFieldDef token, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags) { @@ -2194,7 +2194,7 @@ ClrDataTypeDefinition::GetFieldByToken2( /* [in] */ mdFieldDef token, /* [in] */ ULONG32 nameBufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(nameBufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(nameBufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataTypeDefinition **type, /* [out] */ ULONG32 *flags) { @@ -2276,7 +2276,7 @@ ClrDataTypeDefinition::GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { HRESULT status = S_OK; @@ -3014,7 +3014,7 @@ ClrDataTypeInstance::GetStaticFieldByIndex( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ mdFieldDef *token) { HRESULT status; @@ -3186,7 +3186,7 @@ ClrDataTypeInstance::EnumStaticField2( /* [out] */ IXCLRDataValue **value, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ], + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ], /* [out] */ IXCLRDataModule** tokenScope, /* [out] */ mdFieldDef *token) { @@ -3351,7 +3351,7 @@ ClrDataTypeInstance::GetStaticFieldByToken( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { return GetStaticFieldByToken2(NULL, token, tlsTask, field, bufLen, nameLen, nameBuf); @@ -3365,7 +3365,7 @@ ClrDataTypeInstance::GetStaticFieldByToken2( /* [out] */ IXCLRDataValue **field, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { HRESULT status; @@ -3430,7 +3430,7 @@ ClrDataTypeInstance::GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR nameBuf[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR nameBuf[ ]) { HRESULT status = S_OK; diff --git a/src/coreclr/debug/daccess/request.cpp b/src/coreclr/debug/daccess/request.cpp index fe66a8b30b4212..1e327721f4a92d 100644 --- a/src/coreclr/debug/daccess/request.cpp +++ b/src/coreclr/debug/daccess/request.cpp @@ -580,7 +580,7 @@ ClrDataAccess::GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower, } HRESULT -ClrDataAccess::GetRegisterName(int regNum, unsigned int count, __out_z __inout_ecount(count) WCHAR *buffer, unsigned int *pNeeded) +ClrDataAccess::GetRegisterName(int regNum, unsigned int count, _Inout_updates_z_(count) WCHAR *buffer, unsigned int *pNeeded) { if (!buffer && !pNeeded) return E_POINTER; @@ -1322,7 +1322,7 @@ ClrDataAccess::GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD } HRESULT -ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded) +ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded) { if (methodDesc == 0) return E_INVALIDARG; @@ -1426,7 +1426,7 @@ ClrDataAccess::GetDomainFromContext(CLRDATA_ADDRESS contextAddr, CLRDATA_ADDRESS HRESULT -ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *stringData, unsigned int *pNeeded) +ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *stringData, unsigned int *pNeeded) { if (obj == 0) return E_INVALIDARG; @@ -1478,7 +1478,7 @@ ClrDataAccess::GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, __ou } HRESULT -ClrDataAccess::GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, __out_z __inout_ecount(count) WCHAR *className, unsigned int *pNeeded) +ClrDataAccess::GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, _Inout_updates_z_(count) WCHAR *className, unsigned int *pNeeded) { if (obj == 0) return E_INVALIDARG; @@ -1740,7 +1740,7 @@ ClrDataAccess::GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData } HRESULT -ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_z __inout_ecount(count) WCHAR *mtName, unsigned int *pNeeded) +ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, _Inout_updates_z_(count) WCHAR *mtName, unsigned int *pNeeded) { if (mt == 0) return E_INVALIDARG; @@ -2003,7 +2003,7 @@ ClrDataAccess::GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS } HRESULT -ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z __inout_ecount(count) WCHAR *frameName, unsigned int *pNeeded) +ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, _Inout_updates_z_(count) WCHAR *frameName, unsigned int *pNeeded) { if (vtable == 0) return E_INVALIDARG; @@ -2043,7 +2043,7 @@ ClrDataAccess::GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, __out_z } HRESULT -ClrDataAccess::GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *fileName, unsigned int *pNeeded) +ClrDataAccess::GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *fileName, unsigned int *pNeeded) { if (addr == 0 || (fileName == NULL && pNeeded == NULL) || (fileName != NULL && count == 0)) return E_INVALIDARG; @@ -2369,7 +2369,7 @@ ClrDataAccess::GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pCo HRESULT ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int count, - __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded) + _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded) { if (assembly == NULL || (location == NULL && pNeeded == NULL) || (location != NULL && count == 0)) return E_INVALIDARG; @@ -2399,7 +2399,7 @@ ClrDataAccess::GetFailedAssemblyLocation(CLRDATA_ADDRESS assembly, unsigned int } HRESULT -ClrDataAccess::GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded) +ClrDataAccess::GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded) { if (assembly == NULL || (name == NULL && pNeeded == NULL) || (name != NULL && count == 0)) return E_INVALIDARG; @@ -2509,7 +2509,7 @@ ClrDataAccess::GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count, } HRESULT -ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded) +ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded) { SOSDacEnter(); @@ -2550,7 +2550,7 @@ ClrDataAccess::GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, __out_ HRESULT ClrDataAccess::GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, - __out_z __inout_ecount(count) WCHAR *base, unsigned int *pNeeded) + _Inout_updates_z_(count) WCHAR *base, unsigned int *pNeeded) { // Method is not supported on CoreCLR @@ -2559,7 +2559,7 @@ ClrDataAccess::GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, HRESULT ClrDataAccess::GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, - __out_z __inout_ecount(count) WCHAR *paths, unsigned int *pNeeded) + _Inout_updates_z_(count) WCHAR *paths, unsigned int *pNeeded) { // Method is not supported on CoreCLR @@ -2568,7 +2568,7 @@ ClrDataAccess::GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, HRESULT ClrDataAccess::GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, - __out_z __inout_ecount(count) WCHAR *configFile, unsigned int *pNeeded) + _Inout_updates_z_(count) WCHAR *configFile, unsigned int *pNeeded) { // Method is not supported on CoreCLR @@ -2620,7 +2620,7 @@ ClrDataAccess::GetAssemblyData(CLRDATA_ADDRESS cdBaseDomainPtr, CLRDATA_ADDRESS } HRESULT -ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __out_z __inout_ecount(count) WCHAR *name, unsigned int *pNeeded) +ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, _Inout_updates_z_(count) WCHAR *name, unsigned int *pNeeded) { SOSDacEnter(); Assembly* pAssembly = PTR_Assembly(TO_TADDR(assembly)); @@ -2661,7 +2661,7 @@ ClrDataAccess::GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, __o } HRESULT -ClrDataAccess::GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, __out_z __inout_ecount(count) WCHAR *location, unsigned int *pNeeded) +ClrDataAccess::GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, _Inout_updates_z_(count) WCHAR *location, unsigned int *pNeeded) { if ((assembly == NULL) || (location == NULL && pNeeded == NULL) || (location != NULL && count == 0)) { @@ -3636,7 +3636,7 @@ ClrDataAccess::GetSyncBlockCleanupData(CLRDATA_ADDRESS syncBlock, struct DacpSyn } HRESULT -ClrDataAccess::GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, __out_z __inout_ecount(count) char *name, unsigned int *pNeeded) +ClrDataAccess::GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, _Inout_updates_z_(count) char *name, unsigned int *pNeeded) { SOSDacEnter(); diff --git a/src/coreclr/debug/daccess/stack.cpp b/src/coreclr/debug/daccess/stack.cpp index 6ced6d60b35391..dfcb16c31523f3 100644 --- a/src/coreclr/debug/daccess/stack.cpp +++ b/src/coreclr/debug/daccess/stack.cpp @@ -787,7 +787,7 @@ ClrDataFrame::GetArgumentByIndex( /* [out] */ IXCLRDataValue **arg, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -942,7 +942,7 @@ ClrDataFrame::GetLocalVariableByIndex( /* [out] */ IXCLRDataValue **localVariable, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -1111,7 +1111,7 @@ ClrDataFrame::GetCodeName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *symbolLen, - /* [size_is][out] */ __out_ecount_opt(bufLen) WCHAR symbolBuf[ ]) + /* [size_is][out] */ _Out_writes_bytes_opt_(bufLen) WCHAR symbolBuf[ ]) { HRESULT status = E_FAIL; diff --git a/src/coreclr/debug/daccess/task.cpp b/src/coreclr/debug/daccess/task.cpp index 42c4e0becce1c1..30abc5e090cc9e 100644 --- a/src/coreclr/debug/daccess/task.cpp +++ b/src/coreclr/debug/daccess/task.cpp @@ -149,7 +149,7 @@ HRESULT STDMETHODCALLTYPE ClrDataTask::GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -713,7 +713,7 @@ HRESULT STDMETHODCALLTYPE ClrDataAppDomain::GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status = S_OK; @@ -1132,7 +1132,7 @@ HRESULT STDMETHODCALLTYPE ClrDataAssembly::GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -1160,7 +1160,7 @@ HRESULT STDMETHODCALLTYPE ClrDataAssembly::GetFileName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -1201,7 +1201,7 @@ HRESULT STDMETHODCALLTYPE ClrDataAssembly::GetDisplayName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -2376,7 +2376,7 @@ HRESULT STDMETHODCALLTYPE ClrDataModule::GetName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -2404,7 +2404,7 @@ HRESULT STDMETHODCALLTYPE ClrDataModule::GetFileName( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -3115,7 +3115,7 @@ ClrDataMethodDefinition::GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part_opt(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -3858,7 +3858,7 @@ ClrDataMethodInstance::GetName( /* [in] */ ULONG32 flags, /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *nameLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *nameLen) WCHAR name[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *nameLen) WCHAR name[ ]) { HRESULT status; @@ -4735,7 +4735,7 @@ HRESULT STDMETHODCALLTYPE ClrDataExceptionState::GetString( /* [in] */ ULONG32 bufLen, /* [out] */ ULONG32 *strLen, - /* [size_is][out] */ __out_ecount_part(bufLen, *strLen) WCHAR str[ ]) + /* [size_is][out] */ _Out_writes_to_opt_(bufLen, *strLen) WCHAR str[ ]) { HRESULT status = E_FAIL; diff --git a/src/coreclr/debug/dbgutil/machoreader.cpp b/src/coreclr/debug/dbgutil/machoreader.cpp index d2801547cb9ba9..7fef34e1afb16d 100644 --- a/src/coreclr/debug/dbgutil/machoreader.cpp +++ b/src/coreclr/debug/dbgutil/machoreader.cpp @@ -229,9 +229,8 @@ MachOModule::ReadLoadCommands() m_segments.push_back(segment); // Calculate the load bias for the module. This is the value to add to the vmaddr of a - // segment to get the actual address. For shared modules, this is 0 since those segments - // are absolute address. - if (segment->fileoff == 0 && segment->filesize > 0) + // segment to get the actual address. + if (strcmp(segment->segname, SEG_TEXT) == 0) { m_loadBias = m_baseAddress - segment->vmaddr; } diff --git a/src/coreclr/debug/di/cordb.cpp b/src/coreclr/debug/di/cordb.cpp index 2c11397fcd3bc7..e195f3731a9e6f 100644 --- a/src/coreclr/debug/di/cordb.cpp +++ b/src/coreclr/debug/di/cordb.cpp @@ -443,10 +443,10 @@ STDAPI GetRequestedRuntimeInfo(LPCWSTR pExe, LPCWSTR pConfigurationFile, DWORD startupFlags, DWORD runtimeInfoFlags, - __out_ecount_opt(dwDirectory) LPWSTR pDirectory, + _Out_writes_bytes_opt_(dwDirectory) LPWSTR pDirectory, DWORD dwDirectory, DWORD *dwDirectoryLength, - __out_ecount_opt(cchBuffer) LPWSTR pVersion, + _Out_writes_bytes_opt_(cchBuffer) LPWSTR pVersion, DWORD cchBuffer, DWORD* dwlength) { diff --git a/src/coreclr/debug/di/divalue.cpp b/src/coreclr/debug/di/divalue.cpp index 2e70a306180c59..b8c9e745260db2 100644 --- a/src/coreclr/debug/di/divalue.cpp +++ b/src/coreclr/debug/di/divalue.cpp @@ -2320,7 +2320,7 @@ HRESULT CordbObjectValue::GetLength(ULONG32 *pcchString) // Return Value: S_OK or CORDBG_E_INVALID_OBJECT, CORDBG_E_OBJECT_NEUTERED, or E_INVALIDARG on failure HRESULT CordbObjectValue::GetString(ULONG32 cchString, ULONG32 *pcchString, - __out_ecount_opt(cchString) WCHAR szString[]) + _Out_writes_bytes_opt_(cchString) WCHAR szString[]) { PUBLIC_REENTRANT_API_ENTRY(this); FAIL_IF_NEUTERED(this); diff --git a/src/coreclr/debug/di/module.cpp b/src/coreclr/debug/di/module.cpp index 9951d4a6af305f..6d6a7a55befa2e 100644 --- a/src/coreclr/debug/di/module.cpp +++ b/src/coreclr/debug/di/module.cpp @@ -1256,7 +1256,7 @@ HRESULT CordbModule::GetAssembly(ICorDebugAssembly **ppAssembly) // Public implementation of ICorDebugModule::GetName, // wrapper around code:GetNameWorker (which throws). -HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) @@ -1324,7 +1324,7 @@ HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_pa // Note: // Filename isn't necessarily the same as the module name in the metadata. // -HRESULT CordbModule::GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbModule::GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { CONTRACTL { diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp index 9b21fa47e67285..59af4cc8d9c649 100644 --- a/src/coreclr/debug/di/process.cpp +++ b/src/coreclr/debug/di/process.cpp @@ -1111,7 +1111,7 @@ HRESULT ShimProcess::CreateProcess( Cordb * pCordb, ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR szProgramName, - __in_z LPWSTR szProgramArgs, + _In_z_ LPWSTR szProgramArgs, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL fInheritHandles, @@ -8624,7 +8624,7 @@ HRESULT CordbProcess::EnableLogMessages(BOOL fOnOff) /* * ModifyLogSwitch modifies the specified switch's severity level. */ -COM_METHOD CordbProcess::ModifyLogSwitch(__in_z WCHAR *pLogSwitchName, LONG lLevel) +COM_METHOD CordbProcess::ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLevel) { PUBLIC_API_ENTRY(this); FAIL_IF_NEUTERED(this); @@ -13674,7 +13674,7 @@ void CordbWin32EventThread::ForceDbgContinue(CordbProcess *pProcess, CordbUnmana HRESULT CordbWin32EventThread::SendCreateProcessEvent( MachineInfo machineInfo, LPCWSTR programName, - __in_z LPWSTR programArgs, + _In_z_ LPWSTR programArgs, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, diff --git a/src/coreclr/debug/di/publish.cpp b/src/coreclr/debug/di/publish.cpp index 23003b980ad9f1..1d7741fb9ea75b 100644 --- a/src/coreclr/debug/di/publish.cpp +++ b/src/coreclr/debug/di/publish.cpp @@ -658,7 +658,7 @@ HRESULT AllocateAndReadRemoteString( HANDLE hProcess, void * pRemotePtr, SIZE_T cbSize, // size of buffer to allocate + copy. - __deref_out_bcount(cbSize) WCHAR * * ppNewLocalBuffer + _Outptr_result_bytebuffer_(cbSize) WCHAR * * ppNewLocalBuffer ) { // Make sure buffer has right geometry. @@ -902,7 +902,7 @@ HRESULT CorpubProcess::GetProcessID(unsigned *pid) */ HRESULT CorpubProcess::GetDisplayName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { VALIDATE_POINTER_TO_OBJECT_ARRAY_OR_NULL(szName, WCHAR, cchName, true, true); VALIDATE_POINTER_TO_OBJECT_OR_NULL(pcchName, ULONG32 *); @@ -928,7 +928,7 @@ HRESULT CorpubProcess::GetDisplayName(ULONG32 cchName, // CorpubAppDomain // ****************************************** -CorpubAppDomain::CorpubAppDomain (__in LPWSTR szAppDomainName, ULONG Id) +CorpubAppDomain::CorpubAppDomain (_In_ LPWSTR szAppDomainName, ULONG Id) : CordbCommonBase (0, enumCorpubAppDomain), m_pNext (NULL), m_szAppDomainName (szAppDomainName), @@ -976,7 +976,7 @@ HRESULT CorpubAppDomain::GetID (ULONG32 *pId) */ HRESULT CorpubAppDomain::GetName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { VALIDATE_POINTER_TO_OBJECT_ARRAY_OR_NULL(szName, WCHAR, cchName, true, true); VALIDATE_POINTER_TO_OBJECT_OR_NULL(pcchName, ULONG32 *); diff --git a/src/coreclr/debug/di/rsappdomain.cpp b/src/coreclr/debug/di/rsappdomain.cpp index 6b4da4ee206027..081baa95216d5b 100644 --- a/src/coreclr/debug/di/rsappdomain.cpp +++ b/src/coreclr/debug/di/rsappdomain.cpp @@ -700,7 +700,7 @@ HRESULT CordbAppDomain::Attach() */ HRESULT CordbAppDomain::GetName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) diff --git a/src/coreclr/debug/di/rsassembly.cpp b/src/coreclr/debug/di/rsassembly.cpp index b7b7d6756391d7..73c864f6e2159a 100644 --- a/src/coreclr/debug/di/rsassembly.cpp +++ b/src/coreclr/debug/di/rsassembly.cpp @@ -202,7 +202,7 @@ HRESULT CordbAssembly::EnumerateModules(ICorDebugModuleEnum **ppModules) */ HRESULT CordbAssembly::GetCodeBase(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { PUBLIC_API_ENTRY(this); FAIL_IF_NEUTERED(this); @@ -232,7 +232,7 @@ HRESULT CordbAssembly::GetCodeBase(ULONG32 cchName, // HRESULT CordbAssembly::GetName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { PUBLIC_API_ENTRY(this); FAIL_IF_NEUTERED(this); diff --git a/src/coreclr/debug/di/rsmain.cpp b/src/coreclr/debug/di/rsmain.cpp index ff49f2186a40ca..5594b299e2d125 100644 --- a/src/coreclr/debug/di/rsmain.cpp +++ b/src/coreclr/debug/di/rsmain.cpp @@ -595,7 +595,7 @@ namespace COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, - __in_z WCHAR* pConnectionName); + _In_z_ WCHAR* pConnectionName); COM_METHOD ChangeConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId); COM_METHOD DestroyConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId); @@ -725,7 +725,7 @@ namespace HRESULT DefaultManagedCallback2::CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, - __in_z WCHAR* pConnectionName) + _In_z_ WCHAR* pConnectionName) { _ASSERTE(!"DefaultManagedCallback2::CreateConnection not implemented"); return E_NOTIMPL; @@ -1572,7 +1572,7 @@ bool Cordb::IsInteropDebuggingSupported() // //--------------------------------------------------------------------------------------- HRESULT Cordb::CreateProcess(LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -1601,7 +1601,7 @@ HRESULT Cordb::CreateProcess(LPCWSTR lpApplicationName, HRESULT Cordb::CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -1735,7 +1735,7 @@ HRESULT Cordb::CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget, HRESULT Cordb::CreateProcessEx(ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, diff --git a/src/coreclr/debug/di/rsmda.cpp b/src/coreclr/debug/di/rsmda.cpp index 517e6dcfdeb015..822e9824a1d417 100644 --- a/src/coreclr/debug/di/rsmda.cpp +++ b/src/coreclr/debug/di/rsmda.cpp @@ -102,7 +102,7 @@ HRESULT CordbMDA::QueryInterface(REFIID riid, void **ppInterface) // // Returns: S_OK on success. //----------------------------------------------------------------------------- -HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { _ASSERTE(pInputString != NULL); ULONG32 len = (ULONG32) wcslen(pInputString) + 1; @@ -144,7 +144,7 @@ HRESULT CopyOutString(LPCWSTR pInputString, ULONG32 cchName, ULONG32 * pcchName, // the type from that based off the schema. // See CopyOutString for parameter details. //----------------------------------------------------------------------------- -HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) @@ -159,7 +159,7 @@ HRESULT CordbMDA::GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part // Get a string description of the MDA. This may be empty (0-length). // See CopyOutString for parameter details. //----------------------------------------------------------------------------- -HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) @@ -176,7 +176,7 @@ HRESULT CordbMDA::GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecou // See the MDA documentation for the schema for this XML stream. // See CopyOutString for parameter details. //----------------------------------------------------------------------------- -HRESULT CordbMDA::GetXML(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]) +HRESULT CordbMDA::GetXML(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]) { HRESULT hr = S_OK; PUBLIC_API_BEGIN(this) diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h index a34dd0e6a07288..690917c2795a91 100644 --- a/src/coreclr/debug/di/rspriv.h +++ b/src/coreclr/debug/di/rspriv.h @@ -2211,7 +2211,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote COM_METHOD SetManagedHandler(ICorDebugManagedCallback *pCallback); COM_METHOD SetUnmanagedHandler(ICorDebugUnmanagedCallback *pCallback); COM_METHOD CreateProcess(LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -2243,7 +2243,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote COM_METHOD CreateProcessEx(ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -2267,7 +2267,7 @@ class Cordb : public CordbBase, public ICorDebug, public ICorDebugRemote HRESULT CreateProcessCommon(ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR lpApplicationName, - __in_z LPWSTR lpCommandLine, + _In_z_ LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -2463,7 +2463,7 @@ class CordbAppDomain : public CordbBase, // Returns the friendly name of the AppDomain COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); /* * GetObject returns the runtime app domain object. @@ -2646,12 +2646,12 @@ class CordbAssembly : public CordbBase, public ICorDebugAssembly, ICorDebugAssem */ COM_METHOD GetCodeBase(ULONG32 cchName, ULONG32 * pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); // returns the filename of the assembly, or "" for in-memory assemblies COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); //----------------------------------------------------------- @@ -3079,7 +3079,7 @@ class CordbProcess : /* * ModifyLogSwitch modifies the specified switch's severity level. */ - COM_METHOD ModifyLogSwitch(__in_z WCHAR *pLogSwitchName, LONG lLevel); + COM_METHOD ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLevel); COM_METHOD EnumerateAppDomains(ICorDebugAppDomainEnum **ppAppDomains); COM_METHOD GetObject(ICorDebugValue **ppObject); @@ -4180,7 +4180,7 @@ class CordbModule : public CordbBase, COM_METHOD GetProcess(ICorDebugProcess **ppProcess); COM_METHOD GetBaseAddress(CORDB_ADDRESS *pAddress); COM_METHOD GetAssembly(ICorDebugAssembly **ppAssembly); - COM_METHOD GetName(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + COM_METHOD GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); COM_METHOD EnableJITDebugging(BOOL bTrackJITInfo, BOOL bAllowJitOpts); COM_METHOD EnableClassLoadCallbacks(BOOL bClassLoadCallbacks); @@ -4252,7 +4252,7 @@ class CordbModule : public CordbBase, #endif // _DEBUG // Internal help to get the "name" (filename or pretty name) of the module. - HRESULT GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + HRESULT GetNameWorker(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); // Marks that the module's metadata has become invalid and needs to be refetched. void RefreshMetaData(); @@ -4484,15 +4484,15 @@ class CordbMDA : public CordbBase, public ICorDebugMDA // Get the string for the type of the MDA. Never empty. // This is a convenient performant alternative to getting the XML stream and extracting // the type from that based off the schema. - COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + COM_METHOD GetName(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); // Get a string description of the MDA. This may be empty (0-length). - COM_METHOD GetDescription(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + COM_METHOD GetDescription(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); // Get the full associated XML for the MDA. This may be empty. // This could be a potentially expensive operation if the xml stream is large. // See the MDA documentation for the schema for this XML stream. - COM_METHOD GetXML(ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + COM_METHOD GetXML(ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); COM_METHOD GetFlags(CorDebugMDAFlags * pFlags); @@ -9292,7 +9292,7 @@ class CordbObjectValue : public CordbValue, COM_METHOD GetLength(ULONG32 * pcchString); COM_METHOD GetString(ULONG32 cchString, ULONG32 * ppcchStrin, - __out_ecount_opt(cchString) WCHAR szString[]); + _Out_writes_bytes_opt_(cchString) WCHAR szString[]); //----------------------------------------------------------- // ICorDebugExceptionObjectValue @@ -10120,7 +10120,7 @@ class CordbWin32EventThread HRESULT SendCreateProcessEvent(MachineInfo machineInfo, LPCWSTR programName, - __in_z LPWSTR programArgs, + _In_z_ LPWSTR programArgs, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, @@ -10811,7 +10811,7 @@ class CorpubProcess : public CordbCommonBase, public ICorPublishProcess */ COM_METHOD GetDisplayName(ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); CorpubProcess *GetNextProcess () { return m_pNext;} void SetNext (CorpubProcess *pNext) { m_pNext = pNext;} @@ -10838,7 +10838,7 @@ class CorpubProcess : public CordbCommonBase, public ICorPublishProcess class CorpubAppDomain : public CordbCommonBase, public ICorPublishAppDomain { public: - CorpubAppDomain (__in LPWSTR szAppDomainName, ULONG Id); + CorpubAppDomain (_In_ LPWSTR szAppDomainName, ULONG Id); virtual ~CorpubAppDomain(); #ifdef _DEBUG @@ -10873,7 +10873,7 @@ class CorpubAppDomain : public CordbCommonBase, public ICorPublishAppDomain */ COM_METHOD GetName (ULONG32 cchName, ULONG32 *pcchName, - __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); + _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); CorpubAppDomain *GetNextAppDomain () { return m_pNext;} void SetNext (CorpubAppDomain *pNext) { m_pNext = pNext;} @@ -11142,7 +11142,7 @@ class CordbEnumFilter : public CordbBase, void CheckAgainstDAC(CordbFunction * pFunc, void * pIP, mdMethodDef mdExpected); #endif -HRESULT CopyOutString(const WCHAR * pInputString, ULONG32 cchName, ULONG32 * pcchName, __out_ecount_part_opt(cchName, *pcchName) WCHAR szName[]); +HRESULT CopyOutString(const WCHAR * pInputString, ULONG32 cchName, ULONG32 * pcchName, _Out_writes_to_opt_(cchName, *pcchName) WCHAR szName[]); diff --git a/src/coreclr/debug/di/shimcallback.cpp b/src/coreclr/debug/di/shimcallback.cpp index ba5f0771fca49a..4e8f029209def7 100644 --- a/src/coreclr/debug/di/shimcallback.cpp +++ b/src/coreclr/debug/di/shimcallback.cpp @@ -659,7 +659,7 @@ HRESULT ShimProxyCallback::DebuggerError(ICorDebugProcess * pProcess, HRESULT er // Implementation of ICorDebugManagedCallback::LogMessage -HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, __in LPWSTR pLogSwitchName, __in LPWSTR pMessage) +HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, _In_ LPWSTR pLogSwitchName, _In_ LPWSTR pMessage) { m_pShim->PreDispatchEvent(); class LogMessageEvent : public ManagedEvent @@ -695,7 +695,7 @@ HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebug // Implementation of ICorDebugManagedCallback::LogSwitch -HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, __in LPWSTR pLogSwitchName, __in LPWSTR pParentName) +HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, _In_ LPWSTR pLogSwitchName, _In_ LPWSTR pParentName) { m_pShim->PreDispatchEvent(); class LogSwitchEvent : public ManagedEvent @@ -1060,7 +1060,7 @@ HRESULT ShimProxyCallback::FunctionRemapOpportunity(ICorDebugAppDomain * pAppDom // Implementation of ICorDebugManagedCallback2::CreateConnection -HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, __in LPWSTR pConnectionName) +HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, _In_ LPWSTR pConnectionName) { m_pShim->PreDispatchEvent(); class CreateConnectionEvent : public ManagedEvent diff --git a/src/coreclr/debug/di/shimpriv.h b/src/coreclr/debug/di/shimpriv.h index 89a0c0d0c79374..26a939ee8a3a8e 100644 --- a/src/coreclr/debug/di/shimpriv.h +++ b/src/coreclr/debug/di/shimpriv.h @@ -128,15 +128,15 @@ class ShimProxyCallback : COM_METHOD LogMessage( ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, LONG lLevel, - __in LPWSTR pLogSwitchName, - __in LPWSTR pMessage); + _In_ LPWSTR pLogSwitchName, + _In_ LPWSTR pMessage); COM_METHOD LogSwitch( ICorDebugAppDomain *pAppDomain, ICorDebugThread *pThread, LONG lLevel, ULONG ulReason, - __in LPWSTR pLogSwitchName, - __in LPWSTR pParentName); + _In_ LPWSTR pLogSwitchName, + _In_ LPWSTR pParentName); COM_METHOD CreateAppDomain(ICorDebugProcess *pProcess, ICorDebugAppDomain *pAppDomain); @@ -178,7 +178,7 @@ class ShimProxyCallback : ICorDebugFunction *pNewFunction, ULONG32 oldILOffset); - COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, __in LPWSTR pConnName); + COM_METHOD CreateConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId, _In_ LPWSTR pConnName); COM_METHOD ChangeConnection(ICorDebugProcess *pProcess, CONNID dwConnectionId ); @@ -368,7 +368,7 @@ class ShimProcess Cordb * pCordb, ICorDebugRemoteTarget * pRemoteTarget, LPCWSTR programName, - __in_z LPWSTR programArgs, + _In_z_ LPWSTR programArgs, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, diff --git a/src/coreclr/debug/di/symbolinfo.cpp b/src/coreclr/debug/di/symbolinfo.cpp index 452adbe71f3a7e..37cff967d02fea 100644 --- a/src/coreclr/debug/di/symbolinfo.cpp +++ b/src/coreclr/debug/di/symbolinfo.cpp @@ -231,7 +231,7 @@ STDMETHODIMP_(ULONG) SymbolInfo::Release () STDMETHODIMP SymbolInfo::GetTypeDefProps ( // S_OK or error. mdTypeDef td, // [IN] TypeDef token for inquiry. - __out_ecount_part_opt(cchTypeDef, pchTypeDef) + _Out_writes_to_opt_(cchTypeDef, pchTypeDef) LPWSTR szTypeDef, // [OUT] Put name here. ULONG cchTypeDef, // [IN] size of name buffer in wide chars. ULONG *pchTypeDef, // [OUT] put size of name (wide chars) here. @@ -278,7 +278,7 @@ STDMETHODIMP SymbolInfo::GetTypeDefProps ( // S_OK or error. STDMETHODIMP SymbolInfo::GetMethodProps ( mdMethodDef mb, // The method for which to get props. mdTypeDef *pClass, // Put method's class here. - __out_ecount_part_opt(cchMethod, *pchMethod) + _Out_writes_to_opt_(cchMethod, *pchMethod) LPWSTR szMethod, // Put method's name here. ULONG cchMethod, // Size of szMethod buffer in wide chars. ULONG *pchMethod, // Put actual size here @@ -419,7 +419,7 @@ STDMETHODIMP SymbolInfo::FindTypeDefByName ( // S_OK or error. } STDMETHODIMP SymbolInfo::GetScopeProps ( // S_OK or error. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Put the name here. ULONG cchName, // [IN] Size of name buffer in wide chars. ULONG *pchName, // [OUT] Put size of name (wide chars) here. @@ -449,7 +449,7 @@ STDMETHODIMP SymbolInfo::GetInterfaceImplProps ( // S_OK or error. STDMETHODIMP SymbolInfo::GetTypeRefProps ( // S_OK or error. mdTypeRef tr, // [IN] TypeRef token. mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Name of the TypeRef. ULONG cchName, // [IN] Size of buffer. ULONG *pchName) // [OUT] Size of Name. @@ -629,7 +629,7 @@ STDMETHODIMP SymbolInfo::FindMemberRef ( STDMETHODIMP SymbolInfo::GetMemberRefProps ( // S_OK or error. mdMemberRef mr, // [IN] given memberref mdToken *ptk, // [OUT] Put classref or classdef here. - __out_ecount_part_opt(cchMember, *pchMember) + _Out_writes_to_opt_(cchMember, *pchMember) LPWSTR szMember, // [OUT] buffer to fill for member's name ULONG cchMember, // [IN] the count of char of szMember ULONG *pchMember, // [OUT] actual count of char in member name @@ -752,7 +752,7 @@ STDMETHODIMP SymbolInfo::GetSigFromToken ( // S_OK or error. STDMETHODIMP SymbolInfo::GetModuleRefProps ( // S_OK or error. mdModuleRef mur, // [IN] moduleref token. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] buffer to fill with the moduleref name. ULONG cchName, // [IN] size of szName in wide characters. ULONG *pchName) // [OUT] actual count of characters in the name. @@ -800,7 +800,7 @@ STDMETHODIMP SymbolInfo::EnumUnresolvedMethods ( // S_OK, S_FALSE, or erro STDMETHODIMP SymbolInfo::GetUserString ( // S_OK or error. mdString stk, // [IN] String token. - __out_ecount_part_opt(cchString, *pchString) + _Out_writes_to_opt_(cchString, *pchString) LPWSTR szString, // [OUT] Copy of string. ULONG cchString, // [IN] Max chars of room in szString. ULONG *pchString) // [OUT] How many chars in actual string. @@ -812,7 +812,7 @@ STDMETHODIMP SymbolInfo::GetUserString ( // S_OK or error. STDMETHODIMP SymbolInfo::GetPinvokeMap ( // S_OK or error. mdToken tk, // [IN] FieldDef or MethodDef. DWORD *pdwMappingFlags, // [OUT] Flags used for mapping. - __out_ecount_part_opt(cchImportName, *pchImportName) + _Out_writes_to_opt_(cchImportName, *pchImportName) LPWSTR szImportName, // [OUT] Import name. ULONG cchImportName, // [IN] Size of the name buffer. ULONG *pchImportName, // [OUT] Actual number of characters stored. @@ -896,7 +896,7 @@ STDMETHODIMP SymbolInfo::FindTypeRef ( STDMETHODIMP SymbolInfo::GetMemberProps ( mdToken mb, // The member for which to get props. mdTypeDef *pClass, // Put member's class here. - __out_ecount_part_opt(cchMember, *pchMember) + _Out_writes_to_opt_(cchMember, *pchMember) LPWSTR szMember, // Put member's name here. ULONG cchMember, // Size of szMember buffer in wide chars. ULONG *pchMember, // Put actual size here @@ -916,7 +916,7 @@ STDMETHODIMP SymbolInfo::GetMemberProps ( STDMETHODIMP SymbolInfo::GetFieldProps ( mdFieldDef mb, // The field for which to get props. mdTypeDef *pClass, // Put field's class here. - __out_ecount_part_opt(cchField, *pchField) + _Out_writes_to_opt_(cchField, *pchField) LPWSTR szField, // Put field's name here. ULONG cchField, // Size of szField buffer in wide chars. ULONG *pchField, // Put actual size here @@ -957,7 +957,7 @@ STDMETHODIMP SymbolInfo::GetParamProps ( // S_OK or error. mdParamDef tk, // [IN]The Parameter. mdMethodDef *pmd, // [OUT] Parent Method token. ULONG *pulSequence, // [OUT] Parameter sequence. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Put name here. ULONG cchName, // [OUT] Size of name buffer. ULONG *pchName, // [OUT] Put actual size of name here. diff --git a/src/coreclr/debug/di/symbolinfo.h b/src/coreclr/debug/di/symbolinfo.h index 22deafaaf5d516..5b1291f4cfe598 100644 --- a/src/coreclr/debug/di/symbolinfo.h +++ b/src/coreclr/debug/di/symbolinfo.h @@ -104,7 +104,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport mdTypeDef *ptd); // [OUT] Put the TypeDef token here. STDMETHOD(GetScopeProps)( // S_OK or error. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Put the name here. ULONG cchName, // [IN] Size of name buffer in wide chars. ULONG *pchName, // [OUT] Put size of name (wide chars) here. @@ -115,7 +115,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetTypeDefProps)( // S_OK or error. mdTypeDef td, // [IN] TypeDef token for inquiry. - __out_ecount_part_opt(cchTypeDef, *pchTypeDef) + _Out_writes_to_opt_(cchTypeDef, *pchTypeDef) LPWSTR szTypeDef, // [OUT] Put name here. ULONG cchTypeDef, // [IN] size of name buffer in wide chars. ULONG *pchTypeDef, // [OUT] put size of name (wide chars) here. @@ -130,7 +130,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetTypeRefProps)( // S_OK or error. mdTypeRef tr, // [IN] TypeRef token. mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Name of the TypeRef. ULONG cchName, // [IN] Size of buffer. ULONG *pchName); // [OUT] Size of Name. @@ -244,7 +244,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD (GetMethodProps)( mdMethodDef mb, // The method for which to get props. mdTypeDef *pClass, // Put method's class here. - __out_ecount_part_opt(cchMethod, *pchMethod) + _Out_writes_to_opt_(cchMethod, *pchMethod) LPWSTR szMethod, // Put method's name here. ULONG cchMethod, // Size of szMethod buffer in wide chars. ULONG *pchMethod, // Put actual size here @@ -257,7 +257,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetMemberRefProps)( // S_OK or error. mdMemberRef mr, // [IN] given memberref mdToken *ptk, // [OUT] Put classref or classdef here. - __out_ecount_part_opt(cchMember, *pchMember) + _Out_writes_to_opt_(cchMember, *pchMember) LPWSTR szMember, // [OUT] buffer to fill for member's name ULONG cchMember, // [IN] the count of char of szMember ULONG *pchMember, // [OUT] actual count of char in member name @@ -336,7 +336,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetModuleRefProps)( // S_OK or error. mdModuleRef mur, // [IN] moduleref token. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] buffer to fill with the moduleref name. ULONG cchName, // [IN] size of szName in wide characters. ULONG *pchName); // [OUT] actual count of characters in the name. @@ -364,7 +364,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetUserString)( // S_OK or error. mdString stk, // [IN] String token. - __out_ecount_part_opt(cchString, *pchString) + _Out_writes_to_opt_(cchString, *pchString) LPWSTR szString, // [OUT] Copy of string. ULONG cchString, // [IN] Max chars of room in szString. ULONG *pchString); // [OUT] How many chars in actual string. @@ -372,7 +372,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetPinvokeMap)( // S_OK or error. mdToken tk, // [IN] FieldDef or MethodDef. DWORD *pdwMappingFlags, // [OUT] Flags used for mapping. - __out_ecount_part_opt(cchImportName, *pchImportName) + _Out_writes_to_opt_(cchImportName, *pchImportName) LPWSTR szImportName, // [OUT] Import name. ULONG cchImportName, // [IN] Size of the name buffer. ULONG *pchImportName, // [OUT] Actual number of characters stored. @@ -424,7 +424,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetMemberProps)( mdToken mb, // The member for which to get props. mdTypeDef *pClass, // Put member's class here. - __out_ecount_part_opt(cchMember, *pchMember) + _Out_writes_to_opt_(cchMember, *pchMember) LPWSTR szMember, // Put member's name here. ULONG cchMember, // Size of szMember buffer in wide chars. ULONG *pchMember, // Put actual size here @@ -440,7 +440,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport STDMETHOD(GetFieldProps)( mdFieldDef mb, // The field for which to get props. mdTypeDef *pClass, // Put field's class here. - __out_ecount_part_opt(cchField, *pchField) + _Out_writes_to_opt_(cchField, *pchField) LPWSTR szField, // Put field's name here. ULONG cchField, // Size of szField buffer in wide chars. ULONG *pchField, // Put actual size here @@ -473,7 +473,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport mdParamDef tk, // [IN]The Parameter. mdMethodDef *pmd, // [OUT] Parent Method token. ULONG *pulSequence, // [OUT] Parameter sequence. - __out_ecount_part_opt(cchName, *pchName) + _Out_writes_to_opt_(cchName, *pchName) LPWSTR szName, // [OUT] Put name here. ULONG cchName, // [OUT] Size of name buffer. ULONG *pchName, // [OUT] Put actual size of name here. diff --git a/src/coreclr/debug/ee/debugger.cpp b/src/coreclr/debug/ee/debugger.cpp index 8e5200d37d5097..1e326e724250b6 100644 --- a/src/coreclr/debug/ee/debugger.cpp +++ b/src/coreclr/debug/ee/debugger.cpp @@ -14341,8 +14341,8 @@ void Debugger::SendRawLogMessage( // the creation/modification of a LogSwitch void Debugger::SendLogSwitchSetting(int iLevel, int iReason, - __in_z LPCWSTR pLogSwitchName, - __in_z LPCWSTR pParentSwitchName) + _In_z_ LPCWSTR pLogSwitchName, + _In_z_ LPCWSTR pParentSwitchName) { CONTRACTL { @@ -15854,7 +15854,7 @@ BOOL Debugger::IsThreadContextInvalid(Thread *pThread, CONTEXT *pCtx) // notification when a SQL connection begins -void Debugger::CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName) +void Debugger::CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName) { CONTRACTL { diff --git a/src/coreclr/debug/ee/debugger.h b/src/coreclr/debug/ee/debugger.h index 3fd9edf68f5d86..084f1da6a5c93f 100644 --- a/src/coreclr/debug/ee/debugger.h +++ b/src/coreclr/debug/ee/debugger.h @@ -2201,7 +2201,7 @@ class Debugger : public DebugInterface void SendInterceptExceptionComplete(Thread *thread); HRESULT AttachDebuggerForBreakpoint(Thread *thread, - __in_opt WCHAR *wszLaunchReason); + _In_opt_ WCHAR *wszLaunchReason); void ThreadIsSafe(Thread *thread); @@ -2424,8 +2424,8 @@ class Debugger : public DebugInterface void SendLogSwitchSetting (int iLevel, int iReason, - __in_z LPCWSTR pLogSwitchName, - __in_z LPCWSTR pParentSwitchName); + _In_z_ LPCWSTR pLogSwitchName, + _In_z_ LPCWSTR pParentSwitchName); bool IsLoggingEnabled (void) { @@ -2507,7 +2507,7 @@ class Debugger : public DebugInterface BOOL IsThreadContextInvalid(Thread *pThread, T_CONTEXT *pCtx); // notification for SQL fiber debugging support - void CreateConnection(CONNID dwConnectionId, __in_z WCHAR *wzName); + void CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName); void DestroyConnection(CONNID dwConnectionId); void ChangeConnection(CONNID dwConnectionId); @@ -3704,7 +3704,7 @@ void DbgLogHelper(DebuggerIPCEventType event); // Helpers for cleanup // These are various utility functions, mainly where we factor out code. //----------------------------------------------------------------------------- -void GetPidDecoratedName(__out_ecount(cBufSizeInChars) WCHAR * pBuf, +void GetPidDecoratedName(_Out_writes_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix); diff --git a/src/coreclr/debug/ee/rcthread.cpp b/src/coreclr/debug/ee/rcthread.cpp index 18c840edbb6984..0f48eb2c95e188 100644 --- a/src/coreclr/debug/ee/rcthread.cpp +++ b/src/coreclr/debug/ee/rcthread.cpp @@ -116,7 +116,7 @@ void DebuggerRCThread::CloseIPCHandles() // cBufSizeInChars - the size of the buffer in characters, including the null. // pPrefx - The undecorated name of the event. //----------------------------------------------------------------------------- -void GetPidDecoratedName(__out_ecount(cBufSizeInChars) WCHAR * pBuf, +void GetPidDecoratedName(_Out_writes_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix) { diff --git a/src/coreclr/debug/inc/common.h b/src/coreclr/debug/inc/common.h index 2baec963e14f2f..cb8474c7373856 100644 --- a/src/coreclr/debug/inc/common.h +++ b/src/coreclr/debug/inc/common.h @@ -45,7 +45,7 @@ void InitEventForDebuggerNotification(DEBUG_EVENT * pDebugEvent, #endif // (FEATURE_DBGIPC_TRANSPORT_DI || FEATURE_DBGIPC_TRANSPORT_VM) -void GetPidDecoratedName(__out_z __out_ecount(cBufSizeInChars) WCHAR * pBuf, +void GetPidDecoratedName(_Out_writes_z_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid); diff --git a/src/coreclr/debug/inc/dbgipcevents.h b/src/coreclr/debug/inc/dbgipcevents.h index db4a00fca1c865..ddef09554cf80d 100644 --- a/src/coreclr/debug/inc/dbgipcevents.h +++ b/src/coreclr/debug/inc/dbgipcevents.h @@ -990,7 +990,7 @@ extern const size_t nameCount; struct MSLAYOUT IPCENames // We use a class/struct so that the function can remain in a shared header file { - static DebuggerIPCEventType GetEventType(__in_z char * strEventType) + static DebuggerIPCEventType GetEventType(_In_z_ char * strEventType) { // pass in the string of event name and find the matching enum value // This is a linear search which is pretty slow. However, this is only used diff --git a/src/coreclr/debug/shared/dbgtransportsession.cpp b/src/coreclr/debug/shared/dbgtransportsession.cpp index 85fb7901b01c1a..6d3ed5b345cf7c 100644 --- a/src/coreclr/debug/shared/dbgtransportsession.cpp +++ b/src/coreclr/debug/shared/dbgtransportsession.cpp @@ -1143,7 +1143,7 @@ DbgTransportSession::Message * DbgTransportSession::RemoveMessageFromSendQueue(D // Check read and optionally write memory access to the specified range of bytes. Used to check // ReadProcessMemory and WriteProcessMemory requests. -HRESULT DbgTransportSession::CheckBufferAccess(__in_ecount(cbBuffer) PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess) +HRESULT DbgTransportSession::CheckBufferAccess(_In_reads_(cbBuffer) PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess) { // check for integer overflow if ((pbBuffer + cbBuffer) < pbBuffer) diff --git a/src/coreclr/debug/shared/utils.cpp b/src/coreclr/debug/shared/utils.cpp index 85f17b50c44e78..be967b1d1b7fa2 100644 --- a/src/coreclr/debug/shared/utils.cpp +++ b/src/coreclr/debug/shared/utils.cpp @@ -126,7 +126,7 @@ void InitEventForDebuggerNotification(DEBUG_EVENT * pDebugEvent, // cBufSizeInChars - the size of the buffer in characters, including the null. // pPrefx - The undecorated name of the event. //----------------------------------------------------------------------------- -void GetPidDecoratedName(__out_z __out_ecount(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid) +void GetPidDecoratedName(_Out_writes_z_(cBufSizeInChars) WCHAR * pBuf, int cBufSizeInChars, const WCHAR * pPrefix, DWORD pid) { const WCHAR szGlobal[] = W("Global\\"); int szGlobalLen; diff --git a/src/coreclr/debug/shim/debugshim.cpp b/src/coreclr/debug/shim/debugshim.cpp index b86c8eb0cfcc3a..3dcfbcc2510785 100644 --- a/src/coreclr/debug/shim/debugshim.cpp +++ b/src/coreclr/debug/shim/debugshim.cpp @@ -427,11 +427,11 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget, CLR_DEBUGGING_VERSION* pVersion, DWORD* pdwDbiTimeStamp, DWORD* pdwDbiSizeOfImage, - __out_z __inout_ecount(dwDbiNameCharCount) WCHAR* pDbiName, + _Inout_updates_z_(dwDbiNameCharCount) WCHAR* pDbiName, DWORD dwDbiNameCharCount, DWORD* pdwDacTimeStamp, DWORD* pdwDacSizeOfImage, - __out_z __inout_ecount(dwDacNameCharCount) WCHAR* pDacName, + _Inout_updates_z_(dwDacNameCharCount) WCHAR* pDacName, DWORD dwDacNameCharCount) { #ifdef HOST_WINDOWS @@ -629,7 +629,7 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget, } // Formats the long name for DAC -HRESULT CLRDebuggingImpl::FormatLongDacModuleName(__out_z __inout_ecount(cchBuffer) WCHAR * pBuffer, +HRESULT CLRDebuggingImpl::FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) WCHAR * pBuffer, DWORD cchBuffer, DWORD targetImageFileMachine, VS_FIXEDFILEINFO * pVersion) diff --git a/src/coreclr/debug/shim/debugshim.h b/src/coreclr/debug/shim/debugshim.h index 5055d5a11b47d1..93df463867feb5 100644 --- a/src/coreclr/debug/shim/debugshim.h +++ b/src/coreclr/debug/shim/debugshim.h @@ -69,14 +69,14 @@ class CLRDebuggingImpl : public ICLRDebugging CLR_DEBUGGING_VERSION * pVersion, DWORD * pdwDbiTimeStamp, DWORD * pdwDbiSizeOfImage, - __out_z __inout_ecount(dwDbiNameCharCount) WCHAR * pDbiName, + _Inout_updates_z_(dwDbiNameCharCount) WCHAR * pDbiName, DWORD dwDbiNameCharCount, DWORD * pdwDacTimeStamp, DWORD * pdwDacSizeOfImage, - __out_z __inout_ecount(dwDacNameCharCount) WCHAR * pDacName, + _Inout_updates_z_(dwDacNameCharCount) WCHAR * pDacName, DWORD dwDacNameCharCount); - HRESULT FormatLongDacModuleName(__out_z __inout_ecount(cchBuffer) WCHAR * pBuffer, + HRESULT FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) WCHAR * pBuffer, DWORD cchBuffer, DWORD targetImageFileMachine, VS_FIXEDFILEINFO * pVersion); diff --git a/src/coreclr/dlls/dbgshim/dbgshim.cpp b/src/coreclr/dlls/dbgshim/dbgshim.cpp index ac1e2d7fe189ac..40e4d7dea4bf26 100644 --- a/src/coreclr/dlls/dbgshim/dbgshim.cpp +++ b/src/coreclr/dlls/dbgshim/dbgshim.cpp @@ -79,12 +79,12 @@ if it exists, it will: DLLEXPORT HRESULT CreateProcessForLaunch( - __in LPWSTR lpCommandLine, - __in BOOL bSuspendProcess, - __in LPVOID lpEnvironment, - __in LPCWSTR lpCurrentDirectory, - __out PDWORD pProcessId, - __out HANDLE *pResumeHandle) + _In_ LPWSTR lpCommandLine, + _In_ BOOL bSuspendProcess, + _In_ LPVOID lpEnvironment, + _In_ LPCWSTR lpCurrentDirectory, + _Out_ PDWORD pProcessId, + _Out_ HANDLE *pResumeHandle) { PUBLIC_CONTRACT; @@ -140,7 +140,7 @@ CreateProcessForLaunch( DLLEXPORT HRESULT ResumeProcess( - __in HANDLE hResumeHandle) + _In_ HANDLE hResumeHandle) { PUBLIC_CONTRACT; if (ResumeThread(hResumeHandle) == (DWORD)-1) @@ -159,7 +159,7 @@ ResumeProcess( DLLEXPORT HRESULT CloseResumeHandle( - __in HANDLE hResumeHandle) + _In_ HANDLE hResumeHandle) { PUBLIC_CONTRACT; if (!CloseHandle(hResumeHandle)) @@ -190,7 +190,7 @@ HRESULT GetContinueStartupEvent( DWORD debuggeePID, LPCWSTR szTelestoFullPath, - __out HANDLE *phContinueStartupEvent); + _Out_ HANDLE *phContinueStartupEvent); #endif // TARGET_UNIX @@ -697,10 +697,10 @@ StartupHelperThread(LPVOID p) DLLEXPORT HRESULT RegisterForRuntimeStartup( - __in DWORD dwProcessId, - __in PSTARTUP_CALLBACK pfnCallback, - __in PVOID parameter, - __out PVOID *ppUnregisterToken) + _In_ DWORD dwProcessId, + _In_ PSTARTUP_CALLBACK pfnCallback, + _In_ PVOID parameter, + _Out_ PVOID *ppUnregisterToken) { return RegisterForRuntimeStartupEx(dwProcessId, NULL, pfnCallback, parameter, ppUnregisterToken); } @@ -738,11 +738,11 @@ RegisterForRuntimeStartup( DLLEXPORT HRESULT RegisterForRuntimeStartupEx( - __in DWORD dwProcessId, - __in LPCWSTR lpApplicationGroupId, - __in PSTARTUP_CALLBACK pfnCallback, - __in PVOID parameter, - __out PVOID *ppUnregisterToken) + _In_ DWORD dwProcessId, + _In_ LPCWSTR lpApplicationGroupId, + _In_ PSTARTUP_CALLBACK pfnCallback, + _In_ PVOID parameter, + _Out_ PVOID *ppUnregisterToken) { PUBLIC_CONTRACT; @@ -787,7 +787,7 @@ RegisterForRuntimeStartupEx( DLLEXPORT HRESULT UnregisterForRuntimeStartup( - __in PVOID pUnregisterToken) + _In_ PVOID pUnregisterToken) { PUBLIC_CONTRACT; @@ -824,8 +824,8 @@ const int cchEventNameBufferSize = (sizeof(StartupNotifyEventNamePrefix) + sizeo DLLEXPORT HRESULT GetStartupNotificationEvent( - __in DWORD debuggeePID, - __out HANDLE* phStartupEvent) + _In_ DWORD debuggeePID, + _Out_ HANDLE* phStartupEvent) { PUBLIC_CONTRACT; @@ -1220,9 +1220,9 @@ DLLEXPORT HRESULT EnumerateCLRs( DWORD debuggeePID, - __out HANDLE** ppHandleArrayOut, - __out LPWSTR** ppStringArrayOut, - __out DWORD* pdwArrayLengthOut) + _Out_ HANDLE** ppHandleArrayOut, + _Out_ LPWSTR** ppStringArrayOut, + _Out_ DWORD* pdwArrayLengthOut) { PUBLIC_CONTRACT; @@ -1357,9 +1357,9 @@ EnumerateCLRs( DLLEXPORT HRESULT CloseCLREnumeration( - __in HANDLE* pHandleArray, - __in LPWSTR* pStringArray, - __in DWORD dwArrayLength) + _In_ HANDLE* pHandleArray, + _In_ LPWSTR* pStringArray, + _In_ DWORD dwArrayLength) { PUBLIC_CONTRACT; @@ -1484,11 +1484,11 @@ const WCHAR *c_versionStrFormat = W("%08x;%08x;%p"); DLLEXPORT HRESULT CreateVersionStringFromModule( - __in DWORD pidDebuggee, - __in LPCWSTR szModuleName, - __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pBuffer, - __in DWORD cchBuffer, - __out DWORD* pdwLength) + _In_ DWORD pidDebuggee, + _In_ LPCWSTR szModuleName, + _Out_writes_to_opt_(cchBuffer, *pdwLength) LPWSTR pBuffer, + _In_ DWORD cchBuffer, + _Out_ DWORD* pdwLength) { PUBLIC_CONTRACT; @@ -1719,9 +1719,9 @@ CheckDbiAndRuntimeVersion( DLLEXPORT HRESULT CreateDebuggingInterfaceFromVersionEx( - __in int iDebuggerVersion, - __in LPCWSTR szDebuggeeVersion, - __out IUnknown ** ppCordb) + _In_ int iDebuggerVersion, + _In_ LPCWSTR szDebuggeeVersion, + _Out_ IUnknown ** ppCordb) { return CreateDebuggingInterfaceFromVersion2(iDebuggerVersion, szDebuggeeVersion, NULL, ppCordb); } @@ -1748,10 +1748,10 @@ CreateDebuggingInterfaceFromVersionEx( DLLEXPORT HRESULT CreateDebuggingInterfaceFromVersion2( - __in int iDebuggerVersion, - __in LPCWSTR szDebuggeeVersion, - __in LPCWSTR szApplicationGroupId, - __out IUnknown ** ppCordb) + _In_ int iDebuggerVersion, + _In_ LPCWSTR szDebuggeeVersion, + _In_ LPCWSTR szApplicationGroupId, + _Out_ IUnknown ** ppCordb) { PUBLIC_CONTRACT; @@ -1880,8 +1880,8 @@ CreateDebuggingInterfaceFromVersion2( DLLEXPORT HRESULT CreateDebuggingInterfaceFromVersion( - __in LPCWSTR szDebuggeeVersion, - __out IUnknown ** ppCordb + _In_ LPCWSTR szDebuggeeVersion, + _Out_ IUnknown ** ppCordb ) { PUBLIC_CONTRACT; @@ -1907,7 +1907,7 @@ HRESULT GetContinueStartupEvent( DWORD debuggeePID, LPCWSTR szTelestoFullPath, - __out HANDLE* phContinueStartupEvent) + _Out_ HANDLE* phContinueStartupEvent) { if ((phContinueStartupEvent == NULL) || (szTelestoFullPath == NULL)) return E_INVALIDARG; diff --git a/src/coreclr/dlls/dbgshim/dbgshim.h b/src/coreclr/dlls/dbgshim/dbgshim.h index 392cd7b9286a85..004fd2a38128f2 100644 --- a/src/coreclr/dlls/dbgshim/dbgshim.h +++ b/src/coreclr/dlls/dbgshim/dbgshim.h @@ -11,81 +11,81 @@ typedef VOID (*PSTARTUP_CALLBACK)(IUnknown *pCordb, PVOID parameter, HRESULT hr) EXTERN_C HRESULT CreateProcessForLaunch( - __in LPWSTR lpCommandLine, - __in BOOL bSuspendProcess, - __in LPVOID lpEnvironment, - __in LPCWSTR lpCurrentDirectory, - __out PDWORD pProcessId, - __out HANDLE *pResumeHandle); + _In_ LPWSTR lpCommandLine, + _In_ BOOL bSuspendProcess, + _In_ LPVOID lpEnvironment, + _In_ LPCWSTR lpCurrentDirectory, + _Out_ PDWORD pProcessId, + _Out_ HANDLE *pResumeHandle); EXTERN_C HRESULT ResumeProcess( - __in HANDLE hResumeHandle); + _In_ HANDLE hResumeHandle); EXTERN_C HRESULT CloseResumeHandle( - __in HANDLE hResumeHandle); + _In_ HANDLE hResumeHandle); EXTERN_C HRESULT RegisterForRuntimeStartup( - __in DWORD dwProcessId, - __in PSTARTUP_CALLBACK pfnCallback, - __in PVOID parameter, - __out PVOID *ppUnregisterToken); + _In_ DWORD dwProcessId, + _In_ PSTARTUP_CALLBACK pfnCallback, + _In_ PVOID parameter, + _Out_ PVOID *ppUnregisterToken); EXTERN_C HRESULT RegisterForRuntimeStartupEx( - __in DWORD dwProcessId, - __in LPCWSTR szApplicationGroupId, - __in PSTARTUP_CALLBACK pfnCallback, - __in PVOID parameter, - __out PVOID *ppUnregisterToken); + _In_ DWORD dwProcessId, + _In_ LPCWSTR szApplicationGroupId, + _In_ PSTARTUP_CALLBACK pfnCallback, + _In_ PVOID parameter, + _Out_ PVOID *ppUnregisterToken); EXTERN_C HRESULT UnregisterForRuntimeStartup( - __in PVOID pUnregisterToken); + _In_ PVOID pUnregisterToken); EXTERN_C HRESULT GetStartupNotificationEvent( - __in DWORD debuggeePID, - __out HANDLE* phStartupEvent); + _In_ DWORD debuggeePID, + _Out_ HANDLE* phStartupEvent); EXTERN_C HRESULT EnumerateCLRs(DWORD debuggeePID, - __out HANDLE** ppHandleArrayOut, - __out LPWSTR** ppStringArrayOut, - __out DWORD* pdwArrayLengthOut); + _Out_ HANDLE** ppHandleArrayOut, + _Out_ LPWSTR** ppStringArrayOut, + _Out_ DWORD* pdwArrayLengthOut); EXTERN_C HRESULT CloseCLREnumeration( - __in HANDLE* pHandleArray, - __in LPWSTR* pStringArray, - __in DWORD dwArrayLength); + _In_ HANDLE* pHandleArray, + _In_ LPWSTR* pStringArray, + _In_ DWORD dwArrayLength); EXTERN_C HRESULT CreateVersionStringFromModule( - __in DWORD pidDebuggee, - __in LPCWSTR szModuleName, - __out_ecount_part(cchBuffer, *pdwLength) LPWSTR pBuffer, - __in DWORD cchBuffer, - __out DWORD* pdwLength); + _In_ DWORD pidDebuggee, + _In_ LPCWSTR szModuleName, + _Out_writes_to_opt_(cchBuffer, *pdwLength) LPWSTR pBuffer, + _In_ DWORD cchBuffer, + _Out_ DWORD* pdwLength); EXTERN_C HRESULT CreateDebuggingInterfaceFromVersionEx( - __in int iDebuggerVersion, - __in LPCWSTR szDebuggeeVersion, - __out IUnknown ** ppCordb); + _In_ int iDebuggerVersion, + _In_ LPCWSTR szDebuggeeVersion, + _Out_ IUnknown ** ppCordb); EXTERN_C DLLEXPORT HRESULT CreateDebuggingInterfaceFromVersion2( - __in int iDebuggerVersion, - __in LPCWSTR szDebuggeeVersion, - __in LPCWSTR szApplicationGroupId, - __out IUnknown ** ppCordb); + _In_ int iDebuggerVersion, + _In_ LPCWSTR szDebuggeeVersion, + _In_ LPCWSTR szApplicationGroupId, + _Out_ IUnknown ** ppCordb); EXTERN_C HRESULT CreateDebuggingInterfaceFromVersion( - __in LPCWSTR szDebuggeeVersion, - __out IUnknown ** ppCordb); + _In_ LPCWSTR szDebuggeeVersion, + _Out_ IUnknown ** ppCordb); diff --git a/src/coreclr/dlls/mscordac/CMakeLists.txt b/src/coreclr/dlls/mscordac/CMakeLists.txt index 8d04b34e48aad7..25c2532358774b 100644 --- a/src/coreclr/dlls/mscordac/CMakeLists.txt +++ b/src/coreclr/dlls/mscordac/CMakeLists.txt @@ -47,7 +47,7 @@ else(CLR_CMAKE_HOST_WIN32) set(REDEFINES_FILE_SCRIPT ${CMAKE_SOURCE_DIR}/generateredefinesfile.sh) - if (CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64) + if (CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64 OR CLR_CMAKE_HOST_ARCH_LOONGARCH64) set(JUMP_INSTRUCTION b) else() set(JUMP_INSTRUCTION jmp) diff --git a/src/coreclr/dlls/mscoree/mscoree.cpp b/src/coreclr/dlls/mscoree/mscoree.cpp index 4e2d87906ad309..c985b88ab30c2e 100644 --- a/src/coreclr/dlls/mscoree/mscoree.cpp +++ b/src/coreclr/dlls/mscoree/mscoree.cpp @@ -218,7 +218,7 @@ STDAPI ReOpenMetaDataWithMemoryEx( static DWORD g_dwSystemDirectory = 0; static WCHAR * g_pSystemDirectory = NULL; -HRESULT GetInternalSystemDirectory(__out_ecount_part_opt(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength) +HRESULT GetInternalSystemDirectory(_Out_writes_to_opt_(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength) { CONTRACTL { NOTHROW; @@ -252,7 +252,7 @@ HRESULT GetInternalSystemDirectory(__out_ecount_part_opt(*pdwLength,*pdwLength) } -LPCWSTR GetInternalSystemDirectory(__out DWORD* pdwLength) +LPCWSTR GetInternalSystemDirectory(_Out_ DWORD* pdwLength) { LIMITED_METHOD_CONTRACT; diff --git a/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp b/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp index 6a0ba5a2499475..623f0087d400c0 100644 --- a/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp +++ b/src/coreclr/dlls/mscorpe/ceefilegenwriter.cpp @@ -487,7 +487,7 @@ HRESULT CeeFileGenWriter::generateImage(void **ppImage) return hr; } // HRESULT CeeFileGenWriter::generateImage() -HRESULT CeeFileGenWriter::setOutputFileName(__in LPWSTR fileName) +HRESULT CeeFileGenWriter::setOutputFileName(_In_ LPWSTR fileName) { if (m_outputFileName) delete[] m_outputFileName; @@ -498,7 +498,7 @@ HRESULT CeeFileGenWriter::setOutputFileName(__in LPWSTR fileName) return S_OK; } // HRESULT CeeFileGenWriter::setOutputFileName() -HRESULT CeeFileGenWriter::setResourceFileName(__in LPWSTR fileName) +HRESULT CeeFileGenWriter::setResourceFileName(_In_ LPWSTR fileName) { if (m_resourceFileName) delete[] m_resourceFileName; @@ -1294,7 +1294,7 @@ HRESULT CeeFileGenWriter::setVTableEntry(ULONG size, ULONG offset) return setVTableEntry64(size,(void*)(ULONG_PTR)offset); } // HRESULT CeeFileGenWriter::setVTableEntry() -HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, __in char *ptr, +HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, _In_ char *ptr, unsigned *offset) { *offset = section.computeOffset(ptr); @@ -1302,7 +1302,7 @@ HRESULT CeeFileGenWriter::computeSectionOffset(CeeSection §ion, __in char *p return S_OK; } // HRESULT CeeFileGenWriter::computeSectionOffset() -HRESULT CeeFileGenWriter::computeOffset(__in char *ptr, +HRESULT CeeFileGenWriter::computeOffset(_In_ char *ptr, CeeSection **pSection, unsigned *offset) { TESTANDRETURNPOINTER(pSection); diff --git a/src/coreclr/dlls/mscorpe/iceefilegen.cpp b/src/coreclr/dlls/mscorpe/iceefilegen.cpp index 6714d355d0bfc3..6c40d9699fce91 100644 --- a/src/coreclr/dlls/mscorpe/iceefilegen.cpp +++ b/src/coreclr/dlls/mscorpe/iceefilegen.cpp @@ -183,7 +183,7 @@ HRESULT ICeeFileGen::AddSectionReloc (HCEESECTION section, ULONG offset, HCEESEC } } -HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, __in LPWSTR outputFileName) +HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, _In_ LPWSTR outputFileName) { TESTANDRETURNPOINTER(ceeFile); TESTANDRETURNPOINTER(outputFileName); @@ -192,7 +192,7 @@ HRESULT ICeeFileGen::SetOutputFileName (HCEEFILE ceeFile, __in LPWSTR outputFile return(gen->setOutputFileName(outputFileName)); } -__success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFile, __out LPWSTR *outputFileName) +__success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFile, _Out_ LPWSTR *outputFileName) { TESTANDRETURNPOINTER(ceeFile); TESTANDRETURNPOINTER(outputFileName); @@ -204,7 +204,7 @@ __success(return == S_OK) HRESULT ICeeFileGen::GetOutputFileName (HCEEFILE ceeFi } -HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, __in LPWSTR resourceFileName) +HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, _In_ LPWSTR resourceFileName) { TESTANDRETURNPOINTER(ceeFile); TESTANDRETURNPOINTER(resourceFileName); @@ -214,7 +214,7 @@ HRESULT ICeeFileGen::SetResourceFileName (HCEEFILE ceeFile, __in LPWSTR resource } __success(return == S_OK) -HRESULT ICeeFileGen::GetResourceFileName (HCEEFILE ceeFile, __out LPWSTR *resourceFileName) +HRESULT ICeeFileGen::GetResourceFileName (HCEEFILE ceeFile, _Out_ LPWSTR *resourceFileName) { TESTANDRETURNPOINTER(ceeFile); TESTANDRETURNPOINTER(resourceFileName); @@ -277,7 +277,7 @@ HRESULT ICeeFileGen::GetMethodRVA(HCEEFILE ceeFile, ULONG codeOffset, ULONG *cod return S_OK; } -HRESULT ICeeFileGen::EmitString(HCEEFILE ceeFile, __in LPWSTR strValue, ULONG *strRef) +HRESULT ICeeFileGen::EmitString(HCEEFILE ceeFile, _In_ LPWSTR strValue, ULONG *strRef) { TESTANDRETURNPOINTER(ceeFile); @@ -429,7 +429,7 @@ HRESULT ICeeFileGen::SetStrongNameEntry(HCEEFILE ceeFile, ULONG size, ULONG offs return gen->setStrongNameEntry(size, offset); } -HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, __in char *ptr, +HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, _In_ char *ptr, unsigned *offset) { TESTANDRETURNPOINTER(section); @@ -443,7 +443,7 @@ HRESULT ICeeFileGen::ComputeSectionOffset(HCEESECTION section, __in char *ptr, __success(return == S_OK) HRESULT ICeeFileGen::ComputeSectionPointer(HCEESECTION section, ULONG offset, - __out char **ptr) + _Out_ char **ptr) { TESTANDRETURNPOINTER(section); @@ -454,7 +454,7 @@ HRESULT ICeeFileGen::ComputeSectionPointer(HCEESECTION section, ULONG offset, return S_OK; } -HRESULT ICeeFileGen::ComputeOffset(HCEEFILE ceeFile, __in char *ptr, +HRESULT ICeeFileGen::ComputeOffset(HCEEFILE ceeFile, _In_ char *ptr, HCEESECTION *pSection, unsigned *offset) { TESTANDRETURNPOINTER(pSection); diff --git a/src/coreclr/dlls/mscorpe/pewriter.cpp b/src/coreclr/dlls/mscorpe/pewriter.cpp index 9add4b56d13b80..b78b00c2853ffb 100644 --- a/src/coreclr/dlls/mscorpe/pewriter.cpp +++ b/src/coreclr/dlls/mscorpe/pewriter.cpp @@ -1829,7 +1829,7 @@ HRESULT PEWriter::fixup(CeeGenTokenMapper *pMapper) return(S_OK); // SUCCESS } -HRESULT PEWriter::Open(__in LPCWSTR fileName) +HRESULT PEWriter::Open(_In_ LPCWSTR fileName) { _ASSERTE(m_file == INVALID_HANDLE_VALUE); HRESULT hr = NOERROR; @@ -1913,7 +1913,7 @@ HRESULT PEWriter::Close() } /******************************************************************/ -HRESULT PEWriter::write(__in LPCWSTR fileName) { +HRESULT PEWriter::write(_In_ LPCWSTR fileName) { HRESULT hr; diff --git a/src/coreclr/dlls/mscorpe/pewriter.h b/src/coreclr/dlls/mscorpe/pewriter.h index 21817b1d5efc45..84ec61f9275eca 100644 --- a/src/coreclr/dlls/mscorpe/pewriter.h +++ b/src/coreclr/dlls/mscorpe/pewriter.h @@ -41,7 +41,7 @@ class PEWriter : public PESectionMan HRESULT link(); HRESULT fixup(CeeGenTokenMapper *pMapper); - HRESULT write(__in LPCWSTR fileName); + HRESULT write(_In_ LPCWSTR fileName); HRESULT write(void **ppImage); // calling these functions is optional @@ -174,7 +174,7 @@ class PEWriter : public PESectionMan HRESULT linkPlaceSections(entry * entries, unsigned iEntries); void setSectionIndex(IMAGE_SECTION_HEADER * h, unsigned sectionIndex); - HRESULT Open(__in LPCWSTR fileName); + HRESULT Open(_In_ LPCWSTR fileName); HRESULT Write(const void *data, int size); HRESULT Seek(int offset); HRESULT Pad(int align); @@ -257,8 +257,8 @@ class PESeedSection : public PEWriterSection { int getDirEntry() { _ASSERTE(!"PESeedSection"); return 0; } HRESULT directoryEntry(unsigned num) { _ASSERTE(!"PESeedSection"); return E_FAIL; } char * computePointer(unsigned offset) const { _ASSERTE(!"PESeedSection"); return NULL; } - BOOL containsPointer(__in char *ptr) const { _ASSERTE(!"PESeedSection"); return FALSE; } - unsigned computeOffset(__in char *ptr) const { _ASSERTE(!"PESeedSection"); return 0; } + BOOL containsPointer(_In_ char *ptr) const { _ASSERTE(!"PESeedSection"); return FALSE; } + unsigned computeOffset(_In_ char *ptr) const { _ASSERTE(!"PESeedSection"); return 0; } HRESULT cloneInstance(PESection *destination) { _ASSERTE(!"PESeedSection"); return E_FAIL; } // PEWriterSection diff --git a/src/coreclr/dlls/mscorrc/mscorrc.rc b/src/coreclr/dlls/mscorrc/mscorrc.rc index 2175566c10b610..0e78c99f38d5de 100644 --- a/src/coreclr/dlls/mscorrc/mscorrc.rc +++ b/src/coreclr/dlls/mscorrc/mscorrc.rc @@ -580,13 +580,13 @@ BEGIN IDS_ER_FRAMEWORK_VERSION "CoreCLR Version: " IDS_ER_UNHANDLEDEXCEPTION "Description: The process was terminated due to an unhandled exception." IDS_ER_UNHANDLEDEXCEPTIONMSG "Exception Info: " - IDS_ER_MANAGEDFAILFAST "Description: The application requested process termination through System.Environment.FailFast(string message)." + IDS_ER_MANAGEDFAILFAST "Description: The application requested process termination through System.Environment.FailFast." IDS_ER_MANAGEDFAILFASTMSG "Message: " IDS_ER_UNMANAGEDFAILFAST "Description: The process was terminated due to an internal error in the .NET Runtime " IDS_ER_STACK_OVERFLOW "Description: The process was terminated due to stack overflow." IDS_ER_STACK "Stack:" IDS_ER_WORDAT "at" - IDS_ER_UNMANAGEDFAILFASTMSG "at IP %1 (%2) with exit code %3." + IDS_ER_UNMANAGEDFAILFASTMSG "at IP 0x%x (0x%x) with exit code 0x%x." IDS_ER_UNHANDLEDEXCEPTIONINFO "exception code %1, exception address %2" IDS_ER_MESSAGE_TRUNCATE "The remainder of the message was truncated." IDS_ER_CODECONTRACT_FAILED "Description: The application encountered a bug. A managed code contract (precondition, postcondition, object invariant, or assert) failed." diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index ace66eac266709..5a2a9c2c2c20e6 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -2522,6 +2522,8 @@ size_t gc_heap::bgc_loh_size_increased = 0; size_t gc_heap::bgc_poh_size_increased = 0; +size_t gc_heap::background_soh_size_end_mark = 0; + size_t gc_heap::background_soh_alloc_count = 0; size_t gc_heap::background_uoh_alloc_count = 0; @@ -28892,6 +28894,14 @@ void gc_heap::plan_phase (int condemned_gen_number) { dprintf (2,( "**** Doing Compacting GC ****")); +#if defined(USE_REGIONS) && defined(BACKGROUND_GC) + if (should_update_end_mark_size()) + { + background_soh_size_end_mark += generation_end_seg_allocated (older_gen) - + r_older_gen_end_seg_allocated; + } +#endif //USE_REGIONS && BACKGROUND_GC + #ifndef USE_REGIONS if (should_expand) { @@ -29396,6 +29406,13 @@ void gc_heap::fix_generation_bounds (int condemned_gen_number, } } #endif //MULTIPLE_HEAPS + +#ifdef BACKGROUND_GC + if (should_update_end_mark_size()) + { + background_soh_size_end_mark = generation_size (max_generation); + } +#endif //BACKGROUND_GC #endif //!USE_REGIONS { @@ -29614,6 +29631,14 @@ void gc_heap::thread_final_regions (bool compact_p) generation_final_regions[gen_idx].tail = generation_tail_region (gen); } +#ifdef BACKGROUND_GC + heap_segment* max_gen_tail_region = 0; + if (should_update_end_mark_size()) + { + max_gen_tail_region = generation_final_regions[max_generation].tail; + } +#endif //BACKGROUND_GC + // Step 2: for each region in the condemned generations, we thread it onto its planned generation // in our generation_final_regions array. for (int gen_idx = condemned_gen_number; gen_idx >= 0; gen_idx--) @@ -29664,6 +29689,21 @@ void gc_heap::thread_final_regions (bool compact_p) } } +#ifdef BACKGROUND_GC + if (max_gen_tail_region) + { + max_gen_tail_region = heap_segment_next (max_gen_tail_region); + + while (max_gen_tail_region) + { + background_soh_size_end_mark += heap_segment_allocated (max_gen_tail_region) - + heap_segment_mem (max_gen_tail_region); + + max_gen_tail_region = heap_segment_next (max_gen_tail_region); + } + } +#endif //BACKGROUND_GC + // Step 4: if a generation doesn't have any regions, we need to get a new one for it; // otherwise we just set the head region as the start region for that generation. for (int gen_idx = 0; gen_idx <= max_generation; gen_idx++) @@ -29779,6 +29819,12 @@ heap_segment* gc_heap::allocate_new_region (gc_heap* hp, int gen_num, bool uoh_p heap_segment* res = make_heap_segment (start, (end - start), hp, gen_num); dprintf (REGIONS_LOG, ("got a new region %Ix %Ix->%Ix", (size_t)res, start, end)); + + if (res == nullptr) + { + global_region_allocator.delete_region (start); + } + return res; } @@ -32927,6 +32973,11 @@ void gc_heap::decommit_mark_array_by_seg (heap_segment* seg) } } +bool gc_heap::should_update_end_mark_size() +{ + return ((settings.condemned_generation == (max_generation - 1)) && (current_c_gc_state == c_gc_state_planning)); +} + void gc_heap::background_mark_phase () { verify_mark_array_cleared(); @@ -33001,6 +33052,7 @@ void gc_heap::background_mark_phase () bgc_begin_poh_size = total_poh_size; bgc_loh_size_increased = 0; bgc_poh_size_increased = 0; + background_soh_size_end_mark = 0; dprintf (GTC_LOG, ("BM: h%d: loh: %Id, soh: %Id, poh: %Id", heap_number, total_loh_size, total_soh_size, total_poh_size)); @@ -33481,6 +33533,8 @@ void gc_heap::background_mark_phase () heap_segment_background_allocated (seg) = heap_segment_allocated (seg); } + background_soh_size_end_mark += heap_segment_background_allocated (seg) - heap_segment_mem (seg); + dprintf (3333, ("h%d gen%d seg %Ix (%Ix) background allocated is %Ix", heap_number, i, (size_t)(seg), heap_segment_mem (seg), heap_segment_background_allocated (seg))); @@ -45097,11 +45151,11 @@ size_t GCHeap::GetTotalBytesInUse () for (int i = 0; i < gc_heap::n_heaps; i++) { GCHeap* Hp = gc_heap::g_heaps [i]->vm_heap; - tot_size += Hp->ApproxTotalBytesInUse (FALSE); + tot_size += Hp->ApproxTotalBytesInUse(); } return tot_size; #else - return ApproxTotalBytesInUse (); + return ApproxTotalBytesInUse(); #endif //MULTIPLE_HEAPS } @@ -45156,58 +45210,58 @@ size_t GCHeap::ApproxTotalBytesInUse(BOOL small_heap_only) size_t totsize = 0; enter_spin_lock (&pGenGCHeap->gc_lock); - // the complication with the following code is that background GC may - // remove the ephemeral segment while we are iterating - // if so, we retry a couple times and ultimately may report a slightly wrong result - for (int tries = 1; tries <= 3; tries++) + // For gen0 it's a bit complicated because we are currently allocating in it. We get the fragmentation first + // just so that we don't give a negative number for the resulting size. + generation* gen = pGenGCHeap->generation_of (0); + size_t gen0_frag = generation_free_list_space (gen) + generation_free_obj_space (gen); + uint8_t* current_alloc_allocated = pGenGCHeap->alloc_allocated; + heap_segment* current_eph_seg = pGenGCHeap->ephemeral_heap_segment; + size_t gen0_size = 0; +#ifdef USE_REGIONS + heap_segment* gen0_seg = generation_start_segment (gen); + while (gen0_seg) { - heap_segment* eph_seg = generation_allocation_segment (pGenGCHeap->generation_of (0)); - // Get small block heap size info - totsize = (pGenGCHeap->alloc_allocated - heap_segment_mem (eph_seg)); - heap_segment* seg1 = generation_start_segment (pGenGCHeap->generation_of (max_generation)); - while ((seg1 != eph_seg) && (seg1 != nullptr) -#ifdef BACKGROUND_GC - && (seg1 != pGenGCHeap->freeable_soh_segment) -#endif //BACKGROUND_GC - ) + uint8_t* end = in_range_for_segment (current_alloc_allocated, gen0_seg) ? + current_alloc_allocated : heap_segment_allocated (gen0_seg); + gen0_size += end - heap_segment_mem (gen0_seg); + + if (gen0_seg == current_eph_seg) { -#ifdef BACKGROUND_GC - if (!heap_segment_decommitted_p (seg1)) -#endif //BACKGROUND_GC - { - totsize += heap_segment_allocated (seg1) - - heap_segment_mem (seg1); - } - seg1 = heap_segment_next (seg1); - } - if (seg1 == eph_seg) break; + } + + gen0_seg = heap_segment_next (gen0_seg); } +#else //USE_REGIONS + // For segments ephemeral seg does not change. + gen0_size = current_alloc_allocated - heap_segment_mem (current_eph_seg); +#endif //USE_REGIONS - //discount the fragmentation - for (int i = 0; i <= max_generation; i++) + totsize = gen0_size - gen0_frag; + + int stop_gen_index = max_generation; + + if (gc_heap::current_c_gc_state == c_gc_state_planning) + { + // During BGC sweep since we can be deleting SOH segments, we avoid walking the segment + // list. + generation* oldest_gen = pGenGCHeap->generation_of (max_generation); + totsize = pGenGCHeap->background_soh_size_end_mark - generation_free_list_space (oldest_gen) - generation_free_obj_space (oldest_gen); + stop_gen_index--; + } + + for (int i = (max_generation - 1); i <= stop_gen_index; i++) { generation* gen = pGenGCHeap->generation_of (i); - totsize -= (generation_free_list_space (gen) + generation_free_obj_space (gen)); + totsize += pGenGCHeap->generation_size (i) - generation_free_list_space (gen) - generation_free_obj_space (gen); } if (!small_heap_only) { for (int i = uoh_start_generation; i < total_generation_count; i++) { - heap_segment* seg2 = generation_start_segment (pGenGCHeap->generation_of (i)); - - while (seg2 != 0) - { - totsize += heap_segment_allocated (seg2) - - heap_segment_mem (seg2); - seg2 = heap_segment_next (seg2); - } - - //discount the fragmentation - generation* uoh_gen = pGenGCHeap->generation_of (i); - size_t frag = generation_free_list_space (uoh_gen) + generation_free_obj_space (uoh_gen); - totsize -= frag; + generation* gen = pGenGCHeap->generation_of (i); + totsize += pGenGCHeap->generation_size (i) - generation_free_list_space (gen) - generation_free_obj_space (gen); } } leave_spin_lock (&pGenGCHeap->gc_lock); diff --git a/src/coreclr/gc/gcpriv.h b/src/coreclr/gc/gcpriv.h index 081b9a539c073c..14bf3ef2908895 100644 --- a/src/coreclr/gc/gcpriv.h +++ b/src/coreclr/gc/gcpriv.h @@ -51,8 +51,8 @@ inline void FATAL_GC_ERROR() // // This means any empty regions can be freely used for any generation. For // Server GC we will balance regions between heaps. -// For now enable regions by default for only StandAlone GC builds -#if defined (HOST_64BIT) && defined (BUILD_AS_STANDALONE) +// For now disable regions StandAlone GC builds +#if defined (HOST_64BIT) && !defined (BUILD_AS_STANDALONE) #define USE_REGIONS #endif //HOST_64BIT && BUILD_AS_STANDALONE @@ -3440,6 +3440,9 @@ class gc_heap PER_HEAP void decommit_mark_array_by_seg (heap_segment* seg); + PER_HEAP_ISOLATED + bool should_update_end_mark_size(); + PER_HEAP void background_mark_phase(); @@ -4268,6 +4271,9 @@ class gc_heap PER_HEAP size_t bgc_poh_size_increased; + PER_HEAP + size_t background_soh_size_end_mark; + PER_HEAP size_t background_soh_alloc_count; diff --git a/src/coreclr/gc/unix/gcenv.unix.cpp b/src/coreclr/gc/unix/gcenv.unix.cpp index 895d2afdf395a9..431421afc87e40 100644 --- a/src/coreclr/gc/unix/gcenv.unix.cpp +++ b/src/coreclr/gc/unix/gcenv.unix.cpp @@ -98,7 +98,7 @@ extern "C" # define __NR_membarrier 389 # elif defined(__aarch64__) # define __NR_membarrier 283 -# elif +# else # error Unknown architecture # endif # endif diff --git a/src/coreclr/hosts/corerun/dotenv.cpp b/src/coreclr/hosts/corerun/dotenv.cpp index ba22f5004713d0..0e0e37c7919b0a 100644 --- a/src/coreclr/hosts/corerun/dotenv.cpp +++ b/src/coreclr/hosts/corerun/dotenv.cpp @@ -4,10 +4,13 @@ #include "dotenv.hpp" #include #include -#include #include #include +#ifdef TARGET_WINDOWS +#include +#endif + namespace { pal::string_t convert_to_string_t(std::string str) diff --git a/src/coreclr/hosts/coreshim/CoreShim.cpp b/src/coreclr/hosts/coreshim/CoreShim.cpp index 62ab011df12155..23265e5872b3f6 100644 --- a/src/coreclr/hosts/coreshim/CoreShim.cpp +++ b/src/coreclr/hosts/coreshim/CoreShim.cpp @@ -375,7 +375,7 @@ HRESULT coreclr::Initialize( HMODULE mod = ::GetModuleHandleW(W("CoreRun.exe")); if (mod != NULL) { - using GetCurrentClrDetailsFunc = HRESULT(*)(void **clrInstance, unsigned int *appDomainId); + using GetCurrentClrDetailsFunc = HRESULT(__cdecl *)(void **clrInstance, unsigned int *appDomainId); auto getCurrentClrDetails = (GetCurrentClrDetailsFunc)::GetProcAddress(mod, "GetCurrentClrDetails"); RETURN_IF_FAILED(getCurrentClrDetails(&_clrInst, &_appDomainId)); if (_clrInst != nullptr) diff --git a/src/coreclr/ilasm/asmman.cpp b/src/coreclr/ilasm/asmman.cpp index 7b5fd474b65157..447267d0b4d252 100644 --- a/src/coreclr/ilasm/asmman.cpp +++ b/src/coreclr/ilasm/asmman.cpp @@ -49,7 +49,7 @@ BinStr* BinStrToUnicode(BinStr* pSource, bool Swap) return NULL; } -AsmManFile* AsmMan::GetFileByName(__in __nullterminated char* szFileName) +AsmManFile* AsmMan::GetFileByName(_In_ __nullterminated char* szFileName) { AsmManFile* ret = NULL; if(szFileName) @@ -63,14 +63,14 @@ AsmManFile* AsmMan::GetFileByName(__in __nullterminated char* szFileName return ret; } -mdToken AsmMan::GetFileTokByName(__in __nullterminated char* szFileName) +mdToken AsmMan::GetFileTokByName(_In_ __nullterminated char* szFileName) { AsmManFile* tmp = GetFileByName(szFileName); return(tmp ? tmp->tkTok : mdFileNil); } -AsmManComType* AsmMan::GetComTypeByName(__in_opt __nullterminated char* szComTypeName, - __in_opt __nullterminated char* szComEnclosingTypeName) +AsmManComType* AsmMan::GetComTypeByName(_In_opt_z_ char* szComTypeName, + _In_opt_z_ char* szComEnclosingTypeName) { AsmManComType* ret = NULL; if(szComTypeName) @@ -102,14 +102,14 @@ AsmManComType* AsmMan::GetComTypeByName(__in_opt __nullterminated char* } mdToken AsmMan::GetComTypeTokByName( - __in_opt __nullterminated char* szComTypeName, - __in_opt __nullterminated char* szComEnclosingTypeName) + _In_opt_z_ char* szComTypeName, + _In_opt_z_ char* szComEnclosingTypeName) { AsmManComType* tmp = GetComTypeByName(szComTypeName, szComEnclosingTypeName); return(tmp ? tmp->tkTok : mdExportedTypeNil); } -AsmManAssembly* AsmMan::GetAsmRefByName(__in __nullterminated const char* szAsmRefName) +AsmManAssembly* AsmMan::GetAsmRefByName(_In_ __nullterminated const char* szAsmRefName) { AsmManAssembly* ret = NULL; if(szAsmRefName) @@ -124,12 +124,12 @@ AsmManAssembly* AsmMan::GetAsmRefByName(__in __nullterminated const char* sz } return ret; } -mdToken AsmMan::GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName) +mdToken AsmMan::GetAsmRefTokByName(_In_ __nullterminated const char* szAsmRefName) { AsmManAssembly* tmp = GetAsmRefByName(szAsmRefName); return(tmp ? tmp->tkTok : mdAssemblyRefNil); } -AsmManAssembly* AsmMan::GetAsmRefByAsmName(__in __nullterminated const char* szAsmName) +AsmManAssembly* AsmMan::GetAsmRefByAsmName(_In_ __nullterminated const char* szAsmName) { AsmManAssembly* ret = NULL; if(szAsmName) @@ -160,7 +160,7 @@ void AsmMan::SetModuleName(__inout_opt __nullterminated char* szName) } //============================================================================================================== -void AsmMan::AddFile(__in __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob) +void AsmMan::AddFile(_In_ __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob) { AsmManFile* tmp = GetFileByName(szName); Assembler* pAsm = (Assembler*)m_pAssembler; @@ -244,7 +244,7 @@ void AsmMan::EmitFiles() } //end for(i = 0; tmp=m_FileLst.PEEK(i); i++) } -void AsmMan::StartAssembly(__in __nullterminated char* szName, __in_opt __nullterminated char* szAlias, DWORD dwAttr, BOOL isRef) +void AsmMan::StartAssembly(_In_ __nullterminated char* szName, _In_opt_z_ char* szAlias, DWORD dwAttr, BOOL isRef) { if(!isRef && (0==strcmp(szName, "mscorlib"))) ((Assembler*)m_pAssembler)->m_fIsMscorlib = TRUE; if(!isRef && (m_pAssembly != NULL)) @@ -674,7 +674,7 @@ void AsmMan::SetAssemblyAutodetect() } } -void AsmMan::StartComType(__in __nullterminated char* szName, DWORD dwAttr) +void AsmMan::StartComType(_In_ __nullterminated char* szName, DWORD dwAttr) { if((m_pCurComType = new AsmManComType)) { @@ -732,7 +732,7 @@ void AsmMan::EndComType() } } -void AsmMan::SetComTypeFile(__in __nullterminated char* szFileName) +void AsmMan::SetComTypeFile(_In_ __nullterminated char* szFileName) { if(m_pCurComType) { @@ -740,7 +740,7 @@ void AsmMan::SetComTypeFile(__in __nullterminated char* szFileName) } } -void AsmMan::SetComTypeAsmRef(__in __nullterminated char* szAsmRefName) +void AsmMan::SetComTypeAsmRef(_In_ __nullterminated char* szAsmRefName) { if(m_pCurComType) { @@ -748,7 +748,7 @@ void AsmMan::SetComTypeAsmRef(__in __nullterminated char* szAsmRefName) } } -void AsmMan::SetComTypeComType(__in __nullterminated char* szComTypeName) +void AsmMan::SetComTypeComType(_In_ __nullterminated char* szComTypeName) { if(m_pCurComType) { @@ -780,7 +780,7 @@ BOOL AsmMan::SetComTypeClassTok(mdToken tkClass) return FALSE; } -void AsmMan::StartManifestRes(__in __nullterminated char* szName, __in __nullterminated char* szAlias, DWORD dwAttr) +void AsmMan::StartManifestRes(_In_ __nullterminated char* szName, _In_ __nullterminated char* szAlias, DWORD dwAttr) { if((m_pCurManRes = new AsmManRes)) { @@ -808,7 +808,7 @@ void AsmMan::EndManifestRes() } -void AsmMan::SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset) +void AsmMan::SetManifestResFile(_In_ __nullterminated char* szFileName, ULONG ulOffset) { if(m_pCurManRes) { @@ -817,7 +817,7 @@ void AsmMan::SetManifestResFile(__in __nullterminated char* szFileName, ULONG } } -void AsmMan::SetManifestResAsmRef(__in __nullterminated char* szAsmRefName) +void AsmMan::SetManifestResAsmRef(_In_ __nullterminated char* szAsmRefName) { if(m_pCurManRes) { diff --git a/src/coreclr/ilasm/asmman.hpp b/src/coreclr/ilasm/asmman.hpp index 1290c9b2707c8a..972c8382434f8e 100644 --- a/src/coreclr/ilasm/asmman.hpp +++ b/src/coreclr/ilasm/asmman.hpp @@ -193,12 +193,12 @@ class AsmMan ErrorReporter* report; void* m_pAssembler; - AsmManFile* GetFileByName(__in __nullterminated char* szFileName); - AsmManAssembly* GetAsmRefByName(__in __nullterminated const char* szAsmRefName); - AsmManComType* GetComTypeByName(__in_opt __nullterminated char* szComTypeName, - __in_opt __nullterminated char* szComEnclosingTypeName = NULL); - mdToken GetComTypeTokByName(__in_opt __nullterminated char* szComTypeName, - __in_opt __nullterminated char* szComEnclosingTypeName = NULL); + AsmManFile* GetFileByName(_In_ __nullterminated char* szFileName); + AsmManAssembly* GetAsmRefByName(_In_ __nullterminated const char* szAsmRefName); + AsmManComType* GetComTypeByName(_In_opt_z_ char* szComTypeName, + _In_opt_z_ char* szComEnclosingTypeName = NULL); + mdToken GetComTypeTokByName(_In_opt_z_ char* szComTypeName, + _In_opt_z_ char* szComEnclosingTypeName = NULL); IMetaDataEmit* m_pEmitter; @@ -241,11 +241,11 @@ class AsmMan void SetModuleName(__inout_opt __nullterminated char* szName); - void AddFile(__in __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob); + void AddFile(_In_ __nullterminated char* szName, DWORD dwAttr, BinStr* pHashBlob); void EmitFiles(); void EmitDebuggableAttribute(mdToken tkOwner); - void StartAssembly(__in __nullterminated char* szName, __in_opt __nullterminated char* szAlias, DWORD dwAttr, BOOL isRef); + void StartAssembly(_In_ __nullterminated char* szName, _In_opt_z_ char* szAlias, DWORD dwAttr, BOOL isRef); void EndAssembly(); void EmitAssemblyRefs(); void EmitAssembly(); @@ -257,27 +257,27 @@ class AsmMan void SetAssemblyHashBlob(BinStr* pHashBlob); void SetAssemblyAutodetect(); - void StartComType(__in __nullterminated char* szName, DWORD dwAttr); + void StartComType(_In_ __nullterminated char* szName, DWORD dwAttr); void EndComType(); - void SetComTypeFile(__in __nullterminated char* szFileName); - void SetComTypeAsmRef(__in __nullterminated char* szAsmRefName); - void SetComTypeComType(__in __nullterminated char* szComTypeName); + void SetComTypeFile(_In_ __nullterminated char* szFileName); + void SetComTypeAsmRef(_In_ __nullterminated char* szAsmRefName); + void SetComTypeComType(_In_ __nullterminated char* szComTypeName); BOOL SetComTypeImplementationTok(mdToken tk); BOOL SetComTypeClassTok(mdToken tkClass); - void StartManifestRes(__in __nullterminated char* szName, __in __nullterminated char* szAlias, DWORD dwAttr); + void StartManifestRes(_In_ __nullterminated char* szName, _In_ __nullterminated char* szAlias, DWORD dwAttr); void EndManifestRes(); - void SetManifestResFile(__in __nullterminated char* szFileName, ULONG ulOffset); - void SetManifestResAsmRef(__in __nullterminated char* szAsmRefName); + void SetManifestResFile(_In_ __nullterminated char* szFileName, ULONG ulOffset); + void SetManifestResAsmRef(_In_ __nullterminated char* szAsmRefName); - AsmManAssembly* GetAsmRefByAsmName(__in __nullterminated const char* szAsmName); + AsmManAssembly* GetAsmRefByAsmName(_In_ __nullterminated const char* szAsmName); - mdToken GetFileTokByName(__in __nullterminated char* szFileName); - mdToken GetAsmRefTokByName(__in __nullterminated const char* szAsmRefName); - mdToken GetAsmTokByName(__in __nullterminated const char* szAsmName) + mdToken GetFileTokByName(_In_ __nullterminated char* szFileName); + mdToken GetAsmRefTokByName(_In_ __nullterminated const char* szAsmRefName); + mdToken GetAsmTokByName(_In_ __nullterminated const char* szAsmName) { return (m_pAssembly && (strcmp(m_pAssembly->szName,szAsmName)==0)) ? m_pAssembly->tkTok : 0; }; - mdToken GetModuleRefTokByName(__in __nullterminated char* szName) + mdToken GetModuleRefTokByName(_In_ __nullterminated char* szName) { if(szName && *szName) { diff --git a/src/coreclr/ilasm/asmparse.h b/src/coreclr/ilasm/asmparse.h index ef377b5e430d7c..e5479202730033 100644 --- a/src/coreclr/ilasm/asmparse.h +++ b/src/coreclr/ilasm/asmparse.h @@ -20,11 +20,11 @@ class ReadStream { virtual ~ReadStream() = default; - virtual unsigned getAll(__out char** ppch) = 0; + virtual unsigned getAll(_Out_ char** ppch) = 0; // read at most 'buffLen' bytes into 'buff', Return the // number of characters read. On EOF return 0 - virtual unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen) = 0; + virtual unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen) = 0; // Return the name of the stream, (for error reporting). //virtual const char* name() = 0; @@ -49,12 +49,12 @@ class BinStrStream : public ReadStream { //if(m_pBS) // delete m_pBS; }; - unsigned getAll(__out char **ppbuff) + unsigned getAll(_Out_ char **ppbuff) { *ppbuff = m_pStart; return m_pBS->length(); }; - unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen) + unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen) { _ASSERTE(m_pStart != NULL); unsigned Remainder = (unsigned)(m_pEnd - m_pCurr); @@ -95,7 +95,7 @@ class BinStrStream : public ReadStream { /**************************************************************************/ class MappedFileStream : public ReadStream { public: - MappedFileStream(__in __nullterminated WCHAR* wFileName) + MappedFileStream(_In_ __nullterminated WCHAR* wFileName) { fileNameW = wFileName; m_hFile = INVALID_HANDLE_VALUE; @@ -124,12 +124,12 @@ class MappedFileStream : public ReadStream { fileNameW = NULL; } } - unsigned getAll(__out char** pbuff) + unsigned getAll(_Out_ char** pbuff) { *pbuff = m_pStart; return m_FileSize; } - unsigned read(__out_ecount(buffLen) char* buff, unsigned buffLen) + unsigned read(_Out_writes_(buffLen) char* buff, unsigned buffLen) { _ASSERTE(m_pStart != NULL); unsigned Remainder = (unsigned)(m_pEnd - m_pCurr); @@ -214,29 +214,29 @@ typedef LIFO ARG_NAME_LIST_STACK; /*--------------------------------------------------------------------------*/ typedef char*(*PFN_NEXTCHAR)(char*); -char* nextcharU(__in __nullterminated char* pos); -char* nextcharW(__in __nullterminated char* pos); +char* nextcharU(_In_ __nullterminated char* pos); +char* nextcharW(_In_ __nullterminated char* pos); /*--------------------------------------------------------------------------*/ typedef unsigned(*PFN_SYM)(char*); -unsigned SymAU(__in __nullterminated char* curPos); -unsigned SymW(__in __nullterminated char* curPos); +unsigned SymAU(_In_ __nullterminated char* curPos); +unsigned SymW(_In_ __nullterminated char* curPos); /*--------------------------------------------------------------------------*/ typedef char*(*PFN_NEWSTRFROMTOKEN)(char*,size_t); -char* NewStrFromTokenAU(__in_ecount(tokLen) char* curTok, size_t tokLen); -char* NewStrFromTokenW(__in_ecount(tokLen) char* curTok, size_t tokLen); +char* NewStrFromTokenAU(_In_reads_(tokLen) char* curTok, size_t tokLen); +char* NewStrFromTokenW(_In_reads_(tokLen) char* curTok, size_t tokLen); /*--------------------------------------------------------------------------*/ typedef char*(*PFN_NEWSTATICSTRFROMTOKEN)(char*,size_t,char*,size_t); -char* NewStaticStrFromTokenAU(__in_ecount(tokLen) char* curTok, size_t tokLen, __out_ecount(bufSize) char* staticBuf, size_t bufSize); -char* NewStaticStrFromTokenW(__in_ecount(tokLen) char* curTok, size_t tokLen, __out_ecount(bufSize) char* staticBuf, size_t bufSize); +char* NewStaticStrFromTokenAU(_In_reads_(tokLen) char* curTok, size_t tokLen, _Out_writes_(bufSize) char* staticBuf, size_t bufSize); +char* NewStaticStrFromTokenW(_In_reads_(tokLen) char* curTok, size_t tokLen, _Out_writes_(bufSize) char* staticBuf, size_t bufSize); /*--------------------------------------------------------------------------*/ typedef unsigned(*PFN_GETDOUBLE)(char*,unsigned,double**); -unsigned GetDoubleAU(__in __nullterminated char* begNum, unsigned L, double** ppRes); -unsigned GetDoubleW(__in __nullterminated char* begNum, unsigned L, double** ppRes); +unsigned GetDoubleAU(_In_ __nullterminated char* begNum, unsigned L, double** ppRes); +unsigned GetDoubleW(_In_ __nullterminated char* begNum, unsigned L, double** ppRes); /*--------------------------------------------------------------------------*/ struct PARSING_ENVIRONMENT { @@ -284,9 +284,9 @@ class AsmParse : public ErrorReporter virtual void warn(const char* fmt, ...); virtual void msg(const char* fmt, ...); char *getLine(int lineNum) { return penv->in->getLine(lineNum); }; - unsigned getAll(__out char** pbuff) { return penv->in->getAll(pbuff); }; + unsigned getAll(_Out_ char** pbuff) { return penv->in->getAll(pbuff); }; bool Success() {return success; }; - void SetIncludePath(__in WCHAR* wz) { wzIncludePath = wz; }; + void SetIncludePath(_In_ WCHAR* wz) { wzIncludePath = wz; }; ARG_NAME_LIST_STACK m_ANSFirst; ARG_NAME_LIST_STACK m_ANSLast; @@ -298,20 +298,20 @@ class AsmParse : public ErrorReporter BinStr* MakeTypeClass(CorElementType kind, mdToken tk); BinStr* MakeTypeArray(CorElementType kind, BinStr* elemType, BinStr* bounds); - char* fillBuff(__in_opt __nullterminated char* curPos); // refill the input buffer + char* fillBuff(_In_opt_z_ char* curPos); // refill the input buffer HANDLE hstdout; HANDLE hstderr; private: - friend void yyerror(__in __nullterminated const char* str); + friend void yyerror(_In_ __nullterminated const char* str); friend int parse_literal(unsigned curSym, __inout __nullterminated char* &curPos, BOOL translate_escapes); friend int yyparse(); friend int yylex(); friend Instr* SetupInstr(unsigned short opcode); friend int findKeyword(const char* name, size_t nameLen, unsigned short* opcode); - friend TypeDefDescr* findTypedef(__in_ecount(nameLen) char* name, size_t nameLen); - friend char* skipBlanks(__in __nullterminated char*,unsigned*); - friend char* nextBlank(__in __nullterminated char*); + friend TypeDefDescr* findTypedef(_In_reads_(nameLen) char* name, size_t nameLen); + friend char* skipBlanks(_In_ __nullterminated char*,unsigned*); + friend char* nextBlank(_In_ __nullterminated char*); friend int ProcessEOF(); friend unsigned __int8* skipType(unsigned __int8* ptr, BOOL fFixupType); friend void FixupConstraints(); diff --git a/src/coreclr/ilasm/assem.cpp b/src/coreclr/ilasm/assem.cpp index e8044d16ab2b7f..e58b8e569d8d34 100644 --- a/src/coreclr/ilasm/assem.cpp +++ b/src/coreclr/ilasm/assem.cpp @@ -1039,7 +1039,7 @@ BOOL Assembler::EmitProp(PropDescriptor* pPD) return TRUE; } -Class *Assembler::FindCreateClass(__in __nullterminated const char *pszFQN) +Class *Assembler::FindCreateClass(_In_ __nullterminated const char *pszFQN) { Class *pSearch = NULL; @@ -1186,7 +1186,7 @@ BOOL Assembler::DoGlobalFixups() return TRUE; } -state_t Assembler::AddGlobalLabel(__in __nullterminated char *pszName, HCEESECTION section) +state_t Assembler::AddGlobalLabel(_In_ __nullterminated char *pszName, HCEESECTION section) { if (FindGlobalLabel(pszName) != NULL) { @@ -1213,7 +1213,7 @@ state_t Assembler::AddGlobalLabel(__in __nullterminated char *pszName, HCEESECTI return m_State; } -void Assembler::AddLabel(DWORD CurPC, __in __nullterminated char *pszName) +void Assembler::AddLabel(DWORD CurPC, _In_ __nullterminated char *pszName) { if (m_pCurMethod->FindLabel(pszName) != NULL) { @@ -1478,7 +1478,7 @@ acceptable. Do NOT use for cryptographic purposes. */ unsigned hash( - __in_ecount(length) const BYTE *k, /* the key */ + _In_reads_(length) const BYTE *k, /* the key */ unsigned length, /* the length of the key */ unsigned initval) /* the previous hash, or an arbitrary value */ { diff --git a/src/coreclr/ilasm/assembler.cpp b/src/coreclr/ilasm/assembler.cpp index 48f9487656f7cf..85183bfae7542b 100644 --- a/src/coreclr/ilasm/assembler.cpp +++ b/src/coreclr/ilasm/assembler.cpp @@ -15,7 +15,7 @@ #define FAIL_UNLESS(x, y) if (!(x)) { report->error y; return; } /**************************************************************************/ -void Assembler::StartNameSpace(__in __nullterminated char* name) +void Assembler::StartNameSpace(_In_ __nullterminated char* name) { m_NSstack.PUSH(m_szNamespace); m_szNamespace = name; @@ -91,7 +91,7 @@ void Assembler::ClearBoundList(void) m_TyParList = NULL; } /**************************************************************************/ -mdToken Assembler::ResolveClassRef(mdToken tkResScope, __in __nullterminated const char *pszFullClassName, Class** ppClass) +mdToken Assembler::ResolveClassRef(mdToken tkResScope, _In_ __nullterminated const char *pszFullClassName, Class** ppClass) { Class *pClass = NULL; mdToken tkRet = mdTokenNil; @@ -239,7 +239,7 @@ mdToken Assembler::ResolveTypeSpec(BinStr* typeSpec) } /**************************************************************************/ -mdToken Assembler::GetAsmRef(__in __nullterminated const char* szName) +mdToken Assembler::GetAsmRef(_In_ __nullterminated const char* szName) { mdToken tkResScope = 0; if(strcmp(szName,"*")==0) tkResScope = mdTokenNil; @@ -330,7 +330,7 @@ mdToken Assembler::GetInterfaceImpl(mdToken tsClass, mdToken tsInterface) } /**************************************************************************/ -mdToken Assembler::GetModRef(__in __nullterminated char* szName) +mdToken Assembler::GetModRef(_In_ __nullterminated char* szName) { mdToken tkResScope = 0; if(!strcmp(szName,m_szScopeName)) @@ -417,7 +417,7 @@ DWORD Assembler::CheckClassFlagsIfNested(Class* pEncloser, DWORD attr) /**************************************************************************/ -void Assembler::StartClass(__in __nullterminated char* name, DWORD attr, TyParList *typars) +void Assembler::StartClass(_In_ __nullterminated char* name, DWORD attr, TyParList *typars) { Class *pEnclosingClass = m_pCurClass; char *szFQN; @@ -607,7 +607,7 @@ void Assembler::SetPinvoke(BinStr* DllName, int Ordinal, BinStr* Alias, int Attr } /**************************************************************************/ -void Assembler::StartMethod(__in __nullterminated char* name, BinStr* sig, CorMethodAttr flags, BinStr* retMarshal, DWORD retAttr, TyParList *typars) +void Assembler::StartMethod(_In_ __nullterminated char* name, BinStr* sig, CorMethodAttr flags, BinStr* retMarshal, DWORD retAttr, TyParList *typars) { if (m_pCurMethod != NULL) { @@ -801,7 +801,7 @@ void Assembler::EndMethod() } /**************************************************************************/ /* rvaLabel is the optional label that indicates this field points at a particular RVA */ -void Assembler::AddField(__inout_z __inout char* name, BinStr* sig, CorFieldAttr flags, __in __nullterminated char* rvaLabel, BinStr* pVal, ULONG ulOffset) +void Assembler::AddField(__inout_z __inout char* name, BinStr* sig, CorFieldAttr flags, _In_ __nullterminated char* rvaLabel, BinStr* pVal, ULONG ulOffset) { FieldDescriptor* pFD; ULONG i,n; @@ -1030,7 +1030,7 @@ void Assembler::NewSEHDescriptor(void) //sets m_SEHD if(m_SEHD == NULL) report->error("Failed to allocate SEH descriptor\n"); } /**************************************************************************/ -void Assembler::SetTryLabels(__in __nullterminated char * szFrom, __in __nullterminated char *szTo) +void Assembler::SetTryLabels(_In_ __nullterminated char * szFrom, _In_ __nullterminated char *szTo) { if(!m_SEHD) return; Label *pLbl = m_pCurMethod->FindLabel(szFrom); @@ -1043,7 +1043,7 @@ void Assembler::SetTryLabels(__in __nullterminated char * szFrom, __in __nullter else report->error("Undefined 1st label in 'try