From f907a496aad4d005fca676c0d4779ab900687da3 Mon Sep 17 00:00:00 2001 From: Ryan Shepherd Date: Thu, 11 Mar 2021 15:42:03 -0800 Subject: [PATCH 1/2] Populate winmd cache with only WinRT types --- cppwinrt/cppwinrt.vcxproj | 4 ++-- cppwinrt/main.cpp | 2 +- cppwinrt/packages.config | 2 +- natvis/cppwinrt_visualizer.cpp | 3 ++- natvis/cppwinrtvisualizer.vcxproj | 4 ++-- natvis/packages.config | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cppwinrt/cppwinrt.vcxproj b/cppwinrt/cppwinrt.vcxproj index d63b2ce54..07a620ec6 100644 --- a/cppwinrt/cppwinrt.vcxproj +++ b/cppwinrt/cppwinrt.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -356,6 +356,6 @@ 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}. - + \ No newline at end of file diff --git a/cppwinrt/main.cpp b/cppwinrt/main.cpp index c0a2721cd..79880dfab 100644 --- a/cppwinrt/main.cpp +++ b/cppwinrt/main.cpp @@ -260,7 +260,7 @@ Where is one or more of: } process_args(args); - cache c{ get_files_to_cache() }; + cache c{ get_files_to_cache(), [](TypeDef const& type) { return type.Flags().WindowsRuntime(); } }; remove_foundation_types(c); build_filters(c); settings.base = settings.base || (!settings.component && settings.projection_filter.empty()); diff --git a/cppwinrt/packages.config b/cppwinrt/packages.config index ca579bc7e..f7b0182b5 100644 --- a/cppwinrt/packages.config +++ b/cppwinrt/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/natvis/cppwinrt_visualizer.cpp b/natvis/cppwinrt_visualizer.cpp index b5ddf6438..dd6754792 100644 --- a/natvis/cppwinrt_visualizer.cpp +++ b/natvis/cppwinrt_visualizer.cpp @@ -105,6 +105,7 @@ void LoadMetadata(DkmProcess* process, WCHAR const* processPath, std::string_vie if (std::find(db_files.begin(), db_files.end(), path_string) == db_files.end()) { + // TODO: filter database also db->add_database(path_string); db_files.push_back(path_string); } @@ -165,7 +166,7 @@ cppwinrt_visualizer::cppwinrt_visualizer() db_files.push_back(file.path().string()); } } - db.reset(new cache(db_files)); + db.reset(new cache(db_files, [](TypeDef const& type) { return type.Flags().WindowsRuntime(); })); } catch (...) { diff --git a/natvis/cppwinrtvisualizer.vcxproj b/natvis/cppwinrtvisualizer.vcxproj index 3662a89bc..a938c592a 100644 --- a/natvis/cppwinrtvisualizer.vcxproj +++ b/natvis/cppwinrtvisualizer.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -261,6 +261,6 @@ - + \ No newline at end of file diff --git a/natvis/packages.config b/natvis/packages.config index d3148d18d..b3f2632ce 100644 --- a/natvis/packages.config +++ b/natvis/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file From af26b8b03a70c757f551ec0a4122e0d4a6b6c03f Mon Sep 17 00:00:00 2001 From: Ryan Shepherd Date: Thu, 11 Mar 2021 17:05:19 -0800 Subject: [PATCH 2/2] Update to latest WinMD library and filter incremental visualizer loads --- cppwinrt/cppwinrt.vcxproj | 4 ++-- cppwinrt/packages.config | 2 +- natvis/cppwinrt_visualizer.cpp | 3 +-- natvis/cppwinrtvisualizer.vcxproj | 4 ++-- natvis/packages.config | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/cppwinrt/cppwinrt.vcxproj b/cppwinrt/cppwinrt.vcxproj index 07a620ec6..2ddeea321 100644 --- a/cppwinrt/cppwinrt.vcxproj +++ b/cppwinrt/cppwinrt.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -356,6 +356,6 @@ 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}. - + \ No newline at end of file diff --git a/cppwinrt/packages.config b/cppwinrt/packages.config index f7b0182b5..518e14678 100644 --- a/cppwinrt/packages.config +++ b/cppwinrt/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/natvis/cppwinrt_visualizer.cpp b/natvis/cppwinrt_visualizer.cpp index dd6754792..1e2539910 100644 --- a/natvis/cppwinrt_visualizer.cpp +++ b/natvis/cppwinrt_visualizer.cpp @@ -105,8 +105,7 @@ void LoadMetadata(DkmProcess* process, WCHAR const* processPath, std::string_vie if (std::find(db_files.begin(), db_files.end(), path_string) == db_files.end()) { - // TODO: filter database also - db->add_database(path_string); + db->add_database(path_string, [](TypeDef const& type) { return type.Flags().WindowsRuntime(); }); db_files.push_back(path_string); } } diff --git a/natvis/cppwinrtvisualizer.vcxproj b/natvis/cppwinrtvisualizer.vcxproj index a938c592a..ae9721002 100644 --- a/natvis/cppwinrtvisualizer.vcxproj +++ b/natvis/cppwinrtvisualizer.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -261,6 +261,6 @@ - + \ No newline at end of file diff --git a/natvis/packages.config b/natvis/packages.config index b3f2632ce..23e5fb359 100644 --- a/natvis/packages.config +++ b/natvis/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file