Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@

<PropertyGroup>
<DotNetHostBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', '$(OutputRID).$(HostConfiguration)', 'corehost'))</DotNetHostBinDir>
<DotNetCDacBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'mscordaccore_universal', '$(Configuration)', '$(NetCoreAppCurrent)', '$(OutputRID)', 'publish'))</DotNetCDacBinDir>
Copy link
Member

Choose a reason for hiding this comment

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

Nit: DotNetCDacBinDir -> DotNetCdacBinDir, _BuildCDacPack -> _BuildCdacPack

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks - I'll do that in a quick follow up.

</PropertyGroup>

<!--Feature switches -->
Expand Down
1 change: 1 addition & 0 deletions docs/project/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ terminology.
| BBT | Microsoft internal early version of C/C++ PGO. See https://www.microsoft.com/windows/cse/bit_projects.mspx. |
| BOTR | Book Of The Runtime. |
| BCL | Base Class Library. A set of `System.*` (and to a limited extent `Microsoft.*`) libraries that make up the lower layer of the .NET library stack. See CoreFX. |
| CDAC | CDAC Codename for [Data Contracts](https://github.com/dotnet/runtime/blob/main/docs/design/datacontracts/datacontracts_design.md) |
| CIL | Common Intermediate Language. Equivalent to IL, also equivalent to [MSIL](https://learn.microsoft.com/dotnet/standard/managed-execution-process#compiling-to-msil). |
| CLI | Command Line Interface, or Common Language Infastructure. |
| CLR | [Common Language Runtime](https://learn.microsoft.com/dotnet/standard/clr). |
Expand Down
21 changes: 13 additions & 8 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<!-- Respect the DotNetBuildTests product flag when building the product. -->
<DefaultLibrariesSubsets Condition="'$(DotNetBuildTests)' == 'true'">$(DefaultLibrariesSubsets)+libs.tests</DefaultLibrariesSubsets>

<DefaultToolsSubsets>tools.illink+tools.cdacreader</DefaultToolsSubsets>
<DefaultToolsSubsets>tools.illink+tools.cdac</DefaultToolsSubsets>

<DefaultHostSubsets>host.native+host.tools+host.pkg</DefaultHostSubsets>
<DefaultHostSubsets Condition="'$(DotNetBuildSourceOnly)' != 'true'">$(DefaultHostSubsets)+host.pretest+host.tests</DefaultHostSubsets>
Expand Down Expand Up @@ -227,10 +227,9 @@
<!-- Tools -->
<SubsetName Include="Tools" Description="Additional runtime tools projects. Equivalent to: $(DefaultToolsSubsets)" />
<SubsetName Include="Tools.ILLink" Description="The projects that produce illink and analyzer tools for trimming." />
<SubsetName Include="Tools.CdacReader" Description="The cDAC reader." />
<SubsetName Include="Tools.Cdac" Description="Diagnostic data contract reader and related projects." />
<SubsetName Include="Tools.ILLinkTests" OnDemand="true" Description="Unit tests for the tools.illink subset." />

<SubsetName Include="Tools.CdacReaderTests" OnDemand="true" Description="Units tests for the cDAC reader." />
<SubsetName Include="Tools.CdacTests" OnDemand="true" Description="Unit tests for the diagnostic data contract reader." />

<!-- Host -->
<SubsetName Include="Host" Description="The .NET hosts, packages, hosting libraries, and tests. Equivalent to: $(DefaultHostSubsets)" />
Expand Down Expand Up @@ -312,7 +311,7 @@
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrILToolsSubset=true</ClrRuntimeBuildSubsets>
</PropertyGroup>

<PropertyGroup Condition="$(_subset.Contains('+tools.cdacreader+'))">
<PropertyGroup Condition="$(_subset.Contains('+tools.cdac+'))">
<ClrRuntimeBuildSubsets>$(ClrRuntimeBuildSubsets);ClrCdacSubset=true</ClrRuntimeBuildSubsets>
</PropertyGroup>

Expand Down Expand Up @@ -471,12 +470,16 @@
Test="true" Category="clr" Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(NativeAotSupported)' == 'true'"/>
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+tools.cdacreader+'))">
<PropertyGroup Condition="$(_subset.Contains('+tools.cdac+'))">
<_CDacToolsBuilt Condition="'$(_CDacToolsBuilt)' != 'true'">true</_CDacToolsBuilt>
</PropertyGroup>

<ItemGroup Condition="$(_subset.Contains('+tools.cdac+'))">
<ProjectToBuild Include="$(SharedNativeRoot)managed\compile-native.proj" Category="tools" />
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+tools.cdacreadertests+'))">
<ProjectToBuild Include="$(SharedNativeRoot)managed\cdacreader\tests\Microsoft.Diagnostics.DataContractReader.Tests.csproj" Test="true" Category="tools"/>
<ItemGroup Condition="$(_subset.Contains('+tools.cdactests+'))">
<ProjectToBuild Include="$(SharedNativeRoot)managed\mscordaccore_universal\tests\Microsoft.Diagnostics.DataContractReader.Tests.csproj" Test="true" Category="tools"/>
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+tools.illink+'))">
Expand Down Expand Up @@ -636,6 +639,7 @@
<_BuildCoreCLRRuntimePack Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(CoreCLRSupported)' == 'true'">true</_BuildCoreCLRRuntimePack>
<_BuildMonoRuntimePack Condition="'$(RuntimeFlavor)' == 'Mono' and '$(MonoSupported)' == 'true'">true</_BuildMonoRuntimePack>
<_BuildHostPack Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'">true</_BuildHostPack>
<_BuildCDacPack Condition="'$(_CDacToolsBuilt)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR' and '$(TargetsMobile)' != 'true' and ('$(TargetOS)' == 'windows' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'linux')">true</_BuildCDacPack>
<_BuildBundle Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'">true</_BuildBundle>
</PropertyGroup>

Expand Down Expand Up @@ -668,6 +672,7 @@
</ItemGroup>
<ItemGroup>
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and '$(RuntimeFlavor)' != 'Mono' and '$(TargetsMobile)' != 'true' and '$(TargetsLinuxBionic)' != 'true'" Include="$(InstallerProjectRoot)\pkg\projects\nativeaot-packages.proj" Category="packs" />
<ProjectToBuild Condition="'$(_BuildCDacPack)' == 'true'" Include="$(InstallerProjectRoot)pkg\projects\cdac-packages.proj" Category="packs" />
</ItemGroup>
<ItemGroup>
<!--
Expand Down
2 changes: 1 addition & 1 deletion eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
</CoreCLRCrossTargetFiles>
</ItemGroup>
<ItemGroup Condition="'$(RuntimeFlavor)' == 'Mono'">
<RuntimeFiles Include="$(MonoArtifactsPath)\*.*" Exclude="$(MonoArtifactsPath)\*cdacreader*" />
<RuntimeFiles Include="$(MonoArtifactsPath)\*.*" Exclude="$(MonoArtifactsPath)\*mscordaccore_universal*" />
<RuntimeFiles>
<IsNative>true</IsNative>
</RuntimeFiles>
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/common/evaluate-default-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ jobs:
- src/coreclr/tools/ILVerification/*
- global.json

- subset: tools_cdacreader
- subset: tools_cdac
include:
- src/native/managed/cdacreader/*
- src/native/managed/mscordaccore_universal/*

- subset: installer
include:
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/runtime-diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extends:
platforms:
- windows_x64
jobParameters:
buildArgs: -s clr+libs+tools.cdacreader+host+packs -c $(_BuildConfig)
buildArgs: -s clr+libs+tools.cdac+host+packs -c $(_BuildConfig)
nameSuffix: AllSubsets_CoreCLR
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 360
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -695,15 +695,15 @@ extends:
jobParameters:
timeoutInMinutes: 120
nameSuffix: CLR_Tools_Tests
buildArgs: -s clr.aot+clr.iltools+libs.sfx+clr.toolstests+tools.cdacreader+tools.cdacreadertests -c $(_BuildConfig) -test
buildArgs: -s clr.aot+clr.iltools+libs.sfx+clr.toolstests+tools.cdac+tools.cdactests -c $(_BuildConfig) -test
enablePublishTestResults: true
testResultsFormat: 'xunit'
# We want to run AOT tests when illink changes because there's share code and tests from illink which are used by AOT
condition: >-
or(
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_cdacreader.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_cdac.containsChange'], true),
eq(variables['isRollingBuild'], true))
#
# Build CrossDacs
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/daccess/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_definitions(-DFEATURE_NO_HOST)

add_subdirectory(${CLR_SRC_NATIVE_DIR}/managed/cdacreader/cmake ${CLR_ARTIFACTS_OBJ_DIR}/cdacreader)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/managed/mscordaccore_universal/cmake ${CLR_ARTIFACTS_OBJ_DIR}/mscordaccore_universal)

include_directories(BEFORE ${VM_DIR})
include_directories(BEFORE ${VM_DIR}/${ARCH_SOURCES_DIR})
Expand Down Expand Up @@ -43,7 +43,7 @@ convert_to_absolute_path(DACCESS_SOURCES ${DACCESS_SOURCES})
add_library_clr(daccess ${DACCESS_SOURCES})
set_target_properties(daccess PROPERTIES DAC_COMPONENT TRUE)
target_precompile_headers(daccess PRIVATE [["stdafx.h"]])
target_link_libraries(daccess PRIVATE cdacreader_api)
target_link_libraries(daccess PRIVATE cdac_api)

add_dependencies(daccess eventing_headers)

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/daccess/cdac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
#include "dbgutil.h"
#include <cdac_reader.h>

#define CDAC_LIB_NAME MAKEDLLNAME_W(W("cdacreader"))
#define CDAC_LIB_NAME MAKEDLLNAME_W(W("cdac"))

namespace
{
bool TryLoadCDACLibrary(HMODULE *phCDAC)
{
// Load cdacreader from next to current module (DAC binary)
// Load cdac from next to current module (DAC binary)
PathString path;
if (WszGetModuleFileName((HMODULE)GetCurrentModuleBase(), path) == 0)
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/daccess/dacimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ class ClrDataAccess
ULONG32 m_instanceAge;
bool m_debugMode;

// This currently exists on the DAC as a way of managing lifetime of loading/freeing the cdacreader
// This currently exists on the DAC as a way of managing lifetime of loading/freeing the cdac
// TODO: [cdac] Remove when cDAC deploys with SOS - https://github.com/dotnet/runtime/issues/108720
CDAC m_cdac;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageDescription>Transport package for the cdac reader to be used with diagnostics tooling</PackageDescription>
<IsShipping>false</IsShipping>
</PropertyGroup>

<ItemGroup>
<File Include="$(DotNetCDacBinDir)$(LibPrefix)mscordaccore_universal$(LibSuffix)">
<TargetPath>runtimes/$(PackageTargetRuntime)/native</TargetPath>
<IsNative>true</IsNative>
</File>
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions src/installer/pkg/projects/cdac-packages.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<Import Sdk="Microsoft.Build.Traversal" Project="Sdk.props" />

<ItemGroup>
<ProjectReference Include="Microsoft.DotNet.CDAC.Transport\Microsoft.DotNet.CDAC.Transport.pkgproj"
AdditionalProperties="PackageTargetRuntime=$(OutputRID)" />
</ItemGroup>

<Import Sdk="Microsoft.Build.Traversal" Project="Sdk.targets" />

<!-- Ordering matters! Overwriting the Pack target which should just invoke Build. -->
<Target Name="Pack" DependsOnTargets="Build" />
</Project>
2 changes: 0 additions & 2 deletions src/native/managed/cdacreader/cmake/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/native/managed/compile-native.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<!-- add new projects here -->
<!-- NativeLibsProjectsToBuild Include="$(MSBuildThisFileDirectory)libhellomanaged/src/libhellomanaged.csproj" -->
<NativeLibsProjectsToBuild Include="$(MSBuildThisFileDirectory)cdacreader/src/cdacreader.csproj" />
<NativeLibsProjectsToBuild Include="$(MSBuildThisFileDirectory)mscordaccore_universal/src/mscordaccore_universal.csproj" />
</ItemGroup>

<!-- Decide if we're going to do the NativeAOT builds -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.Diagnostics.DataContractReader;
/// </summary>
/// <remarks>
/// This class provides APIs used by contracts for reading from the target and getting type and globals
/// information. Like the contracts themselves in cdacreader, these are throwing APIs. Any callers at the boundaries
/// information. Like the contracts themselves in the cdac, these are throwing APIs. Any callers at the boundaries
/// (for example, unmanaged entry points, COM) should handle any exceptions.
/// </remarks>
public abstract class Target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ internal bool ValidateMethodDescPointer(TargetPointer methodDescPointer, [NotNul
// TODO(cdac): maybe don't swallow all exceptions? We could consider a richer contract that
// helps to track down what sort of memory corruption caused the validation to fail.
// TODO(cdac): we could also consider a more fine-grained exception type so we don't mask
// programmer mistakes in cdacreader.
// programmer mistakes in the cdac.
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private bool ValidateMethodTablePointer(NonValidatedMethodTable umt)
// TODO(cdac): maybe don't swallow all exceptions? We could consider a richer contract that
// helps to track down what sort of memory corruption caused the validation to fail.
// TODO(cdac): we could also consider a more fine-grained exception type so we don't mask
// programmer mistakes in cdacreader.
// programmer mistakes in the cdac.
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Microsoft.Diagnostics.DataContractReader;
/// </summary>
/// <remarks>
/// This class provides APIs used by contracts for reading from the target and getting type and globals
/// information based on the target's contract descriptor. Like the contracts themselves in cdacreader,
/// information based on the target's contract descriptor. Like the contracts themselves in the cdac,
/// these are throwing APIs. Any callers at the boundaries (for example, unmanaged entry points, COM)
/// should handle any exceptions.
/// </remarks>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_library(cdac_api INTERFACE)
target_include_directories(cdac_api INTERFACE ${CLR_SRC_NATIVE_DIR}/managed/mscordaccore_universal/inc)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName Condition="'$(TargetsWindows)' != 'true'">lib$(MSBuildProjectName)</AssemblyName>
<AssemblyName>$(LibPrefix)$(MSBuildProjectName)</AssemblyName>
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
<RootNamespace>Microsoft.Diagnostics.DataContractReader</RootNamespace>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Import Project="..\..\subproject.props" />

<ItemGroup>
<ProjectReference Include="..\src\cdacreader.csproj" AdditionalProperties="$(SplitSubprojectProps)" />
<ProjectReference Include="..\src\mscordaccore_universal.csproj" AdditionalProperties="$(SplitSubprojectProps)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
Expand Down
6 changes: 3 additions & 3 deletions src/tools/StressLogAnalyzer/StressLogAnalyzer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StressLogAnalyzer", "src\St
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D67D7F2A-1459-4A22-99B2-6B1F56EF4D79}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Diagnostics.DataContractReader", "..\..\native\managed\cdacreader\Microsoft.Diagnostics.DataContractReader\Microsoft.Diagnostics.DataContractReader.csproj", "{D44FD88F-1E43-4F53-9D2C-F0F3925BBE69}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Diagnostics.DataContractReader", "..\..\native\managed\mscordaccore_universal\Microsoft.Diagnostics.DataContractReader\Microsoft.Diagnostics.DataContractReader.csproj", "{D44FD88F-1E43-4F53-9D2C-F0F3925BBE69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Diagnostics.DataContractReader.Abstractions", "..\..\native\managed\cdacreader\Microsoft.Diagnostics.DataContractReader.Abstractions\Microsoft.Diagnostics.DataContractReader.Abstractions.csproj", "{67C3CA4E-BBB0-4C0A-A06F-1C32B458F1BC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Diagnostics.DataContractReader.Abstractions", "..\..\native\managed\mscordaccore_universal\Microsoft.Diagnostics.DataContractReader.Abstractions\Microsoft.Diagnostics.DataContractReader.Abstractions.csproj", "{67C3CA4E-BBB0-4C0A-A06F-1C32B458F1BC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Diagnostics.DataContractReader.Contracts", "..\..\native\managed\cdacreader\Microsoft.Diagnostics.DataContractReader.Contracts\Microsoft.Diagnostics.DataContractReader.Contracts.csproj", "{EC665835-E05A-439E-8607-D0DFA1E7A18F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Diagnostics.DataContractReader.Contracts", "..\..\native\managed\mscordaccore_universal\Microsoft.Diagnostics.DataContractReader.Contracts\Microsoft.Diagnostics.DataContractReader.Contracts.csproj", "{EC665835-E05A-439E-8607-D0DFA1E7A18F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions src/tools/StressLogAnalyzer/src/StressLogAnalyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)/src/native/managed/cdacreader/Microsoft.Diagnostics.DataContractReader/Microsoft.Diagnostics.DataContractReader.csproj" />
<ProjectReference Include="$(RepoRoot)/src/native/managed/cdacreader/Microsoft.Diagnostics.DataContractReader.Contracts/Microsoft.Diagnostics.DataContractReader.Contracts.csproj" />
<ProjectReference Include="$(RepoRoot)/src/native/managed/mscordaccore_universal/Microsoft.Diagnostics.DataContractReader/Microsoft.Diagnostics.DataContractReader.csproj" />
<ProjectReference Include="$(RepoRoot)/src/native/managed/mscordaccore_universal/Microsoft.Diagnostics.DataContractReader.Contracts/Microsoft.Diagnostics.DataContractReader.Contracts.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading