Skip to content

Commit

Permalink
[lldb][Progress] Report progress when parsing forward declarations fr…
Browse files Browse the repository at this point in the history
…om DWARF (llvm#91452)

This is an attempt at displaying the work that's being done by LLDB when waiting on type-completion events, e.g., when running an expression. This patch adds a single new progress event for cases where we search for the definition DIE of a forward declaration, which can be an expensive operation in the presence of many object files.

(cherry picked from commit d32afb3)
  • Loading branch information
Michael137 committed Jun 15, 2024
1 parent 2dd7b65 commit afcb805
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
#include "Plugins/Language/ObjC/ObjCLanguage.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Progress.h"
#include "lldb/Core/Value.h"
#include "lldb/Host/Host.h"
#include "lldb/Symbol/CompileUnit.h"
Expand Down Expand Up @@ -1773,6 +1774,11 @@ DWARFASTParserClang::ParseStructureLikeDIE(const SymbolContext &sc,
}

if (attrs.is_forward_declaration) {
Progress progress(llvm::formatv(
"Parsing type in {0}: '{1}'",
dwarf->GetObjectFile()->GetFileSpec().GetFilename().GetString(),
attrs.name.GetString()));

// We have a forward declaration to a type and we need to try and
// find a full declaration. We look in the current type index just in
// case we have a forward declaration followed by an actual
Expand Down

0 comments on commit afcb805

Please sign in to comment.