[Lldb-commits] [lldb] [LLDB][NFC] Create a namespace for the DWARF plugin (PR #68150)
Walter Erquinigo via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 3 13:04:50 PDT 2023
https://github.com/walter-erquinigo updated https://github.com/llvm/llvm-project/pull/68150
>From 98c009c5f33b81d579fd11d11a660026f33836ae Mon Sep 17 00:00:00 2001
From: walter erquinigo <walter at modular.com>
Date: Mon, 2 Oct 2023 16:56:16 -0400
Subject: [PATCH] [LLDB][NFC] Create a namespace for the DWARF plugin
As a followup of https://github.com/llvm/llvm-project/pull/67851, I'm defining a new namespace `lldb_plugin::dwarf` for the classes in this Plugins/SymbolFile/DWARF folder. This change is very NFC and helped me with exporting the necessary symbols for my out-of-tree language plugin. The only two classes that I didn't change are DWARFDataExtractor, because that's being explicitly exported as part of lldb_private in `lldb-forward.h` , and the ClangDWARFASTParser, because that shouldn't be in the same namespace as the generic language-agnostic dwarf parser, but I'm okay with changing that. In any case, even if I didn't need this for my work, adding this namespace could be considered a good practice.
---
.../include/lldb/Expression/DWARFExpression.h | 24 ++-
.../lldb/Expression/DWARFExpressionList.h | 9 +-
lldb/include/lldb/Symbol/TypeSystem.h | 8 +-
lldb/source/Expression/DWARFExpression.cpp | 1 +
.../SymbolFile/DWARF/AppleDWARFIndex.cpp | 1 +
.../SymbolFile/DWARF/AppleDWARFIndex.h | 35 ++--
.../Plugins/SymbolFile/DWARF/DIERef.cpp | 1 +
lldb/source/Plugins/SymbolFile/DWARF/DIERef.h | 7 +-
.../SymbolFile/DWARF/DWARFASTParser.cpp | 1 +
.../Plugins/SymbolFile/DWARF/DWARFASTParser.h | 5 +-
.../SymbolFile/DWARF/DWARFASTParserClang.cpp | 2 +
.../SymbolFile/DWARF/DWARFASTParserClang.h | 158 ++++++++++--------
.../SymbolFile/DWARF/DWARFAttribute.cpp | 1 +
.../Plugins/SymbolFile/DWARF/DWARFAttribute.h | 3 +
.../Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp | 5 +-
.../Plugins/SymbolFile/DWARF/DWARFBaseDIE.h | 2 +
.../SymbolFile/DWARF/DWARFCompileUnit.cpp | 1 +
.../SymbolFile/DWARF/DWARFCompileUnit.h | 4 +-
.../Plugins/SymbolFile/DWARF/DWARFContext.cpp | 1 +
.../Plugins/SymbolFile/DWARF/DWARFContext.h | 48 +++---
.../Plugins/SymbolFile/DWARF/DWARFDIE.cpp | 1 +
.../Plugins/SymbolFile/DWARF/DWARFDIE.h | 2 +
.../SymbolFile/DWARF/DWARFDataExtractor.h | 2 +-
.../SymbolFile/DWARF/DWARFDebugArangeSet.cpp | 1 +
.../SymbolFile/DWARF/DWARFDebugArangeSet.h | 2 +
.../SymbolFile/DWARF/DWARFDebugAranges.cpp | 1 +
.../SymbolFile/DWARF/DWARFDebugAranges.h | 2 +
.../SymbolFile/DWARF/DWARFDebugInfo.cpp | 4 +-
.../Plugins/SymbolFile/DWARF/DWARFDebugInfo.h | 12 +-
.../SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 1 +
.../SymbolFile/DWARF/DWARFDebugInfoEntry.h | 2 +
.../SymbolFile/DWARF/DWARFDebugMacro.cpp | 1 +
.../SymbolFile/DWARF/DWARFDebugMacro.h | 6 +-
.../SymbolFile/DWARF/DWARFDebugRanges.cpp | 1 +
.../SymbolFile/DWARF/DWARFDebugRanges.h | 6 +-
.../SymbolFile/DWARF/DWARFDeclContext.cpp | 1 +
.../SymbolFile/DWARF/DWARFDeclContext.h | 2 +
.../Plugins/SymbolFile/DWARF/DWARFDefines.cpp | 4 +-
.../Plugins/SymbolFile/DWARF/DWARFDefines.h | 4 +-
.../SymbolFile/DWARF/DWARFFormValue.cpp | 1 +
.../Plugins/SymbolFile/DWARF/DWARFFormValue.h | 4 +-
.../Plugins/SymbolFile/DWARF/DWARFIndex.cpp | 1 +
.../Plugins/SymbolFile/DWARF/DWARFIndex.h | 43 ++---
.../SymbolFile/DWARF/DWARFTypeUnit.cpp | 1 +
.../Plugins/SymbolFile/DWARF/DWARFTypeUnit.h | 4 +-
.../Plugins/SymbolFile/DWARF/DWARFUnit.cpp | 21 ++-
.../Plugins/SymbolFile/DWARF/DWARFUnit.h | 17 +-
.../SymbolFile/DWARF/DebugNamesDWARFIndex.cpp | 3 +-
.../SymbolFile/DWARF/DebugNamesDWARFIndex.h | 39 ++---
.../SymbolFile/DWARF/ManualDWARFIndex.cpp | 1 +
.../SymbolFile/DWARF/ManualDWARFIndex.h | 37 ++--
.../Plugins/SymbolFile/DWARF/NameToDIE.cpp | 1 +
.../Plugins/SymbolFile/DWARF/NameToDIE.h | 5 +-
.../SymbolFile/DWARF/SymbolFileDWARF.cpp | 10 +-
.../SymbolFile/DWARF/SymbolFileDWARF.h | 12 +-
.../DWARF/SymbolFileDWARFDebugMap.cpp | 3 +
.../DWARF/SymbolFileDWARFDebugMap.h | 13 +-
.../SymbolFile/DWARF/SymbolFileDWARFDwo.cpp | 1 +
.../SymbolFile/DWARF/SymbolFileDWARFDwo.h | 9 +-
.../SymbolFile/DWARF/UniqueDWARFASTType.cpp | 1 +
.../SymbolFile/DWARF/UniqueDWARFASTType.h | 5 +-
.../TypeSystem/Clang/TypeSystemClang.cpp | 1 +
.../TypeSystem/Clang/TypeSystemClang.h | 2 +-
63 files changed, 364 insertions(+), 243 deletions(-)
diff --git a/lldb/include/lldb/Expression/DWARFExpression.h b/lldb/include/lldb/Expression/DWARFExpression.h
index 5e03f539a272cac..4ed3881eb513c99 100644
--- a/lldb/include/lldb/Expression/DWARFExpression.h
+++ b/lldb/include/lldb/Expression/DWARFExpression.h
@@ -18,7 +18,9 @@
#include "llvm/DebugInfo/DWARF/DWARFLocationExpression.h"
#include <functional>
+namespace lldb_plugin::dwarf {
class DWARFUnit;
+} // namespace lldb_plugin::dwarf
namespace lldb_private {
@@ -64,18 +66,21 @@ class DWARFExpression {
/// \return
/// The address specified by the operation, if the operation exists, or
/// LLDB_INVALID_ADDRESS otherwise.
- lldb::addr_t GetLocation_DW_OP_addr(const DWARFUnit *dwarf_cu,
- bool &error) const;
+ lldb::addr_t
+ GetLocation_DW_OP_addr(const lldb_plugin::dwarf::DWARFUnit *dwarf_cu,
+ bool &error) const;
- bool Update_DW_OP_addr(const DWARFUnit *dwarf_cu, lldb::addr_t file_addr);
+ bool Update_DW_OP_addr(const lldb_plugin::dwarf::DWARFUnit *dwarf_cu,
+ lldb::addr_t file_addr);
void UpdateValue(uint64_t const_value, lldb::offset_t const_value_byte_size,
uint8_t addr_byte_size);
- bool ContainsThreadLocalStorage(const DWARFUnit *dwarf_cu) const;
+ bool ContainsThreadLocalStorage(
+ const lldb_plugin::dwarf::DWARFUnit *dwarf_cu) const;
bool LinkThreadLocalStorage(
- const DWARFUnit *dwarf_cu,
+ const lldb_plugin::dwarf::DWARFUnit *dwarf_cu,
std::function<lldb::addr_t(lldb::addr_t file_addr)> const
&link_address_callback);
@@ -128,15 +133,16 @@ class DWARFExpression {
/// details of the failure are provided through it.
static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::ModuleSP module_sp, const DataExtractor &opcodes,
- const DWARFUnit *dwarf_cu,
+ const lldb_plugin::dwarf::DWARFUnit *dwarf_cu,
const lldb::RegisterKind reg_set,
const Value *initial_value_ptr,
const Value *object_address_ptr, Value &result,
Status *error_ptr);
- static bool ParseDWARFLocationList(const DWARFUnit *dwarf_cu,
- const DataExtractor &data,
- DWARFExpressionList *loc_list);
+ static bool
+ ParseDWARFLocationList(const lldb_plugin::dwarf::DWARFUnit *dwarf_cu,
+ const DataExtractor &data,
+ DWARFExpressionList *loc_list);
bool GetExpressionData(DataExtractor &data) const {
data = m_data;
diff --git a/lldb/include/lldb/Expression/DWARFExpressionList.h b/lldb/include/lldb/Expression/DWARFExpressionList.h
index c0939647056dcbf..c44ff71a7eef1bf 100644
--- a/lldb/include/lldb/Expression/DWARFExpressionList.h
+++ b/lldb/include/lldb/Expression/DWARFExpressionList.h
@@ -13,7 +13,9 @@
#include "lldb/Utility/RangeMap.h"
#include "lldb/lldb-private.h"
+namespace lldb_plugin::dwarf {
class DWARFUnit;
+} // namespace lldb_plugin::dwarf
namespace lldb_private {
@@ -24,13 +26,14 @@ class DWARFExpressionList {
public:
DWARFExpressionList() = default;
- DWARFExpressionList(lldb::ModuleSP module_sp, const DWARFUnit *dwarf_cu,
+ DWARFExpressionList(lldb::ModuleSP module_sp,
+ const lldb_plugin::dwarf::DWARFUnit *dwarf_cu,
lldb::addr_t func_file_addr)
: m_module_wp(module_sp), m_dwarf_cu(dwarf_cu),
m_func_file_addr(func_file_addr) {}
DWARFExpressionList(lldb::ModuleSP module_sp, DWARFExpression expr,
- const DWARFUnit *dwarf_cu)
+ const lldb_plugin::dwarf::DWARFUnit *dwarf_cu)
: m_module_wp(module_sp), m_dwarf_cu(dwarf_cu) {
AddExpression(0, LLDB_INVALID_ADDRESS, expr);
}
@@ -136,7 +139,7 @@ class DWARFExpressionList {
/// The DWARF compile unit this expression belongs to. It is used to evaluate
/// values indexing into the .debug_addr section (e.g. DW_OP_GNU_addr_index,
/// DW_OP_GNU_const_index)
- const DWARFUnit *m_dwarf_cu = nullptr;
+ const lldb_plugin::dwarf::DWARFUnit *m_dwarf_cu = nullptr;
// Function base file address.
lldb::addr_t m_func_file_addr = LLDB_INVALID_ADDRESS;
diff --git a/lldb/include/lldb/Symbol/TypeSystem.h b/lldb/include/lldb/Symbol/TypeSystem.h
index eb6e453e1aec0d0..4ef22a02d8c2d3f 100644
--- a/lldb/include/lldb/Symbol/TypeSystem.h
+++ b/lldb/include/lldb/Symbol/TypeSystem.h
@@ -28,8 +28,11 @@
#include "lldb/Symbol/CompilerDeclContext.h"
#include "lldb/lldb-private.h"
+namespace lldb_plugin::dwarf {
class DWARFDIE;
class DWARFASTParser;
+} // namespace lldb_plugin::dwarf
+
class PDBASTParser;
namespace lldb_private {
@@ -93,7 +96,10 @@ class TypeSystem : public PluginInterface,
/// removing all the TypeSystems from the TypeSystemMap.
virtual void Finalize() {}
- virtual DWARFASTParser *GetDWARFParser() { return nullptr; }
+ virtual lldb_plugin::dwarf::DWARFASTParser *GetDWARFParser() {
+ return nullptr;
+ }
+
virtual PDBASTParser *GetPDBParser() { return nullptr; }
virtual npdb::PdbAstBuilder *GetNativePDBParser() { return nullptr; }
diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index 93fcf0579be0b18..18528d78f1cf01b 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -45,6 +45,7 @@
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
// DWARFExpression constructor
DWARFExpression::DWARFExpression() : m_data() {}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
index 34fb98b5a9b690a..286fadfb2dcdaf6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
@@ -18,6 +18,7 @@
using namespace lldb_private;
using namespace lldb;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
std::unique_ptr<AppleDWARFIndex> AppleDWARFIndex::Create(
Module &module, DWARFDataExtractor apple_names,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
index 6b948e07989531e..ab7d4659e56cbe4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
@@ -12,15 +12,18 @@
#include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
#include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h"
-namespace lldb_private {
+namespace lldb_plugin::dwarf {
class AppleDWARFIndex : public DWARFIndex {
public:
static std::unique_ptr<AppleDWARFIndex>
- Create(Module &module, DWARFDataExtractor apple_names,
- DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types,
- DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str);
+ Create(lldb_private::Module &module,
+ lldb_private::DWARFDataExtractor apple_names,
+ lldb_private::DWARFDataExtractor apple_namespaces,
+ lldb_private::DWARFDataExtractor apple_types,
+ lldb_private::DWARFDataExtractor apple_objc,
+ lldb_private::DWARFDataExtractor debug_str);
- AppleDWARFIndex(Module &module,
+ AppleDWARFIndex(lldb_private::Module &module,
std::unique_ptr<llvm::AppleAcceleratorTable> apple_names,
std::unique_ptr<llvm::AppleAcceleratorTable> apple_namespaces,
std::unique_ptr<llvm::AppleAcceleratorTable> apple_types,
@@ -33,33 +36,33 @@ class AppleDWARFIndex : public DWARFIndex {
void Preload() override {}
void
- GetGlobalVariables(ConstString basename,
+ GetGlobalVariables(lldb_private::ConstString basename,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void
- GetGlobalVariables(const RegularExpression ®ex,
+ GetGlobalVariables(const lldb_private::RegularExpression ®ex,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void
GetGlobalVariables(DWARFUnit &cu,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetObjCMethods(ConstString class_name,
+ void GetObjCMethods(lldb_private::ConstString class_name,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void GetCompleteObjCClass(
- ConstString class_name, bool must_be_implementation,
+ lldb_private::ConstString class_name, bool must_be_implementation,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetTypes(ConstString name,
+ void GetTypes(lldb_private::ConstString name,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void GetTypes(const DWARFDeclContext &context,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetNamespaces(ConstString name,
+ void GetNamespaces(lldb_private::ConstString name,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetFunctions(const Module::LookupInfo &lookup_info,
+ void GetFunctions(const lldb_private::Module::LookupInfo &lookup_info,
SymbolFileDWARF &dwarf,
- const CompilerDeclContext &parent_decl_ctx,
+ const lldb_private::CompilerDeclContext &parent_decl_ctx,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetFunctions(const RegularExpression ®ex,
+ void GetFunctions(const lldb_private::RegularExpression ®ex,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void Dump(Stream &s) override;
+ void Dump(lldb_private::Stream &s) override;
private:
std::unique_ptr<llvm::AppleAcceleratorTable> m_apple_names_up;
@@ -77,6 +80,6 @@ class AppleDWARFIndex : public DWARFIndex {
std::optional<dw_tag_t> search_for_tag = std::nullopt,
std::optional<uint32_t> search_for_qualhash = std::nullopt);
};
-} // namespace lldb_private
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_APPLEDWARFINDEX_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
index 88a5e6027557b9b..d4c6b043fec359c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
@@ -14,6 +14,7 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
void llvm::format_provider<DIERef>::format(const DIERef &ref, raw_ostream &OS,
StringRef Style) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
index b5a5cfe263f7804..939336dab2be6e6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
@@ -14,6 +14,7 @@
#include <cassert>
#include <optional>
+namespace lldb_plugin::dwarf {
/// Identifies a DWARF debug info entry within a given Module. It contains three
/// "coordinates":
/// - file_index: identifies the separate stand alone debug info file
@@ -131,10 +132,12 @@ class DIERef {
static_assert(sizeof(DIERef) == 8);
typedef std::vector<DIERef> DIEArray;
+} // namespace lldb_plugin::dwarf
namespace llvm {
-template<> struct format_provider<DIERef> {
- static void format(const DIERef &ref, raw_ostream &OS, StringRef Style);
+template <> struct format_provider<lldb_plugin::dwarf::DIERef> {
+ static void format(const lldb_plugin::dwarf::DIERef &ref, raw_ostream &OS,
+ StringRef Style);
};
} // namespace llvm
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp
index a68b7cd110eb719..06be740ad398d7d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp
@@ -18,6 +18,7 @@
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
std::optional<SymbolFile::ArrayInfo>
DWARFASTParser::ParseChildArrayInfo(const DWARFDIE &parent_die,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
index 18825ae060b12fe..cf9f4bf8cdf30e4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
@@ -17,11 +17,13 @@
#include "lldb/lldb-enumerations.h"
#include <optional>
-class DWARFDIE;
namespace lldb_private {
class CompileUnit;
class ExecutionContext;
}
+
+namespace lldb_plugin::dwarf {
+class DWARFDIE;
class SymbolFileDWARF;
class DWARFASTParser {
@@ -65,5 +67,6 @@ class DWARFASTParser {
static lldb::AccessType GetAccessTypeFromDWARF(uint32_t dwarf_accessibility);
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFASTPARSER_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 37fb16d4e0351c9..817ae92e962b3d6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -60,6 +60,8 @@
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
+
DWARFASTParserClang::DWARFASTParserClang(TypeSystemClang &ast)
: m_ast(ast), m_die_to_decl_ctx(), m_decl_ctx_to_die() {}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
index 88bfc490e890744..8a8c8f48af16f97 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
@@ -31,12 +31,14 @@
namespace lldb_private {
class CompileUnit;
}
+namespace lldb_plugin::dwarf {
class DWARFDebugInfoEntry;
class SymbolFileDWARF;
+} // namespace lldb_plugin::dwarf
struct ParsedDWARFTypeAttributes;
-class DWARFASTParserClang : public DWARFASTParser {
+class DWARFASTParserClang : public lldb_plugin::dwarf::DWARFASTParser {
public:
DWARFASTParserClang(lldb_private::TypeSystemClang &ast);
@@ -44,32 +46,33 @@ class DWARFASTParserClang : public DWARFASTParser {
// DWARFASTParser interface.
lldb::TypeSP ParseTypeFromDWARF(const lldb_private::SymbolContext &sc,
- const DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &die,
bool *type_is_new_ptr) override;
- lldb_private::ConstString
- ConstructDemangledNameFromDWARF(const DWARFDIE &die) override;
+ lldb_private::ConstString ConstructDemangledNameFromDWARF(
+ const lldb_plugin::dwarf::DWARFDIE &die) override;
lldb_private::Function *
ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit,
- const DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &die,
const lldb_private::AddressRange &func_range) override;
bool
- CompleteTypeFromDWARF(const DWARFDIE &die, lldb_private::Type *type,
+ CompleteTypeFromDWARF(const lldb_plugin::dwarf::DWARFDIE &die,
+ lldb_private::Type *type,
lldb_private::CompilerType &compiler_type) override;
lldb_private::CompilerDecl
- GetDeclForUIDFromDWARF(const DWARFDIE &die) override;
+ GetDeclForUIDFromDWARF(const lldb_plugin::dwarf::DWARFDIE &die) override;
void EnsureAllDIEsInDeclContextHaveBeenParsed(
lldb_private::CompilerDeclContext decl_context) override;
- lldb_private::CompilerDeclContext
- GetDeclContextForUIDFromDWARF(const DWARFDIE &die) override;
+ lldb_private::CompilerDeclContext GetDeclContextForUIDFromDWARF(
+ const lldb_plugin::dwarf::DWARFDIE &die) override;
- lldb_private::CompilerDeclContext
- GetDeclContextContainingUIDFromDWARF(const DWARFDIE &die) override;
+ lldb_private::CompilerDeclContext GetDeclContextContainingUIDFromDWARF(
+ const lldb_plugin::dwarf::DWARFDIE &die) override;
lldb_private::ClangASTImporter &GetClangASTImporter();
@@ -85,9 +88,9 @@ class DWARFASTParserClang : public DWARFASTParser {
/// DWARFFormValue with the bit width of the given integer type.
/// Returns an error if the value in the DWARFFormValue does not fit
/// into the given integer type or the integer type isn't supported.
- llvm::Expected<llvm::APInt>
- ExtractIntFromFormValue(const lldb_private::CompilerType &int_type,
- const DWARFFormValue &form_value) const;
+ llvm::Expected<llvm::APInt> ExtractIntFromFormValue(
+ const lldb_private::CompilerType &int_type,
+ const lldb_plugin::dwarf::DWARFFormValue &form_value) const;
/// Returns the template parameters of a class DWARFDIE as a string.
///
@@ -100,7 +103,7 @@ class DWARFASTParserClang : public DWARFASTParser {
/// If the DIE's name already has '<>', returns an empty ConstString because
/// it's assumed that the caller is using the DIE name anyway.
lldb_private::ConstString
- GetDIEClassTemplateParams(const DWARFDIE &die) override;
+ GetDIEClassTemplateParams(const lldb_plugin::dwarf::DWARFDIE &die) override;
protected:
/// Protected typedefs and members.
@@ -108,14 +111,17 @@ class DWARFASTParserClang : public DWARFASTParser {
class DelayedAddObjCClassProperty;
typedef std::vector<DelayedAddObjCClassProperty> DelayedPropertyList;
- typedef llvm::DenseMap<const DWARFDebugInfoEntry *, clang::DeclContext *>
+ typedef llvm::DenseMap<const lldb_plugin::dwarf::DWARFDebugInfoEntry *,
+ clang::DeclContext *>
DIEToDeclContextMap;
- typedef std::multimap<const clang::DeclContext *, const DWARFDIE>
+ typedef std::multimap<const clang::DeclContext *,
+ const lldb_plugin::dwarf::DWARFDIE>
DeclContextToDIEMap;
- typedef llvm::DenseMap<const DWARFDebugInfoEntry *,
+ typedef llvm::DenseMap<const lldb_plugin::dwarf::DWARFDebugInfoEntry *,
lldb_private::OptionalClangModuleID>
DIEToModuleMap;
- typedef llvm::DenseMap<const DWARFDebugInfoEntry *, clang::Decl *>
+ typedef llvm::DenseMap<const lldb_plugin::dwarf::DWARFDebugInfoEntry *,
+ clang::Decl *>
DIEToDeclMap;
lldb_private::TypeSystemClang &m_ast;
@@ -126,11 +132,13 @@ class DWARFASTParserClang : public DWARFASTParser {
std::unique_ptr<lldb_private::ClangASTImporter> m_clang_ast_importer_up;
/// @}
- clang::DeclContext *GetDeclContextForBlock(const DWARFDIE &die);
+ clang::DeclContext *
+ GetDeclContextForBlock(const lldb_plugin::dwarf::DWARFDIE &die);
- clang::BlockDecl *ResolveBlockDIE(const DWARFDIE &die);
+ clang::BlockDecl *ResolveBlockDIE(const lldb_plugin::dwarf::DWARFDIE &die);
- clang::NamespaceDecl *ResolveNamespaceDIE(const DWARFDIE &die);
+ clang::NamespaceDecl *
+ ResolveNamespaceDIE(const lldb_plugin::dwarf::DWARFDIE &die);
/// Returns the namespace decl that a DW_TAG_imported_declaration imports.
///
@@ -141,31 +149,34 @@ class DWARFASTParserClang : public DWARFASTParser {
/// 'die' imports. If the imported entity is not a namespace
/// or another import declaration, returns nullptr. If an error
/// occurs, returns nullptr.
- clang::NamespaceDecl *ResolveImportedDeclarationDIE(const DWARFDIE &die);
+ clang::NamespaceDecl *
+ ResolveImportedDeclarationDIE(const lldb_plugin::dwarf::DWARFDIE &die);
- bool ParseTemplateDIE(const DWARFDIE &die,
+ bool ParseTemplateDIE(const lldb_plugin::dwarf::DWARFDIE &die,
lldb_private::TypeSystemClang::TemplateParameterInfos
&template_param_infos);
bool ParseTemplateParameterInfos(
- const DWARFDIE &parent_die,
+ const lldb_plugin::dwarf::DWARFDIE &parent_die,
lldb_private::TypeSystemClang::TemplateParameterInfos
&template_param_infos);
- std::string GetCPlusPlusQualifiedName(const DWARFDIE &die);
+ std::string
+ GetCPlusPlusQualifiedName(const lldb_plugin::dwarf::DWARFDIE &die);
bool ParseChildMembers(
- const DWARFDIE &die, lldb_private::CompilerType &class_compiler_type,
+ const lldb_plugin::dwarf::DWARFDIE &die,
+ lldb_private::CompilerType &class_compiler_type,
std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
- std::vector<DWARFDIE> &member_function_dies,
+ std::vector<lldb_plugin::dwarf::DWARFDIE> &member_function_dies,
DelayedPropertyList &delayed_properties,
const lldb::AccessType default_accessibility,
lldb_private::ClangASTImporter::LayoutInfo &layout_info);
size_t
ParseChildParameters(clang::DeclContext *containing_decl_ctx,
- const DWARFDIE &parent_die, bool skip_artificial,
- bool &is_static, bool &is_variadic,
+ const lldb_plugin::dwarf::DWARFDIE &parent_die,
+ bool skip_artificial, bool &is_static, bool &is_variadic,
bool &has_template_params,
std::vector<lldb_private::CompilerType> &function_args,
std::vector<clang::ParmVarDecl *> &function_param_decls,
@@ -173,33 +184,40 @@ class DWARFASTParserClang : public DWARFASTParser {
size_t ParseChildEnumerators(lldb_private::CompilerType &compiler_type,
bool is_signed, uint32_t enumerator_byte_size,
- const DWARFDIE &parent_die);
+ const lldb_plugin::dwarf::DWARFDIE &parent_die);
/// Parse a structure, class, or union type DIE.
lldb::TypeSP ParseStructureLikeDIE(const lldb_private::SymbolContext &sc,
- const DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &die,
ParsedDWARFTypeAttributes &attrs);
- lldb_private::Type *GetTypeForDIE(const DWARFDIE &die);
+ lldb_private::Type *GetTypeForDIE(const lldb_plugin::dwarf::DWARFDIE &die);
- clang::Decl *GetClangDeclForDIE(const DWARFDIE &die);
+ clang::Decl *GetClangDeclForDIE(const lldb_plugin::dwarf::DWARFDIE &die);
- clang::DeclContext *GetClangDeclContextForDIE(const DWARFDIE &die);
+ clang::DeclContext *
+ GetClangDeclContextForDIE(const lldb_plugin::dwarf::DWARFDIE &die);
- clang::DeclContext *GetClangDeclContextContainingDIE(const DWARFDIE &die,
- DWARFDIE *decl_ctx_die);
- lldb_private::OptionalClangModuleID GetOwningClangModule(const DWARFDIE &die);
+ clang::DeclContext *
+ GetClangDeclContextContainingDIE(const lldb_plugin::dwarf::DWARFDIE &die,
+ lldb_plugin::dwarf::DWARFDIE *decl_ctx_die);
+ lldb_private::OptionalClangModuleID
+ GetOwningClangModule(const lldb_plugin::dwarf::DWARFDIE &die);
- bool CopyUniqueClassMethodTypes(const DWARFDIE &src_class_die,
- const DWARFDIE &dst_class_die,
- lldb_private::Type *class_type,
- std::vector<DWARFDIE> &failures);
+ bool CopyUniqueClassMethodTypes(
+ const lldb_plugin::dwarf::DWARFDIE &src_class_die,
+ const lldb_plugin::dwarf::DWARFDIE &dst_class_die,
+ lldb_private::Type *class_type,
+ std::vector<lldb_plugin::dwarf::DWARFDIE> &failures);
- clang::DeclContext *GetCachedClangDeclContextForDIE(const DWARFDIE &die);
+ clang::DeclContext *
+ GetCachedClangDeclContextForDIE(const lldb_plugin::dwarf::DWARFDIE &die);
- void LinkDeclContextToDIE(clang::DeclContext *decl_ctx, const DWARFDIE &die);
+ void LinkDeclContextToDIE(clang::DeclContext *decl_ctx,
+ const lldb_plugin::dwarf::DWARFDIE &die);
- void LinkDeclToDIE(clang::Decl *decl, const DWARFDIE &die);
+ void LinkDeclToDIE(clang::Decl *decl,
+ const lldb_plugin::dwarf::DWARFDIE &die);
/// If \p type_sp is valid, calculate and set its symbol context scope, and
/// update the type list for its backing symbol file.
@@ -207,16 +225,17 @@ class DWARFASTParserClang : public DWARFASTParser {
/// Returns \p type_sp.
lldb::TypeSP
UpdateSymbolContextScopeForType(const lldb_private::SymbolContext &sc,
- const DWARFDIE &die, lldb::TypeSP type_sp);
+ const lldb_plugin::dwarf::DWARFDIE &die,
+ lldb::TypeSP type_sp);
/// Follow Clang Module Skeleton CU references to find a type definition.
lldb::TypeSP ParseTypeFromClangModule(const lldb_private::SymbolContext &sc,
- const DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &die,
lldb_private::Log *log);
// Return true if this type is a declaration to a type in an external
// module.
- lldb::ModuleSP GetModuleForType(const DWARFDIE &die);
+ lldb::ModuleSP GetModuleForType(const lldb_plugin::dwarf::DWARFDIE &die);
private:
struct FieldInfo {
@@ -268,32 +287,37 @@ class DWARFASTParserClang : public DWARFASTParser {
/// created property.
/// \param delayed_properties The list of delayed properties that the result
/// will be appended to.
- void ParseObjCProperty(const DWARFDIE &die, const DWARFDIE &parent_die,
+ void ParseObjCProperty(const lldb_plugin::dwarf::DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &parent_die,
const lldb_private::CompilerType &class_clang_type,
DelayedPropertyList &delayed_properties);
void
- ParseSingleMember(const DWARFDIE &die, const DWARFDIE &parent_die,
+ ParseSingleMember(const lldb_plugin::dwarf::DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &parent_die,
const lldb_private::CompilerType &class_clang_type,
lldb::AccessType default_accessibility,
lldb_private::ClangASTImporter::LayoutInfo &layout_info,
FieldInfo &last_field_info);
- bool CompleteRecordType(const DWARFDIE &die, lldb_private::Type *type,
+ bool CompleteRecordType(const lldb_plugin::dwarf::DWARFDIE &die,
+ lldb_private::Type *type,
lldb_private::CompilerType &clang_type);
- bool CompleteEnumType(const DWARFDIE &die, lldb_private::Type *type,
+ bool CompleteEnumType(const lldb_plugin::dwarf::DWARFDIE &die,
+ lldb_private::Type *type,
lldb_private::CompilerType &clang_type);
lldb::TypeSP ParseTypeModifier(const lldb_private::SymbolContext &sc,
- const DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &die,
ParsedDWARFTypeAttributes &attrs);
lldb::TypeSP ParseEnum(const lldb_private::SymbolContext &sc,
- const DWARFDIE &die, ParsedDWARFTypeAttributes &attrs);
- lldb::TypeSP ParseSubroutine(const DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &die,
+ ParsedDWARFTypeAttributes &attrs);
+ lldb::TypeSP ParseSubroutine(const lldb_plugin::dwarf::DWARFDIE &die,
ParsedDWARFTypeAttributes &attrs);
- lldb::TypeSP ParseArrayType(const DWARFDIE &die,
+ lldb::TypeSP ParseArrayType(const lldb_plugin::dwarf::DWARFDIE &die,
const ParsedDWARFTypeAttributes &attrs);
- lldb::TypeSP ParsePointerToMemberType(const DWARFDIE &die,
+ lldb::TypeSP ParsePointerToMemberType(const lldb_plugin::dwarf::DWARFDIE &die,
const ParsedDWARFTypeAttributes &attrs);
/// Parses a DW_TAG_inheritance DIE into a base/super class.
@@ -311,7 +335,8 @@ class DWARFASTParserClang : public DWARFASTParser {
/// \param layout_info The layout information that will be updated for C++
/// base classes with the base offset.
void ParseInheritance(
- const DWARFDIE &die, const DWARFDIE &parent_die,
+ const lldb_plugin::dwarf::DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &parent_die,
const lldb_private::CompilerType class_clang_type,
const lldb::AccessType default_accessibility,
const lldb::ModuleSP &module_sp,
@@ -328,7 +353,8 @@ class DWARFASTParserClang : public DWARFASTParser {
/// \param layout_info The layout information that will be updated for
// base classes with the base offset
void
- ParseRustVariantPart(DWARFDIE &die, const DWARFDIE &parent_die,
+ ParseRustVariantPart(lldb_plugin::dwarf::DWARFDIE &die,
+ const lldb_plugin::dwarf::DWARFDIE &parent_die,
lldb_private::CompilerType &class_clang_type,
const lldb::AccessType default_accesibility,
lldb_private::ClangASTImporter::LayoutInfo &layout_info);
@@ -338,7 +364,7 @@ class DWARFASTParserClang : public DWARFASTParser {
/// Some attributes are relevant for all kinds of types (declaration), while
/// others are only meaningful to a specific type (is_virtual)
struct ParsedDWARFTypeAttributes {
- explicit ParsedDWARFTypeAttributes(const DWARFDIE &die);
+ explicit ParsedDWARFTypeAttributes(const lldb_plugin::dwarf::DWARFDIE &die);
lldb::AccessType accessibility = lldb::eAccessNone;
bool is_artificial = false;
@@ -355,12 +381,12 @@ struct ParsedDWARFTypeAttributes {
const char *mangled_name = nullptr;
lldb_private::ConstString name;
lldb_private::Declaration decl;
- DWARFDIE object_pointer;
- DWARFFormValue abstract_origin;
- DWARFFormValue containing_type;
- DWARFFormValue signature;
- DWARFFormValue specification;
- DWARFFormValue type;
+ lldb_plugin::dwarf::DWARFDIE object_pointer;
+ lldb_plugin::dwarf::DWARFFormValue abstract_origin;
+ lldb_plugin::dwarf::DWARFFormValue containing_type;
+ lldb_plugin::dwarf::DWARFFormValue signature;
+ lldb_plugin::dwarf::DWARFFormValue specification;
+ lldb_plugin::dwarf::DWARFFormValue type;
lldb::LanguageType class_language = lldb::eLanguageTypeUnknown;
std::optional<uint64_t> byte_size;
size_t calling_convention = llvm::dwarf::DW_CC_normal;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
index 00b56537ae2b5fe..48bd62012afb393 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
@@ -11,6 +11,7 @@
#include "DWARFDebugInfo.h"
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
DWARFAttributes::DWARFAttributes() : m_infos() {}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
index 90e12fa024936d6..d0f152608dde415 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
@@ -14,6 +14,7 @@
#include "llvm/ADT/SmallVector.h"
#include <vector>
+namespace lldb_plugin::dwarf {
class DWARFUnit;
class DWARFAttribute {
@@ -31,6 +32,7 @@ class DWARFAttribute {
form = m_form;
val = m_value;
}
+
protected:
dw_attr_t m_attr;
dw_form_t m_form;
@@ -72,5 +74,6 @@ class DWARFAttributes {
typedef llvm::SmallVector<AttributeValue, 8> collection;
collection m_infos;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFATTRIBUTE_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
index 37a917c3a7661eb..9ab7f0651d93d1f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
@@ -18,6 +18,7 @@
#include <optional>
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
std::optional<DIERef> DWARFBaseDIE::GetDIERef() const {
if (!IsValid())
@@ -35,7 +36,7 @@ dw_tag_t DWARFBaseDIE::Tag() const {
}
const char *DWARFBaseDIE::GetTagAsCString() const {
- return lldb_private::DW_TAG_value_to_name(Tag());
+ return DW_TAG_value_to_name(Tag());
}
const char *DWARFBaseDIE::GetAttributeValueAsString(const dw_attr_t attr,
@@ -120,6 +121,7 @@ DWARFAttributes DWARFBaseDIE::GetAttributes(Recurse recurse) const {
return DWARFAttributes();
}
+namespace lldb_plugin::dwarf {
bool operator==(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs) {
return lhs.GetDIE() == rhs.GetDIE() && lhs.GetCU() == rhs.GetCU();
}
@@ -127,6 +129,7 @@ bool operator==(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs) {
bool operator!=(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs) {
return !(lhs == rhs);
}
+} // namespace lldb_plugin::dwarf
const DWARFDataExtractor &DWARFBaseDIE::GetData() const {
// Clients must check if this DIE is valid before calling this function.
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
index 8bcf807ad163a60..f7948ae13716e91 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
@@ -15,6 +15,7 @@
#include "llvm/Support/Error.h"
#include <optional>
+namespace lldb_plugin::dwarf {
class DIERef;
class DWARFASTParser;
class DWARFAttributes;
@@ -124,5 +125,6 @@ class DWARFBaseDIE {
bool operator==(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs);
bool operator!=(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs);
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFBASEDIE_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
index f839a59bf6c390b..6f18c3ddf605f1d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
@@ -16,6 +16,7 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
void DWARFCompileUnit::Dump(Stream *s) const {
s->Format(
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
index 65debac4c7d9265..574ede2acb5ceab 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
@@ -14,8 +14,9 @@
namespace llvm {
class DWARFAbbreviationDeclarationSet;
-}
+} // namespace llvm
+namespace lldb_plugin::dwarf {
class DWARFCompileUnit : public DWARFUnit {
public:
void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges) override;
@@ -40,5 +41,6 @@ class DWARFCompileUnit : public DWARFUnit {
friend class DWARFUnit;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFCOMPILEUNIT_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
index f72dad88e157592..d7979a43e46e8a2 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
@@ -13,6 +13,7 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
static DWARFDataExtractor LoadSection(SectionList *section_list,
SectionType section_type) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h
index 7df776b5f514155..cabbb0bffbf6616 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.h
@@ -16,16 +16,16 @@
#include <memory>
#include <optional>
-namespace lldb_private {
+namespace lldb_plugin::dwarf {
class DWARFContext {
private:
- SectionList *m_main_section_list;
- SectionList *m_dwo_section_list;
+ lldb_private::SectionList *m_main_section_list;
+ lldb_private::SectionList *m_dwo_section_list;
mutable std::unique_ptr<llvm::DWARFContext> m_llvm_context;
struct SectionData {
llvm::once_flag flag;
- DWARFDataExtractor data;
+ lldb_private::DWARFDataExtractor data;
};
SectionData m_data_debug_abbrev;
@@ -45,39 +45,39 @@ class DWARFContext {
SectionData m_data_debug_tu_index;
SectionData m_data_debug_types;
- const DWARFDataExtractor &
+ const lldb_private::DWARFDataExtractor &
LoadOrGetSection(std::optional<lldb::SectionType> main_section_type,
std::optional<lldb::SectionType> dwo_section_type,
SectionData &data);
- const DWARFDataExtractor &getOrLoadCuIndexData();
- const DWARFDataExtractor &getOrLoadTuIndexData();
+ const lldb_private::DWARFDataExtractor &getOrLoadCuIndexData();
+ const lldb_private::DWARFDataExtractor &getOrLoadTuIndexData();
public:
- explicit DWARFContext(SectionList *main_section_list,
- SectionList *dwo_section_list)
+ explicit DWARFContext(lldb_private::SectionList *main_section_list,
+ lldb_private::SectionList *dwo_section_list)
: m_main_section_list(main_section_list),
m_dwo_section_list(dwo_section_list) {}
- const DWARFDataExtractor &getOrLoadAbbrevData();
- const DWARFDataExtractor &getOrLoadAddrData();
- const DWARFDataExtractor &getOrLoadArangesData();
- const DWARFDataExtractor &getOrLoadDebugInfoData();
- const DWARFDataExtractor &getOrLoadLineData();
- const DWARFDataExtractor &getOrLoadLineStrData();
- const DWARFDataExtractor &getOrLoadLocData();
- const DWARFDataExtractor &getOrLoadLocListsData();
- const DWARFDataExtractor &getOrLoadMacroData();
- const DWARFDataExtractor &getOrLoadRangesData();
- const DWARFDataExtractor &getOrLoadRngListsData();
- const DWARFDataExtractor &getOrLoadStrData();
- const DWARFDataExtractor &getOrLoadStrOffsetsData();
- const DWARFDataExtractor &getOrLoadDebugTypesData();
+ const lldb_private::DWARFDataExtractor &getOrLoadAbbrevData();
+ const lldb_private::DWARFDataExtractor &getOrLoadAddrData();
+ const lldb_private::DWARFDataExtractor &getOrLoadArangesData();
+ const lldb_private::DWARFDataExtractor &getOrLoadDebugInfoData();
+ const lldb_private::DWARFDataExtractor &getOrLoadLineData();
+ const lldb_private::DWARFDataExtractor &getOrLoadLineStrData();
+ const lldb_private::DWARFDataExtractor &getOrLoadLocData();
+ const lldb_private::DWARFDataExtractor &getOrLoadLocListsData();
+ const lldb_private::DWARFDataExtractor &getOrLoadMacroData();
+ const lldb_private::DWARFDataExtractor &getOrLoadRangesData();
+ const lldb_private::DWARFDataExtractor &getOrLoadRngListsData();
+ const lldb_private::DWARFDataExtractor &getOrLoadStrData();
+ const lldb_private::DWARFDataExtractor &getOrLoadStrOffsetsData();
+ const lldb_private::DWARFDataExtractor &getOrLoadDebugTypesData();
bool isDwo() { return m_dwo_section_list != nullptr; }
llvm::DWARFContext &GetAsLLVM();
};
-} // namespace lldb_private
+} // namespace lldb_plugin::dwarf
#endif
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
index b31c5dcac91851d..62ef0eb356b0bc7 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
@@ -18,6 +18,7 @@
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
namespace {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
index 031ea26ad405094..3e4a9ff4d446638 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
@@ -13,6 +13,7 @@
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/iterator_range.h"
+namespace lldb_plugin::dwarf {
class DWARFDIE : public DWARFBaseDIE {
public:
class child_iterator;
@@ -126,5 +127,6 @@ class DWARFDIE::child_iterator
return *this;
}
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDIE_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
index b9526b079c1e9da..41b8e9ad0217b69 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
@@ -33,6 +33,6 @@ class DWARFDataExtractor : public DataExtractor {
llvm::DWARFDataExtractor GetAsLLVMDWARF() const;
llvm::DataExtractor GetAsLLVM() const;
};
-}
+} // namespace lldb_private
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDATAEXTRACTOR_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
index 03cbfd28ae7413a..61f1f5f1aa8baec 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
@@ -13,6 +13,7 @@
#include <cassert>
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
DWARFDebugArangeSet::DWARFDebugArangeSet()
: m_offset(DW_INVALID_OFFSET), m_next_offset(DW_INVALID_OFFSET) {}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
index 3c8633eaa3cce85..b1aaade00fbb126 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
@@ -13,6 +13,7 @@
#include <cstdint>
#include <vector>
+namespace lldb_plugin::dwarf {
class DWARFDebugArangeSet {
public:
struct Header {
@@ -62,5 +63,6 @@ class DWARFDebugArangeSet {
Header m_header;
DescriptorColl m_arange_descriptors;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGESET_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
index b38dd2b88c9d0b0..a5beafe593c2c1e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -15,6 +15,7 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
// Constructor
DWARFDebugAranges::DWARFDebugAranges() : m_aranges() {}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
index 5ff37e400c88403..e0a852faa40b80c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
@@ -13,6 +13,7 @@
#include "lldb/Utility/RangeMap.h"
#include "llvm/Support/Error.h"
+namespace lldb_plugin::dwarf {
class DWARFDebugAranges {
protected:
typedef lldb_private::RangeDataVector<dw_addr_t, uint32_t, dw_offset_t>
@@ -50,5 +51,6 @@ class DWARFDebugAranges {
protected:
RangeToDIE m_aranges;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGARANGES_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 9a33d6338b87d3e..54609a1b77fc6cb 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -27,10 +27,10 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
// Constructor
-DWARFDebugInfo::DWARFDebugInfo(SymbolFileDWARF &dwarf,
- lldb_private::DWARFContext &context)
+DWARFDebugInfo::DWARFDebugInfo(SymbolFileDWARF &dwarf, DWARFContext &context)
: m_dwarf(dwarf), m_context(context), m_units(), m_cu_aranges_up() {}
const DWARFDebugAranges &DWARFDebugInfo::GetCompileUnitAranges() {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
index c990ac9fbe58310..42ab0b55ba41d28 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
@@ -19,20 +19,17 @@
#include "lldb/lldb-private.h"
#include "llvm/Support/Error.h"
-namespace lldb_private {
+namespace lldb_plugin::dwarf {
class DWARFContext;
-}
class DWARFDebugInfo {
public:
- typedef dw_offset_t (*Callback)(SymbolFileDWARF *dwarf2Data,
- DWARFUnit *cu,
+ typedef dw_offset_t (*Callback)(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
DWARFDebugInfoEntry *die,
const dw_offset_t next_offset,
const uint32_t depth, void *userData);
- explicit DWARFDebugInfo(SymbolFileDWARF &dwarf,
- lldb_private::DWARFContext &context);
+ explicit DWARFDebugInfo(SymbolFileDWARF &dwarf, DWARFContext &context);
size_t GetNumUnits();
DWARFUnit *GetUnitAtIndex(size_t idx);
@@ -58,7 +55,7 @@ class DWARFDebugInfo {
typedef std::vector<DWARFUnitSP> UnitColl;
SymbolFileDWARF &m_dwarf;
- lldb_private::DWARFContext &m_context;
+ DWARFContext &m_context;
llvm::once_flag m_units_once_flag;
UnitColl m_units;
@@ -80,5 +77,6 @@ class DWARFDebugInfo {
DWARFDebugInfo(const DWARFDebugInfo &) = delete;
const DWARFDebugInfo &operator=(const DWARFDebugInfo &) = delete;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGINFO_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index a6ab83700904cb9..6405ecc20542f41 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -35,6 +35,7 @@
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
extern int g_verbose;
// Extract a debug info entry for a given DWARFUnit from the data
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
index 29db44a16bb1281..cfcf91a582e44e9 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
@@ -22,6 +22,7 @@
#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
+namespace lldb_plugin::dwarf {
class DWARFDeclContext;
#define DIE_SIBLING_IDX_BITSIZE 31
@@ -190,5 +191,6 @@ class DWARFDebugInfoEntry {
void GetAttributes(DWARFUnit *cu, DWARFAttributes &attrs, Recurse recurse,
uint32_t curr_depth) const;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGINFOENTRY_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp
index 19c6448c4e74a06..cde5730d51e33fa 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp
@@ -15,6 +15,7 @@
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
DWARFDebugMacroHeader
DWARFDebugMacroHeader::ParseHeader(const DWARFDataExtractor &debug_macro_data,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h
index cbf762458331bcd..fd506b10b26b3da 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h
@@ -17,11 +17,10 @@
#include "lldb/lldb-types.h"
namespace lldb_private {
-
class DWARFDataExtractor;
+}
-} // namespace lldb_private
-
+namespace lldb_plugin::dwarf {
class SymbolFileDWARF;
class DWARFDebugMacroHeader {
@@ -57,5 +56,6 @@ class DWARFDebugMacroEntry {
SymbolFileDWARF *sym_file_dwarf,
lldb_private::DebugMacrosSP &debug_macros_sp);
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGMACRO_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
index 0b5bb23a4981f89..e37d22f07337763 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
@@ -11,6 +11,7 @@
#include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
DWARFDebugRanges::DWARFDebugRanges() : m_range_map() {}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
index 2e06cd5daf6f32d..78724a1d19223e6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
@@ -12,21 +12,21 @@
#include "lldb/Core/dwarf.h"
#include <map>
+namespace lldb_plugin::dwarf {
class DWARFUnit;
-namespace lldb_private {
class DWARFContext;
-}
class DWARFDebugRanges {
public:
DWARFDebugRanges();
- void Extract(lldb_private::DWARFContext &context);
+ void Extract(DWARFContext &context);
DWARFRangeList FindRanges(const DWARFUnit *cu,
dw_offset_t debug_ranges_offset) const;
protected:
std::map<dw_offset_t, DWARFRangeList> m_range_map;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEBUGRANGES_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
index 393de0038e651f3..a20dfef6bf89921 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
@@ -9,6 +9,7 @@
#include "DWARFDeclContext.h"
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
const char *DWARFDeclContext::GetQualifiedName() const {
if (m_qualified_name.empty()) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
index 13e3dfb70c0cc80..03ed4e898d566fe 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
@@ -16,6 +16,7 @@
#include <string>
#include <vector>
+namespace lldb_plugin::dwarf {
// DWARFDeclContext
//
// A class that represents a declaration context all the way down to a
@@ -82,5 +83,6 @@ class DWARFDeclContext {
collection m_entries;
mutable std::string m_qualified_name;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDECLCONTEXT_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
index 4e99a295ce50f7d..e30253e18d49cdf 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
@@ -12,7 +12,7 @@
#include <cstring>
#include <string>
-namespace lldb_private {
+namespace lldb_plugin::dwarf {
const char *DW_TAG_value_to_name(uint32_t val) {
static char invalid[100];
@@ -88,4 +88,4 @@ const char *DW_LNS_value_to_name(uint32_t val) {
return llvmstr.data();
}
-} // namespace lldb_private
+} // namespace lldb_plugin::dwarf
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
index 2afdbb47381a9cd..dd41724149f9d90 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
@@ -12,7 +12,7 @@
#include "lldb/Core/dwarf.h"
#include <cstdint>
-namespace lldb_private {
+namespace lldb_plugin::dwarf {
typedef uint32_t DRC_class; // Holds DRC_* class bitfields
@@ -30,6 +30,6 @@ const char *DW_LANG_value_to_name(uint32_t val);
const char *DW_LNS_value_to_name(uint32_t val);
-} // namespace lldb_private
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDEFINES_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index 6ca17dcf47ff7ba..7c9f8073a3a01ae 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -22,6 +22,7 @@ class DWARFUnit;
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
void DWARFFormValue::Clear() {
m_unit = nullptr;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
index 2a8843c1a0d45df..532afd94ef72c5f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -13,6 +13,7 @@
#include <cstddef>
#include <optional>
+namespace lldb_plugin::dwarf {
class DWARFUnit;
class SymbolFileDWARF;
class DWARFDIE;
@@ -84,7 +85,8 @@ class DWARFFormValue {
// It may be different from compile unit where m_value refers to.
const DWARFUnit *m_unit = nullptr; // Unit for this form
dw_form_t m_form = dw_form_t(0); // Form for this value
- ValueType m_value; // Contains all data for the form
+ ValueType m_value; // Contains all data for the form
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFFORMVALUE_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
index 779b52481b856d8..791bd2d88696c26 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
@@ -17,6 +17,7 @@
using namespace lldb_private;
using namespace lldb;
+using namespace lldb_plugin::dwarf;
DWARFIndex::~DWARFIndex() = default;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
index 13fe96dae2aa1d6..4fd952ddd8fc148 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
@@ -17,13 +17,13 @@
#include "lldb/Core/Module.h"
#include "lldb/Target/Statistics.h"
+namespace lldb_plugin::dwarf {
class DWARFDeclContext;
class DWARFDIE;
-namespace lldb_private {
class DWARFIndex {
public:
- DWARFIndex(Module &module) : m_module(module) {}
+ DWARFIndex(lldb_private::Module &module) : m_module(module) {}
virtual ~DWARFIndex();
virtual void Preload() = 0;
@@ -32,53 +32,56 @@ class DWARFIndex {
/// (e.g., to only retrieve variables from a given context) should be done by
/// the consumer.
virtual void
- GetGlobalVariables(ConstString basename,
+ GetGlobalVariables(lldb_private::ConstString basename,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
virtual void
- GetGlobalVariables(const RegularExpression ®ex,
+ GetGlobalVariables(const lldb_private::RegularExpression ®ex,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
/// \a cu must be the skeleton unit if possible, not GetNonSkeletonUnit().
virtual void
GetGlobalVariables(DWARFUnit &cu,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
virtual void
- GetObjCMethods(ConstString class_name,
+ GetObjCMethods(lldb_private::ConstString class_name,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
virtual void
- GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
+ GetCompleteObjCClass(lldb_private::ConstString class_name,
+ bool must_be_implementation,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
- virtual void GetTypes(ConstString name,
+ virtual void GetTypes(lldb_private::ConstString name,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
virtual void GetTypes(const DWARFDeclContext &context,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
virtual void
- GetNamespaces(ConstString name,
+ GetNamespaces(lldb_private::ConstString name,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
virtual void
- GetFunctions(const Module::LookupInfo &lookup_info, SymbolFileDWARF &dwarf,
- const CompilerDeclContext &parent_decl_ctx,
+ GetFunctions(const lldb_private::Module::LookupInfo &lookup_info,
+ SymbolFileDWARF &dwarf,
+ const lldb_private::CompilerDeclContext &parent_decl_ctx,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
virtual void
- GetFunctions(const RegularExpression ®ex,
+ GetFunctions(const lldb_private::RegularExpression ®ex,
llvm::function_ref<bool(DWARFDIE die)> callback) = 0;
- virtual void Dump(Stream &s) = 0;
+ virtual void Dump(lldb_private::Stream &s) = 0;
- StatsDuration::Duration GetIndexTime() { return m_index_time; }
+ lldb_private::StatsDuration::Duration GetIndexTime() { return m_index_time; }
protected:
- Module &m_module;
- StatsDuration m_index_time;
+ lldb_private::Module &m_module;
+ lldb_private::StatsDuration m_index_time;
/// Helper function implementing common logic for processing function dies. If
/// the function given by "ref" matches search criteria given by
/// "parent_decl_ctx" and "name_type_mask", it is inserted into the "dies"
/// vector.
- bool ProcessFunctionDIE(const Module::LookupInfo &lookup_info, DIERef ref,
- SymbolFileDWARF &dwarf,
- const CompilerDeclContext &parent_decl_ctx,
- llvm::function_ref<bool(DWARFDIE die)> callback);
+ bool
+ ProcessFunctionDIE(const lldb_private::Module::LookupInfo &lookup_info,
+ DIERef ref, SymbolFileDWARF &dwarf,
+ const lldb_private::CompilerDeclContext &parent_decl_ctx,
+ llvm::function_ref<bool(DWARFDIE die)> callback);
class DIERefCallbackImpl {
public:
@@ -102,6 +105,6 @@ class DWARFIndex {
void ReportInvalidDIERef(DIERef ref, llvm::StringRef name) const;
};
-} // namespace lldb_private
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFINDEX_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
index 87af7177ca95ee9..cdacd8425bb8ed4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
@@ -13,6 +13,7 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
void DWARFTypeUnit::Dump(Stream *s) const {
s->Format("{0:x16}: Type Unit: length = {1:x8}, version = {2:x4}, "
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
index 5d939582a312e98..5a85a9dec002fa1 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
@@ -14,8 +14,9 @@
namespace llvm {
class DWARFAbbreviationDeclarationSet;
-}
+} // namespace llvm
+namespace lldb_plugin::dwarf {
class DWARFTypeUnit : public DWARFUnit {
public:
void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges) override {}
@@ -37,5 +38,6 @@ class DWARFTypeUnit : public DWARFUnit {
friend class DWARFUnit;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFTYPEUNIT_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
index b51cf04c7b724e5..cf6402ecb77a78d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -28,6 +28,7 @@
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
extern int g_verbose;
@@ -201,8 +202,8 @@ DWARFUnit::ScopedExtractDIEs::ScopedExtractDIEs(ScopedExtractDIEs &&rhs)
rhs.m_cu = nullptr;
}
-DWARFUnit::ScopedExtractDIEs &DWARFUnit::ScopedExtractDIEs::operator=(
- DWARFUnit::ScopedExtractDIEs &&rhs) {
+DWARFUnit::ScopedExtractDIEs &
+DWARFUnit::ScopedExtractDIEs::operator=(DWARFUnit::ScopedExtractDIEs &&rhs) {
m_cu = rhs.m_cu;
rhs.m_cu = nullptr;
m_clear_dies = rhs.m_clear_dies;
@@ -311,9 +312,9 @@ void DWARFUnit::ExtractDIEsRWLocked() {
}
if (!m_die_array.empty()) {
- // The last die cannot have children (if it did, it wouldn't be the last one).
- // This only makes a difference for malformed dwarf that does not have a
- // terminating null die.
+ // The last die cannot have children (if it did, it wouldn't be the last
+ // one). This only makes a difference for malformed dwarf that does not have
+ // a terminating null die.
m_die_array.back().SetHasChildren(false);
if (m_first_die) {
@@ -720,7 +721,7 @@ void DWARFUnit::ParseProducerInfo() {
llvm::SmallVector<llvm::StringRef, 3> matches;
if (g_swiftlang_version_regex.Execute(producer, &matches)) {
- m_producer_version.tryParse(matches[1]);
+ m_producer_version.tryParse(matches[1]);
m_producer = eProducerSwift;
} else if (producer.contains("clang")) {
if (g_clang_version_regex.Execute(producer, &matches))
@@ -1086,22 +1087,20 @@ DWARFUnit::FindRnglistFromOffset(dw_offset_t offset) {
return ranges;
}
-llvm::Expected<DWARFRangeList>
-DWARFUnit::FindRnglistFromIndex(uint32_t index) {
+llvm::Expected<DWARFRangeList> DWARFUnit::FindRnglistFromIndex(uint32_t index) {
llvm::Expected<uint64_t> maybe_offset = GetRnglistOffset(index);
if (!maybe_offset)
return maybe_offset.takeError();
return FindRnglistFromOffset(*maybe_offset);
}
-
bool DWARFUnit::HasAny(llvm::ArrayRef<dw_tag_t> tags) {
ExtractUnitDIEIfNeeded();
if (m_dwo)
return m_dwo->HasAny(tags);
- for (const auto &die: m_die_array) {
- for (const auto tag: tags) {
+ for (const auto &die : m_die_array) {
+ for (const auto tag : tags) {
if (tag == die.Tag())
return true;
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
index 20871d805e77a87..ec8a6241660f6f1 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -19,6 +19,7 @@
#include <atomic>
#include <optional>
+namespace lldb_plugin::dwarf {
class DWARFUnit;
class DWARFCompileUnit;
class NameToDIE;
@@ -80,8 +81,7 @@ class DWARFUnitHeader {
static llvm::Expected<DWARFUnitHeader>
extract(const lldb_private::DWARFDataExtractor &data, DIERef::Section section,
- lldb_private::DWARFContext &dwarf_context,
- lldb::offset_t *offset_ptr);
+ DWARFContext &dwarf_context, lldb::offset_t *offset_ptr);
};
class DWARFUnit : public lldb_private::UserID {
@@ -104,6 +104,7 @@ class DWARFUnit : public lldb_private::UserID {
class ScopedExtractDIEs {
DWARFUnit *m_cu;
+
public:
bool m_clear_dies = false;
ScopedExtractDIEs(DWARFUnit &cu);
@@ -227,7 +228,9 @@ class DWARFUnit : public lldb_private::UserID {
uint8_t GetUnitType() const { return m_header.GetUnitType(); }
bool IsTypeUnit() const { return m_header.IsTypeUnit(); }
/// Note that this check only works for DWARF5+.
- bool IsSkeletonUnit() const { return GetUnitType() == llvm::dwarf::DW_UT_skeleton; }
+ bool IsSkeletonUnit() const {
+ return GetUnitType() == llvm::dwarf::DW_UT_skeleton;
+ }
std::optional<uint64_t> GetStringOffsetSectionItem(uint32_t index) const;
@@ -272,7 +275,6 @@ class DWARFUnit : public lldb_private::UserID {
/// True if any DIEs match any tag in \a tags, false otherwise.
bool HasAny(llvm::ArrayRef<dw_tag_t> tags);
-
/// Get the fission .dwo file specific error for this compile unit.
///
/// The skeleton compile unit only can have a DWO error. Any other type
@@ -351,9 +353,9 @@ class DWARFUnit : public lldb_private::UserID {
lldb_private::LazyBool m_is_optimized = lldb_private::eLazyBoolCalculate;
std::optional<lldb_private::FileSpec> m_comp_dir;
std::optional<lldb_private::FileSpec> m_file_spec;
- std::optional<dw_addr_t> m_addr_base; ///< Value of DW_AT_addr_base.
- dw_addr_t m_loclists_base = 0; ///< Value of DW_AT_loclists_base.
- dw_addr_t m_ranges_base = 0; ///< Value of DW_AT_rnglists_base.
+ std::optional<dw_addr_t> m_addr_base; ///< Value of DW_AT_addr_base.
+ dw_addr_t m_loclists_base = 0; ///< Value of DW_AT_loclists_base.
+ dw_addr_t m_ranges_base = 0; ///< Value of DW_AT_rnglists_base.
std::optional<uint64_t> m_gnu_addr_base;
std::optional<uint64_t> m_gnu_ranges_base;
@@ -390,5 +392,6 @@ class DWARFUnit : public lldb_private::UserID {
DWARFUnit(const DWARFUnit &) = delete;
const DWARFUnit &operator=(const DWARFUnit &) = delete;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFUNIT_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
index af2d6c554140bc0..748267e3c8bd010 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -18,6 +18,7 @@
using namespace lldb_private;
using namespace lldb;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
llvm::Expected<std::unique_ptr<DebugNamesDWARFIndex>>
DebugNamesDWARFIndex::Create(Module &module, DWARFDataExtractor debug_names,
@@ -227,7 +228,7 @@ void DebugNamesDWARFIndex::GetNamespaces(
ConstString name, llvm::function_ref<bool(DWARFDIE die)> callback) {
for (const DebugNames::Entry &entry :
m_debug_names_up->equal_range(name.GetStringRef())) {
- dwarf::Tag entry_tag = entry.tag();
+ lldb_private::dwarf::Tag entry_tag = entry.tag();
if (entry_tag == DW_TAG_namespace ||
entry_tag == DW_TAG_imported_declaration) {
if (!ProcessEntry(entry, callback))
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
index abbd700f1603feb..938b3e50ec0fba5 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
@@ -17,50 +17,51 @@
#include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h"
#include <optional>
-namespace lldb_private {
+namespace lldb_plugin::dwarf {
class DebugNamesDWARFIndex : public DWARFIndex {
public:
static llvm::Expected<std::unique_ptr<DebugNamesDWARFIndex>>
- Create(Module &module, DWARFDataExtractor debug_names,
- DWARFDataExtractor debug_str, SymbolFileDWARF &dwarf);
+ Create(lldb_private::Module &module,
+ lldb_private::DWARFDataExtractor debug_names,
+ lldb_private::DWARFDataExtractor debug_str, SymbolFileDWARF &dwarf);
void Preload() override { m_fallback.Preload(); }
void
- GetGlobalVariables(ConstString basename,
+ GetGlobalVariables(lldb_private::ConstString basename,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void
- GetGlobalVariables(const RegularExpression ®ex,
+ GetGlobalVariables(const lldb_private::RegularExpression ®ex,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void
GetGlobalVariables(DWARFUnit &cu,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void
- GetObjCMethods(ConstString class_name,
+ GetObjCMethods(lldb_private::ConstString class_name,
llvm::function_ref<bool(DWARFDIE die)> callback) override {}
void GetCompleteObjCClass(
- ConstString class_name, bool must_be_implementation,
+ lldb_private::ConstString class_name, bool must_be_implementation,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetTypes(ConstString name,
+ void GetTypes(lldb_private::ConstString name,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void GetTypes(const DWARFDeclContext &context,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetNamespaces(ConstString name,
+ void GetNamespaces(lldb_private::ConstString name,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetFunctions(const Module::LookupInfo &lookup_info,
+ void GetFunctions(const lldb_private::Module::LookupInfo &lookup_info,
SymbolFileDWARF &dwarf,
- const CompilerDeclContext &parent_decl_ctx,
+ const lldb_private::CompilerDeclContext &parent_decl_ctx,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetFunctions(const RegularExpression ®ex,
+ void GetFunctions(const lldb_private::RegularExpression ®ex,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void Dump(Stream &s) override;
+ void Dump(lldb_private::Stream &s) override;
private:
- DebugNamesDWARFIndex(Module &module,
+ DebugNamesDWARFIndex(lldb_private::Module &module,
std::unique_ptr<llvm::DWARFDebugNames> debug_names_up,
- DWARFDataExtractor debug_names_data,
- DWARFDataExtractor debug_str_data,
+ lldb_private::DWARFDataExtractor debug_names_data,
+ lldb_private::DWARFDataExtractor debug_str_data,
SymbolFileDWARF &dwarf)
: DWARFIndex(module), m_debug_info(dwarf.DebugInfo()),
m_debug_names_data(debug_names_data), m_debug_str_data(debug_str_data),
@@ -71,8 +72,8 @@ class DebugNamesDWARFIndex : public DWARFIndex {
// LLVM DWARFDebugNames will hold a non-owning reference to this data, so keep
// track of the ownership here.
- DWARFDataExtractor m_debug_names_data;
- DWARFDataExtractor m_debug_str_data;
+ lldb_private::DWARFDataExtractor m_debug_names_data;
+ lldb_private::DWARFDataExtractor m_debug_str_data;
using DebugNames = llvm::DWARFDebugNames;
std::unique_ptr<DebugNames> m_debug_names_up;
@@ -89,6 +90,6 @@ class DebugNamesDWARFIndex : public DWARFIndex {
static llvm::DenseSet<dw_offset_t> GetUnits(const DebugNames &debug_names);
};
-} // namespace lldb_private
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DEBUGNAMESDWARFINDEX_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
index 90f18c96afa230e..d4a4cbcc0f5326f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
@@ -28,6 +28,7 @@
using namespace lldb_private;
using namespace lldb;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
void ManualDWARFIndex::Index() {
if (m_indexed)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
index d95cf501face8e4..cd5527459b86d22 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
@@ -13,13 +13,13 @@
#include "Plugins/SymbolFile/DWARF/NameToDIE.h"
#include "llvm/ADT/DenseSet.h"
+namespace lldb_plugin::dwarf {
class DWARFDebugInfo;
class SymbolFileDWARFDwo;
-namespace lldb_private {
class ManualDWARFIndex : public DWARFIndex {
public:
- ManualDWARFIndex(Module &module, SymbolFileDWARF &dwarf,
+ ManualDWARFIndex(lldb_private::Module &module, SymbolFileDWARF &dwarf,
llvm::DenseSet<dw_offset_t> units_to_avoid = {})
: DWARFIndex(module), m_dwarf(&dwarf),
m_units_to_avoid(std::move(units_to_avoid)) {}
@@ -27,33 +27,33 @@ class ManualDWARFIndex : public DWARFIndex {
void Preload() override { Index(); }
void
- GetGlobalVariables(ConstString basename,
+ GetGlobalVariables(lldb_private::ConstString basename,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void
- GetGlobalVariables(const RegularExpression ®ex,
+ GetGlobalVariables(const lldb_private::RegularExpression ®ex,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void
GetGlobalVariables(DWARFUnit &unit,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetObjCMethods(ConstString class_name,
+ void GetObjCMethods(lldb_private::ConstString class_name,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void GetCompleteObjCClass(
- ConstString class_name, bool must_be_implementation,
+ lldb_private::ConstString class_name, bool must_be_implementation,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetTypes(ConstString name,
+ void GetTypes(lldb_private::ConstString name,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
void GetTypes(const DWARFDeclContext &context,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetNamespaces(ConstString name,
+ void GetNamespaces(lldb_private::ConstString name,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetFunctions(const Module::LookupInfo &lookup_info,
+ void GetFunctions(const lldb_private::Module::LookupInfo &lookup_info,
SymbolFileDWARF &dwarf,
- const CompilerDeclContext &parent_decl_ctx,
+ const lldb_private::CompilerDeclContext &parent_decl_ctx,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void GetFunctions(const RegularExpression ®ex,
+ void GetFunctions(const lldb_private::RegularExpression ®ex,
llvm::function_ref<bool(DWARFDIE die)> callback) override;
- void Dump(Stream &s) override;
+ void Dump(lldb_private::Stream &s) override;
// Make IndexSet public so we can unit test the encoding and decoding logic.
struct IndexSet {
@@ -65,8 +65,9 @@ class ManualDWARFIndex : public DWARFIndex {
NameToDIE globals;
NameToDIE types;
NameToDIE namespaces;
- bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr);
- void Encode(DataEncoder &encoder) const;
+ bool Decode(const lldb_private::DataExtractor &data,
+ lldb::offset_t *offset_ptr);
+ void Encode(lldb_private::DataEncoder &encoder) const;
bool operator==(const IndexSet &rhs) const {
return function_basenames == rhs.function_basenames &&
function_fullnames == rhs.function_fullnames &&
@@ -94,8 +95,8 @@ class ManualDWARFIndex : public DWARFIndex {
/// All strings in cache files are put into string tables for efficiency
/// and cache file size reduction. Strings are stored as uint32_t string
/// table offsets in the cache data.
- bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr,
- bool &signature_mismatch);
+ bool Decode(const lldb_private::DataExtractor &data,
+ lldb::offset_t *offset_ptr, bool &signature_mismatch);
/// Encode this object into a data encoder object.
///
@@ -112,7 +113,7 @@ class ManualDWARFIndex : public DWARFIndex {
/// \return
/// True if the symbol table's object file can generate a valid signature
/// and all data for the symbol table was encoded, false otherwise.
- bool Encode(DataEncoder &encoder) const;
+ bool Encode(lldb_private::DataEncoder &encoder) const;
/// Get the cache key string for this symbol table.
///
@@ -173,6 +174,6 @@ class ManualDWARFIndex : public DWARFIndex {
IndexSet m_set;
bool m_indexed = false;
};
-} // namespace lldb_private
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_MANUALDWARFINDEX_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
index 89e628f5eaf1c47..555c9ca2275a007 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
@@ -20,6 +20,7 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
void NameToDIE::Finalize() {
m_map.Sort(std::less<DIERef>());
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
index 61df1a628ab5913..4617abc4fca30ef 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
@@ -16,6 +16,7 @@
#include "lldb/Core/dwarf.h"
#include "lldb/lldb-defines.h"
+namespace lldb_plugin::dwarf {
class DWARFUnit;
class NameToDIE {
@@ -45,8 +46,7 @@ class NameToDIE {
void
ForEach(std::function<bool(lldb_private::ConstString name,
- const DIERef &die_ref)> const
- &callback) const;
+ const DIERef &die_ref)> const &callback) const;
/// Decode a serialized version of this object from data.
///
@@ -89,5 +89,6 @@ class NameToDIE {
protected:
lldb_private::UniqueCStringMap<DIERef> m_map;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_NAMETODIE_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index e472074545a6f07..c6574881e0576c2 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -97,6 +97,7 @@
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
LLDB_PLUGIN_DEFINE(SymbolFileDWARF)
@@ -136,9 +137,8 @@ static PluginProperties &GetGlobalPluginProperties() {
}
static const llvm::DWARFDebugLine::LineTable *
-ParseLLVMLineTable(lldb_private::DWARFContext &context,
- llvm::DWARFDebugLine &line, dw_offset_t line_offset,
- dw_offset_t unit_offset) {
+ParseLLVMLineTable(DWARFContext &context, llvm::DWARFDebugLine &line,
+ dw_offset_t line_offset, dw_offset_t unit_offset) {
Log *log = GetLog(DWARFLog::DebugInfo);
llvm::DWARFDataExtractor data = context.getOrLoadLineData().GetAsLLVMDWARF();
@@ -159,7 +159,7 @@ ParseLLVMLineTable(lldb_private::DWARFContext &context,
return *line_table;
}
-static bool ParseLLVMLineTablePrologue(lldb_private::DWARFContext &context,
+static bool ParseLLVMLineTablePrologue(DWARFContext &context,
llvm::DWARFDebugLine::Prologue &prologue,
dw_offset_t line_offset,
dw_offset_t unit_offset) {
@@ -2428,7 +2428,7 @@ bool SymbolFileDWARF::DIEInDeclContext(const CompilerDeclContext &decl_ctx,
// ...But if we are only checking root decl contexts, confirm that the
// 'die' is a top-level context.
if (only_root_namespaces)
- return die.GetParent().Tag() == dwarf::DW_TAG_compile_unit;
+ return die.GetParent().Tag() == llvm::dwarf::DW_TAG_compile_unit;
return true;
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index 5aaf8bd270ef7b1..f0cf57b776bb105 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -38,6 +38,9 @@
#include "DWARFIndex.h"
#include "UniqueDWARFASTType.h"
+class DWARFASTParserClang;
+
+namespace lldb_plugin::dwarf {
// Forward Declarations for this DWARF plugin
class DebugMapModule;
class DWARFCompileUnit;
@@ -78,7 +81,7 @@ class SymbolFileDWARF : public lldb_private::SymbolFileCommon {
friend class DebugMapModule;
friend class DWARFCompileUnit;
friend class DWARFDIE;
- friend class DWARFASTParserClang;
+ friend class ::DWARFASTParserClang;
// Static Functions
static void Initialize();
@@ -285,7 +288,7 @@ class SymbolFileDWARF : public lldb_private::SymbolFileCommon {
void DumpClangAST(lldb_private::Stream &s) override;
- lldb_private::DWARFContext &GetDWARFContext() { return m_context; }
+ DWARFContext &GetDWARFContext() { return m_context; }
const std::shared_ptr<SymbolFileDWARFDwo> &GetDwpSymbolFile();
@@ -534,7 +537,7 @@ class SymbolFileDWARF : public lldb_private::SymbolFileCommon {
llvm::once_flag m_dwp_symfile_once_flag;
std::shared_ptr<SymbolFileDWARFDwo> m_dwp_symfile;
- lldb_private::DWARFContext m_context;
+ DWARFContext m_context;
llvm::once_flag m_info_once_flag;
std::unique_ptr<DWARFDebugInfo> m_info;
@@ -547,7 +550,7 @@ class SymbolFileDWARF : public lldb_private::SymbolFileCommon {
DebugMacrosMap m_debug_macros_map;
ExternalTypeModuleMap m_external_type_modules;
- std::unique_ptr<lldb_private::DWARFIndex> m_index;
+ std::unique_ptr<DWARFIndex> m_index;
bool m_fetched_external_modules : 1;
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
@@ -578,5 +581,6 @@ class SymbolFileDWARF : public lldb_private::SymbolFileCommon {
/// an index that identifies the .DWO or .o file.
std::optional<uint64_t> m_file_index;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARF_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index eadedd32e1a4aaf..afd3a9a5c27b08c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -42,6 +42,7 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
char SymbolFileDWARFDebugMap::ID;
@@ -166,6 +167,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(
return file_range_map;
}
+namespace lldb_plugin::dwarf {
class DebugMapModule : public Module {
public:
DebugMapModule(const ModuleSP &exe_module_sp, uint32_t cu_idx,
@@ -222,6 +224,7 @@ class DebugMapModule : public Module {
ModuleWP m_exe_module_wp;
const uint32_t m_cu_idx;
};
+} // namespace lldb_plugin::dwarf
void SymbolFileDWARFDebugMap::Initialize() {
PluginManager::RegisterPlugin(GetPluginNameStatic(),
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
index 881fd4c45ff05a0..d9ad4f0ac077c29 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -20,6 +20,9 @@
#include "UniqueDWARFASTType.h"
+class DWARFASTParserClang;
+
+namespace lldb_plugin::dwarf {
class SymbolFileDWARF;
class DWARFCompileUnit;
class DWARFDebugAranges;
@@ -161,7 +164,7 @@ class SymbolFileDWARFDebugMap : public lldb_private::SymbolFileCommon {
enum { kHaveInitializedOSOs = (1 << 0), kNumFlags };
friend class DebugMapModule;
- friend class DWARFASTParserClang;
+ friend class ::DWARFASTParserClang;
friend class DWARFCompileUnit;
friend class SymbolFileDWARF;
struct OSOInfo {
@@ -296,9 +299,10 @@ class SymbolFileDWARFDebugMap : public lldb_private::SymbolFileCommon {
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso);
- lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
- const DWARFDIE &die, lldb_private::ConstString type_name,
- bool must_be_implementation);
+ lldb::TypeSP
+ FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die,
+ lldb_private::ConstString type_name,
+ bool must_be_implementation);
UniqueDWARFASTTypeMap &GetUniqueDWARFASTTypeMap() {
return m_unique_ast_type_map;
@@ -403,5 +407,6 @@ class SymbolFileDWARFDebugMap : public lldb_private::SymbolFileCommon {
size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data,
DWARFDebugAranges *debug_aranges);
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDEBUGMAP_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
index 78c3c19684e116d..3d92a9c384fb491 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -21,6 +21,7 @@
using namespace lldb;
using namespace lldb_private;
+using namespace lldb_plugin::dwarf;
char SymbolFileDWARFDwo::ID;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
index e98ea49d939baf0..22aba785670e228 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -12,6 +12,7 @@
#include "SymbolFileDWARF.h"
#include <optional>
+namespace lldb_plugin::dwarf {
class SymbolFileDWARFDwo : public SymbolFileDWARF {
/// LLVM RTTI support.
static char ID;
@@ -65,9 +66,10 @@ class SymbolFileDWARFDwo : public SymbolFileDWARF {
lldb::TypeSP
FindDefinitionTypeForDWARFDeclContext(const DWARFDIE &die) override;
- lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
- const DWARFDIE &die, lldb_private::ConstString type_name,
- bool must_be_implementation) override;
+ lldb::TypeSP
+ FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die,
+ lldb_private::ConstString type_name,
+ bool must_be_implementation) override;
SymbolFileDWARF &GetBaseSymbolFile() const { return m_base_symbol_file; }
@@ -77,5 +79,6 @@ class SymbolFileDWARFDwo : public SymbolFileDWARF {
SymbolFileDWARF &m_base_symbol_file;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_SYMBOLFILEDWARFDWO_H
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
index 22a921cf61389bc..7378b2502dc9358 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
@@ -11,6 +11,7 @@
#include "lldb/Core/Declaration.h"
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
bool UniqueDWARFASTTypeList::Find(const DWARFDIE &die,
const lldb_private::Declaration &decl,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h
index 0947d1e581c5237..6f8ef5d9049e3e9 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h
@@ -16,6 +16,7 @@
#include "DWARFDIE.h"
#include "lldb/Core/Declaration.h"
+namespace lldb_plugin::dwarf {
class UniqueDWARFASTType {
public:
// Constructors and Destructors
@@ -74,8 +75,7 @@ class UniqueDWARFASTTypeMap {
~UniqueDWARFASTTypeMap() = default;
- void Insert(lldb_private::ConstString name,
- const UniqueDWARFASTType &entry) {
+ void Insert(lldb_private::ConstString name, const UniqueDWARFASTType &entry) {
m_collection[name.GetCString()].Append(entry);
}
@@ -95,5 +95,6 @@ class UniqueDWARFASTTypeMap {
typedef llvm::DenseMap<const char *, UniqueDWARFASTTypeList> collection;
collection m_collection;
};
+} // namespace lldb_plugin::dwarf
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_UNIQUEDWARFASTTYPE_H
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 69cff0f35ae4ab2..9ca735e5820db57 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -86,6 +86,7 @@
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::dwarf;
+using namespace lldb_plugin::dwarf;
using namespace clang;
using llvm::StringSwitch;
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
index 0544de3cd33befb..b18a7b31cf7acc0 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
@@ -514,7 +514,7 @@ class TypeSystemClang : public TypeSystem {
size_t bit_size);
// TypeSystem methods
- DWARFASTParser *GetDWARFParser() override;
+ lldb_plugin::dwarf::DWARFASTParser *GetDWARFParser() override;
PDBASTParser *GetPDBParser() override;
npdb::PdbAstBuilder *GetNativePDBParser() override;
More information about the lldb-commits
mailing list