Skip to content

Commit 99d505d

Browse files
committed
[lldb][DWARFASTParserClang] Report progress when parsing types from DWARF
1 parent 18303da commit 99d505d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
479479
return nullptr;
480480
}
481481

482+
UpdateParsingProgress(attrs.name.AsCString("(anonymous)"));
483+
482484
if (type_is_new_ptr)
483485
*type_is_new_ptr = true;
484486

@@ -3952,3 +3954,20 @@ void DWARFASTParserClang::ParseRustVariantPart(
39523954

39533955
layout_info.field_offsets.insert({inner_field, 0});
39543956
}
3957+
3958+
void DWARFASTParserClang::UpdateParsingProgress(std::string message) {
3959+
if (!m_parsing_progress_up) {
3960+
SymbolFile *dwarf = m_ast.GetSymbolFile();
3961+
if (!dwarf)
3962+
return;
3963+
3964+
auto *obj = dwarf->GetObjectFile();
3965+
if (!obj)
3966+
return;
3967+
3968+
m_parsing_progress_up = std::make_unique<Progress>(
3969+
"Parsing DWARF in " + obj->GetFileSpec().GetFilename().GetString());
3970+
}
3971+
3972+
m_parsing_progress_up->Increment(1, std::move(message));
3973+
}

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include "Plugins/ExpressionParser/Clang/ClangASTImporter.h"
2626
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
27+
#include "lldb/Core/Progress.h"
2728

2829
#include <optional>
2930
#include <vector>
@@ -135,6 +136,7 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {
135136
DeclContextToDIEMap m_decl_ctx_to_die;
136137
DIEToModuleMap m_die_to_module;
137138
std::unique_ptr<lldb_private::ClangASTImporter> m_clang_ast_importer_up;
139+
std::unique_ptr<lldb_private::Progress> m_parsing_progress_up;
138140
/// @}
139141

140142
clang::DeclContext *
@@ -414,6 +416,8 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {
414416
lldb_private::CompilerType &class_clang_type,
415417
const lldb::AccessType default_accesibility,
416418
lldb_private::ClangASTImporter::LayoutInfo &layout_info);
419+
420+
void UpdateParsingProgress(std::string message);
417421
};
418422

419423
/// Parsed form of all attributes that are relevant for type reconstruction.

0 commit comments

Comments
 (0)