mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[lldb] Capture error messages from parseASTSection to log from the caller.
This helps fix a lldb console output mixup between the lldb logging and the llvm::dbgs() messages from parseASTSection.
This commit is contained in:
@@ -364,14 +364,20 @@ int main(int argc, char **argv) {
|
||||
ClangImporter->setDWARFImporterDelegate(dummyDWARFImporter);
|
||||
}
|
||||
|
||||
llvm::SmallString<0> error;
|
||||
llvm::raw_svector_ostream errs(error);
|
||||
llvm::Triple filter(Filter);
|
||||
for (auto &Module : Modules)
|
||||
if (!parseASTSection(*CI.getMemoryBufferSerializedModuleLoader(),
|
||||
StringRef(Module.first, Module.second), filter,
|
||||
modules)) {
|
||||
llvm::errs() << "error: Failed to parse AST section!\n";
|
||||
for (auto &Module : Modules) {
|
||||
auto Result = parseASTSection(
|
||||
*CI.getMemoryBufferSerializedModuleLoader(),
|
||||
StringRef(Module.first, Module.second), filter);
|
||||
if (auto E = Result.takeError()) {
|
||||
std::string error = toString(std::move(E));
|
||||
llvm::errs() << "error: Failed to parse AST section! " << error << "\n";
|
||||
return 1;
|
||||
}
|
||||
modules.insert(modules.end(), Result->begin(), Result->end());
|
||||
}
|
||||
|
||||
// Attempt to import all modules we found.
|
||||
for (auto path : modules) {
|
||||
|
||||
Reference in New Issue
Block a user