Skip to content

Commit ccd54a1

Browse files
committed
[lldb] Add log output for the support files we pass to the CppModuleConfiguration
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
1 parent 48edae3 commit ccd54a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ static CppModuleConfiguration LogConfigError(const std::string &msg) {
444444

445445
CppModuleConfiguration GetModuleConfig(lldb::LanguageType language,
446446
ExecutionContext &exe_ctx) {
447+
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
448+
447449
// Don't do anything if this is not a C++ module configuration.
448450
if (!SupportsCxxModuleImport(language))
449451
return LogConfigError("Language doesn't support C++ modules");
@@ -483,6 +485,15 @@ CppModuleConfiguration GetModuleConfig(lldb::LanguageType language,
483485
}
484486
}
485487
});
488+
489+
LLDB_LOG(log, "[C++ module config] Found {0} support files to analyze",
490+
files.GetSize());
491+
if (log && log->GetVerbose()) {
492+
for (const FileSpec &f : files)
493+
LLDB_LOGV(log, "[C++ module config] Analyzing support file: {0}",
494+
f.GetPath());
495+
}
496+
486497
// Try to create a configuration from the files. If there is no valid
487498
// configuration possible with the files, this just returns an invalid
488499
// configuration.

0 commit comments

Comments
 (0)