Skip to content

Commit 2baf519

Browse files
authored
Filter non WinRT types out of the cache (#888)
* Populate winmd cache with only WinRT types * Update to latest WinMD library and filter incremental visualizer loads
1 parent 243f941 commit 2baf519

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

cppwinrt/cppwinrt.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\Microsoft.Windows.WinMD.1.0.210225.2\build\native\Microsoft.Windows.WinMD.props" Condition="Exists('..\packages\Microsoft.Windows.WinMD.1.0.210225.2\build\native\Microsoft.Windows.WinMD.props')" />
3+
<Import Project="..\packages\Microsoft.Windows.WinMD.1.0.210311.4\build\native\Microsoft.Windows.WinMD.props" Condition="Exists('..\packages\Microsoft.Windows.WinMD.1.0.210311.4\build\native\Microsoft.Windows.WinMD.props')" />
44
<ItemGroup Label="ProjectConfigurations">
55
<ProjectConfiguration Include="Debug|ARM">
66
<Configuration>Debug</Configuration>
@@ -356,6 +356,6 @@
356356
<PropertyGroup>
357357
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
358358
</PropertyGroup>
359-
<Error Condition="!Exists('..\packages\Microsoft.Windows.WinMD.1.0.210225.2\build\native\Microsoft.Windows.WinMD.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.WinMD.1.0.210225.2\build\native\Microsoft.Windows.WinMD.props'))" />
359+
<Error Condition="!Exists('..\packages\Microsoft.Windows.WinMD.1.0.210311.4\build\native\Microsoft.Windows.WinMD.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.WinMD.1.0.210311.4\build\native\Microsoft.Windows.WinMD.props'))" />
360360
</Target>
361361
</Project>

cppwinrt/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Where <spec> is one or more of:
260260
}
261261

262262
process_args(args);
263-
cache c{ get_files_to_cache() };
263+
cache c{ get_files_to_cache(), [](TypeDef const& type) { return type.Flags().WindowsRuntime(); } };
264264
remove_foundation_types(c);
265265
build_filters(c);
266266
settings.base = settings.base || (!settings.component && settings.projection_filter.empty());

cppwinrt/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Windows.WinMD" version="1.0.210225.2" targetFramework="native" />
3+
<package id="Microsoft.Windows.WinMD" version="1.0.210311.4" targetFramework="native" />
44
</packages>

natvis/cppwinrt_visualizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void LoadMetadata(DkmProcess* process, WCHAR const* processPath, std::string_vie
105105

106106
if (std::find(db_files.begin(), db_files.end(), path_string) == db_files.end())
107107
{
108-
db->add_database(path_string);
108+
db->add_database(path_string, [](TypeDef const& type) { return type.Flags().WindowsRuntime(); });
109109
db_files.push_back(path_string);
110110
}
111111
}
@@ -165,7 +165,7 @@ cppwinrt_visualizer::cppwinrt_visualizer()
165165
db_files.push_back(file.path().string());
166166
}
167167
}
168-
db.reset(new cache(db_files));
168+
db.reset(new cache(db_files, [](TypeDef const& type) { return type.Flags().WindowsRuntime(); }));
169169
}
170170
catch (...)
171171
{

natvis/cppwinrtvisualizer.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="packages\Microsoft.Windows.WinMD.1.0.210225.2\build\native\Microsoft.Windows.WinMD.props" Condition="Exists('packages\Microsoft.Windows.WinMD.1.0.210225.2\build\native\Microsoft.Windows.WinMD.props')" />
3+
<Import Project="packages\Microsoft.Windows.WinMD.1.0.210311.4\build\native\Microsoft.Windows.WinMD.props" Condition="Exists('packages\Microsoft.Windows.WinMD.1.0.210311.4\build\native\Microsoft.Windows.WinMD.props')" />
44
<ItemGroup Label="ProjectConfigurations">
55
<ProjectConfiguration Include="Debug|Win32">
66
<Configuration>Debug</Configuration>
@@ -261,6 +261,6 @@
261261
</PropertyGroup>
262262
<Error Condition="!Exists('packages\Microsoft.VSSDK.Debugger.VSDConfigTool.16.0.2012201-preview\build\Microsoft.VSSDK.Debugger.VSDConfigTool.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.VSSDK.Debugger.VSDConfigTool.16.0.2012201-preview\build\Microsoft.VSSDK.Debugger.VSDConfigTool.targets'))" />
263263
<Error Condition="!Exists('packages\Microsoft.VSSDK.Debugger.VSDebugEng.16.0.2012201-preview\Microsoft.VSSDK.Debugger.VSDebugEng.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.VSSDK.Debugger.VSDebugEng.16.0.2012201-preview\Microsoft.VSSDK.Debugger.VSDebugEng.targets'))" />
264-
<Error Condition="!Exists('packages\Microsoft.Windows.WinMD.1.0.210225.2\build\native\Microsoft.Windows.WinMD.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.WinMD.1.0.210225.2\build\native\Microsoft.Windows.WinMD.props'))" />
264+
<Error Condition="!Exists('packages\Microsoft.Windows.WinMD.1.0.210311.4\build\native\Microsoft.Windows.WinMD.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.WinMD.1.0.210311.4\build\native\Microsoft.Windows.WinMD.props'))" />
265265
</Target>
266266
</Project>

natvis/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<packages>
33
<package id="Microsoft.VSSDK.Debugger.VSDConfigTool" version="16.0.2012201-preview" developmentDependency="true" />
44
<package id="Microsoft.VSSDK.Debugger.VSDebugEng" version="16.0.2012201-preview" developmentDependency="true" />
5-
<package id="Microsoft.Windows.WinMD" version="1.0.210225.2" targetFramework="native" />
5+
<package id="Microsoft.Windows.WinMD" version="1.0.210311.4" targetFramework="native" />
66
</packages>

0 commit comments

Comments
 (0)