[lldb] Add log output for the support files we pass to the CppModuleConfiguration
authorRaphael Isemann <teemperor@gmail.com>
Thu, 10 Oct 2019 13:43:37 +0000 (13:43 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 10 Oct 2019 13:43:37 +0000 (13:43 +0000)
CppModuleConfiguration is the most likely point of failure when we have weird
setups where we fail to load a C++ module. With this logging it should be easier
to figure out why we can't find a valid configuration as the configuration only
depends on the list of file paths.

llvm-svn: 374350

lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp

index 31c85d20874593f8ca0889246ee5925cc55c4c90..da1ca785635c9d00abe3c06b41ca2ff69aef76b1 100644 (file)
@@ -444,6 +444,8 @@ static CppModuleConfiguration LogConfigError(const std::string &msg) {
 
 CppModuleConfiguration GetModuleConfig(lldb::LanguageType language,
                                        ExecutionContext &exe_ctx) {
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
+
   // Don't do anything if this is not a C++ module configuration.
   if (!SupportsCxxModuleImport(language))
     return LogConfigError("Language doesn't support C++ modules");
@@ -483,6 +485,15 @@ CppModuleConfiguration GetModuleConfig(lldb::LanguageType language,
       }
     }
   });
+
+  LLDB_LOG(log, "[C++ module config] Found {0} support files to analyze",
+           files.GetSize());
+  if (log && log->GetVerbose()) {
+    for (const FileSpec &f : files)
+      LLDB_LOGV(log, "[C++ module config] Analyzing support file: {0}",
+                f.GetPath());
+  }
+
   // Try to create a configuration from the files. If there is no valid
   // configuration possible with the files, this just returns an invalid
   // configuration.