aboutsummaryrefslogtreecommitdiffstats
path: root/include/lldb/Symbol
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:50:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:50:09 +0000
commitf3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch)
tree48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /include/lldb/Symbol
parent2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff)
downloadsrc-f3fbd1c0586ff6ec7895991e6c28f61a503c36a8.tar.gz
src-f3fbd1c0586ff6ec7895991e6c28f61a503c36a8.zip
Vendor import of lldb release_39 branch r276489:vendor/lldb/lldb-release_39-r276489
Notes
Notes: svn path=/vendor/lldb/dist/; revision=303241 svn path=/vendor/lldb/lldb-release_39-r276489/; revision=303242; tag=vendor/lldb/lldb-release_39-r276489
Diffstat (limited to 'include/lldb/Symbol')
-rw-r--r--include/lldb/Symbol/ArmUnwindInfo.h1
-rw-r--r--include/lldb/Symbol/Block.h8
-rw-r--r--include/lldb/Symbol/ClangASTContext.h117
-rw-r--r--include/lldb/Symbol/ClangASTImporter.h42
-rw-r--r--include/lldb/Symbol/ClangUtil.h37
-rw-r--r--include/lldb/Symbol/CompactUnwindInfo.h10
-rw-r--r--include/lldb/Symbol/CompileUnit.h20
-rw-r--r--include/lldb/Symbol/CompilerDecl.h6
-rw-r--r--include/lldb/Symbol/CompilerDeclContext.h2
-rw-r--r--include/lldb/Symbol/CompilerType.h11
-rw-r--r--include/lldb/Symbol/DWARFCallFrameInfo.h7
-rw-r--r--include/lldb/Symbol/FuncUnwinders.h12
-rw-r--r--include/lldb/Symbol/Function.h8
-rw-r--r--include/lldb/Symbol/GoASTContext.h13
-rw-r--r--include/lldb/Symbol/JavaASTContext.h385
-rw-r--r--include/lldb/Symbol/LineEntry.h13
-rw-r--r--include/lldb/Symbol/ObjectFile.h36
-rw-r--r--include/lldb/Symbol/Symbol.h3
-rw-r--r--include/lldb/Symbol/SymbolContext.h3
-rw-r--r--include/lldb/Symbol/SymbolFile.h9
-rw-r--r--include/lldb/Symbol/SymbolVendor.h7
-rw-r--r--include/lldb/Symbol/Symtab.h15
-rw-r--r--include/lldb/Symbol/Type.h9
-rw-r--r--include/lldb/Symbol/TypeSystem.h43
-rw-r--r--include/lldb/Symbol/UnwindPlan.h8
-rw-r--r--include/lldb/Symbol/UnwindTable.h7
-rw-r--r--include/lldb/Symbol/Variable.h6
27 files changed, 710 insertions, 128 deletions
diff --git a/include/lldb/Symbol/ArmUnwindInfo.h b/include/lldb/Symbol/ArmUnwindInfo.h
index b19af23744a4..8c40f19d2859 100644
--- a/include/lldb/Symbol/ArmUnwindInfo.h
+++ b/include/lldb/Symbol/ArmUnwindInfo.h
@@ -14,7 +14,6 @@
#include "lldb/Core/DataExtractor.h"
#include "lldb/Core/RangeMap.h"
-#include "lldb/Host/Mutex.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/lldb-private.h"
diff --git a/include/lldb/Symbol/Block.h b/include/lldb/Symbol/Block.h
index 6c0793dda80f..6dbb9c56097b 100644
--- a/include/lldb/Symbol/Block.h
+++ b/include/lldb/Symbol/Block.h
@@ -310,8 +310,9 @@ public:
AppendBlockVariables (bool can_create,
bool get_child_block_variables,
bool stop_if_child_block_is_inlined_function,
+ const std::function<bool(Variable*)>& filter,
VariableList *variable_list);
-
+
//------------------------------------------------------------------
/// Appends the variables from this block, and optionally from all
/// parent blocks, to \a variable_list.
@@ -341,9 +342,10 @@ public:
/// variable_list.
//------------------------------------------------------------------
uint32_t
- AppendVariables (bool can_create,
- bool get_parent_variables,
+ AppendVariables (bool can_create,
+ bool get_parent_variables,
bool stop_if_block_is_inlined_function,
+ const std::function<bool(Variable*)>& filter,
VariableList *variable_list);
//------------------------------------------------------------------
diff --git a/include/lldb/Symbol/ClangASTContext.h b/include/lldb/Symbol/ClangASTContext.h
index bd3a113e6cc5..08f7b6b412dc 100644
--- a/include/lldb/Symbol/ClangASTContext.h
+++ b/include/lldb/Symbol/ClangASTContext.h
@@ -30,11 +30,14 @@
// Project includes
#include "Plugins/ExpressionParser/Clang/ClangPersistentVariables.h"
-#include "lldb/lldb-enumerations.h"
#include "lldb/Core/ClangForward.h"
#include "lldb/Core/ConstString.h"
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/TypeSystem.h"
+#include "lldb/lldb-enumerations.h"
+
+class DWARFASTParserClang;
+class PDBASTParser;
namespace lldb_private {
@@ -61,6 +64,9 @@ public:
~ClangASTContext() override;
+ void
+ Finalize() override;
+
//------------------------------------------------------------------
// PluginInterface functions
//------------------------------------------------------------------
@@ -127,7 +133,7 @@ public:
void
Clear();
-
+
const char *
GetTargetTriple ();
@@ -297,6 +303,11 @@ public:
}
CompilerType
+ CreateStructForIdentifier (const ConstString &type_name,
+ const std::initializer_list< std::pair < const char *, CompilerType > >& type_fields,
+ bool packed = false);
+
+ CompilerType
GetOrCreateStructForIdentifier (const ConstString &type_name,
const std::initializer_list< std::pair < const char *, CompilerType > >& type_fields,
bool packed = false);
@@ -422,6 +433,11 @@ public:
GetUniqueNamespaceDeclaration (const char *name,
clang::DeclContext *decl_ctx);
+ static clang::NamespaceDecl *
+ GetUniqueNamespaceDeclaration (clang::ASTContext *ast,
+ const char *name,
+ clang::DeclContext *decl_ctx);
+
//------------------------------------------------------------------
// Function Types
//------------------------------------------------------------------
@@ -465,6 +481,9 @@ public:
SetFunctionParameters (clang::FunctionDecl *function_decl,
clang::ParmVarDecl **params,
unsigned num_params);
+
+ CompilerType
+ CreateBlockPointerType (const CompilerType &function_type);
//------------------------------------------------------------------
// Array Types
@@ -513,7 +532,9 @@ public:
// TypeSystem methods
//------------------------------------------------------------------
DWARFASTParser *
- GetDWARFParser () override;
+ GetDWARFParser() override;
+ PDBASTParser *
+ GetPDBParser();
//------------------------------------------------------------------
// ClangASTContext callbacks for external source lookups.
@@ -536,12 +557,6 @@ public:
//----------------------------------------------------------------------
// CompilerDecl override functions
//----------------------------------------------------------------------
- lldb::VariableSP
- DeclGetVariable (void *opaque_decl) override;
-
- void
- DeclLinkToObject (void *opaque_decl, std::shared_ptr<void> object) override;
-
ConstString
DeclGetName (void *opaque_decl) override;
@@ -565,7 +580,9 @@ public:
//----------------------------------------------------------------------
std::vector<CompilerDecl>
- DeclContextFindDeclByName (void *opaque_decl_ctx, ConstString name) override;
+ DeclContextFindDeclByName (void *opaque_decl_ctx,
+ ConstString name,
+ const bool ignore_using_decls) override;
bool
DeclContextIsStructUnionOrClass (void *opaque_decl_ctx) override;
@@ -583,16 +600,6 @@ public:
ConstString *language_object_name_ptr) override;
//----------------------------------------------------------------------
- // Clang specific CompilerType predicates
- //----------------------------------------------------------------------
-
- static bool
- IsClangType (const CompilerType &ct)
- {
- return llvm::dyn_cast_or_null<ClangASTContext>(ct.GetTypeSystem()) != nullptr && ct.GetOpaqueQualType() != nullptr;
- }
-
- //----------------------------------------------------------------------
// Clang specific clang::DeclContext functions
//----------------------------------------------------------------------
@@ -678,8 +685,14 @@ public:
IsFunctionPointerType (lldb::opaque_compiler_type_t type) override;
bool
- IsIntegerType (lldb::opaque_compiler_type_t type, bool &is_signed) override;
+ IsBlockPointerType (lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) override;
+ bool
+ IsIntegerType (lldb::opaque_compiler_type_t type, bool &is_signed) override;
+
+ bool
+ IsEnumerationType (lldb::opaque_compiler_type_t type, bool &is_signed) override;
+
static bool
IsObjCClassType (const CompilerType& type);
@@ -694,7 +707,13 @@ public:
bool
IsPolymorphicClass (lldb::opaque_compiler_type_t type) override;
-
+
+ static bool
+ IsClassType(lldb::opaque_compiler_type_t type);
+
+ static bool
+ IsEnumType(lldb::opaque_compiler_type_t type);
+
bool
IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
CompilerType *target_type, // Can pass nullptr
@@ -824,9 +843,6 @@ public:
// If the current object represents a typedef type, get the underlying type
CompilerType
GetTypedefedType (lldb::opaque_compiler_type_t type) override;
-
- static CompilerType
- RemoveFastQualifiers (const CompilerType& type);
//----------------------------------------------------------------------
// Create related types using the current type's AST
@@ -1025,18 +1041,12 @@ public:
const char *name, // the full symbol name as seen in the symbol table (lldb::opaque_compiler_type_t type, "-[NString stringWithCString:]")
const CompilerType &method_compiler_type,
lldb::AccessType access,
- bool is_artificial);
+ bool is_artificial,
+ bool is_variadic);
static bool
SetHasExternalStorage (lldb::opaque_compiler_type_t type, bool has_extern);
-
- static bool
- CanImport (const CompilerType &type, lldb_private::ClangASTImporter &importer);
-
- static bool
- Import (const CompilerType &type, lldb_private::ClangASTImporter &importer);
-
static bool
GetHasExternalStorage (const CompilerType &type);
//------------------------------------------------------------------
@@ -1139,29 +1149,6 @@ public:
static clang::ObjCInterfaceDecl *
GetAsObjCInterfaceDecl (const CompilerType& type);
-
- static clang::QualType
- GetQualType (const CompilerType& type)
- {
- // Make sure we have a clang type before making a clang::QualType
- if (type.GetOpaqueQualType())
- {
- ClangASTContext *ast = llvm::dyn_cast_or_null<ClangASTContext>(type.GetTypeSystem());
- if (ast)
- return clang::QualType::getFromOpaquePtr(type.GetOpaqueQualType());
- }
- return clang::QualType();
- }
-
- static clang::QualType
- GetCanonicalQualType (const CompilerType& type)
- {
- // Make sure we have a clang type before making a clang::QualType
- ClangASTContext *ast = llvm::dyn_cast_or_null<ClangASTContext>(type.GetTypeSystem());
- if (ast)
- return clang::QualType::getFromOpaquePtr(type.GetOpaqueQualType()).getCanonicalType();
- return clang::QualType();
- }
clang::ClassTemplateDecl *
ParseClassTemplateDecl (clang::DeclContext *decl_ctx,
@@ -1182,26 +1169,30 @@ public:
clang::VarDecl *
CreateVariableDeclaration (clang::DeclContext *decl_context, const char *name, clang::QualType type);
-protected:
+ static lldb::opaque_compiler_type_t
+ GetOpaqueCompilerType(clang::ASTContext *ast, lldb::BasicType basic_type);
+
static clang::QualType
- GetQualType (lldb::opaque_compiler_type_t type)
+ GetQualType(lldb::opaque_compiler_type_t type)
{
if (type)
return clang::QualType::getFromOpaquePtr(type);
return clang::QualType();
}
-
+
static clang::QualType
- GetCanonicalQualType (lldb::opaque_compiler_type_t type)
+ GetCanonicalQualType(lldb::opaque_compiler_type_t type)
{
if (type)
return clang::QualType::getFromOpaquePtr(type).getCanonicalType();
return clang::QualType();
}
+protected:
//------------------------------------------------------------------
// Classes that inherit from ClangASTContext can see and modify these
//------------------------------------------------------------------
+ // clang-format off
std::string m_target_triple;
std::unique_ptr<clang::ASTContext> m_ast_ap;
std::unique_ptr<clang::LangOptions> m_language_options_ap;
@@ -1215,7 +1206,8 @@ protected:
std::unique_ptr<clang::IdentifierTable> m_identifier_table_ap;
std::unique_ptr<clang::SelectorTable> m_selector_table_ap;
std::unique_ptr<clang::Builtin::Context> m_builtins_ap;
- std::unique_ptr<DWARFASTParser> m_dwarf_ast_parser_ap;
+ std::unique_ptr<DWARFASTParserClang> m_dwarf_ast_parser_ap;
+ std::unique_ptr<PDBASTParser> m_pdb_ast_parser_ap;
std::unique_ptr<ClangASTSource> m_scratch_ast_source_ap;
std::unique_ptr<clang::MangleContext> m_mangle_ctx_ap;
CompleteTagDeclCallback m_callback_tag_decl;
@@ -1224,8 +1216,7 @@ protected:
uint32_t m_pointer_byte_size;
bool m_ast_owned;
bool m_can_evaluate_expressions;
- std::map<void *, std::shared_ptr<void>> m_decl_objects;
-
+ // clang-format on
private:
//------------------------------------------------------------------
// For ClangASTContext only
diff --git a/include/lldb/Symbol/ClangASTImporter.h b/include/lldb/Symbol/ClangASTImporter.h
index 8c3f8735c2e1..0ea7308d9541 100644
--- a/include/lldb/Symbol/ClangASTImporter.h
+++ b/include/lldb/Symbol/ClangASTImporter.h
@@ -19,6 +19,9 @@
// Other libraries and framework includes
#include "clang/AST/ASTImporter.h"
+#include "clang/AST/CharUnits.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemOptions.h"
@@ -26,6 +29,8 @@
#include "lldb/lldb-types.h"
#include "lldb/Symbol/CompilerDeclContext.h"
+#include "llvm/ADT/DenseMap.h"
+
namespace lldb_private {
class ClangASTMetrics
@@ -93,6 +98,16 @@ private:
class ClangASTImporter
{
public:
+ struct LayoutInfo
+ {
+ LayoutInfo() : bit_size(0), alignment(0), field_offsets(), base_offsets(), vbase_offsets() {}
+ uint64_t bit_size;
+ uint64_t alignment;
+ llvm::DenseMap<const clang::FieldDecl *, uint64_t> field_offsets;
+ llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> base_offsets;
+ llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> vbase_offsets;
+ };
+
ClangASTImporter () :
m_file_manager(clang::FileSystemOptions())
{
@@ -126,10 +141,28 @@ public:
DeportDecl (clang::ASTContext *dst_ctx,
clang::ASTContext *src_ctx,
clang::Decl *decl);
-
+
void
- CompleteDecl (clang::Decl *decl);
-
+ InsertRecordDecl(clang::RecordDecl *decl, const LayoutInfo &layout);
+
+ bool
+ LayoutRecordType(const clang::RecordDecl *record_decl, uint64_t &bit_size, uint64_t &alignment,
+ llvm::DenseMap<const clang::FieldDecl *, uint64_t> &field_offsets,
+ llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> &base_offsets,
+ llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> &vbase_offsets);
+
+ bool
+ CanImport(const CompilerType &type);
+
+ bool
+ Import(const CompilerType &type);
+
+ bool
+ CompleteType(const CompilerType &compiler_type);
+
+ void
+ CompleteDecl(clang::Decl *decl);
+
bool
CompleteTagDecl (clang::TagDecl *decl);
@@ -381,6 +414,9 @@ private:
GetDeclOrigin (const clang::Decl *decl);
clang::FileManager m_file_manager;
+ typedef llvm::DenseMap<const clang::RecordDecl *, LayoutInfo> RecordDeclToLayoutMap;
+
+ RecordDeclToLayoutMap m_record_decl_to_layout_map;
};
} // namespace lldb_private
diff --git a/include/lldb/Symbol/ClangUtil.h b/include/lldb/Symbol/ClangUtil.h
new file mode 100644
index 000000000000..ee9ff5678d79
--- /dev/null
+++ b/include/lldb/Symbol/ClangUtil.h
@@ -0,0 +1,37 @@
+//===-- ClangUtil.h ---------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+// A collection of helper methods and data structures for manipulating clang
+// types and decls.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SYMBOL_CLANGUTIL_H
+#define LLDB_SYMBOL_CLANGUTIL_H
+
+#include "clang/AST/Type.h"
+
+#include "lldb/Symbol/CompilerType.h"
+
+namespace lldb_private
+{
+struct ClangUtil
+{
+ static bool
+ IsClangType(const CompilerType &ct);
+
+ static clang::QualType
+ GetQualType(const CompilerType &ct);
+
+ static clang::QualType
+ GetCanonicalQualType(const CompilerType &ct);
+
+ static CompilerType
+ RemoveFastQualifiers(const CompilerType &ct);
+};
+}
+
+#endif
diff --git a/include/lldb/Symbol/CompactUnwindInfo.h b/include/lldb/Symbol/CompactUnwindInfo.h
index 239eb3ac77ad..6bf65a223471 100644
--- a/include/lldb/Symbol/CompactUnwindInfo.h
+++ b/include/lldb/Symbol/CompactUnwindInfo.h
@@ -10,11 +10,11 @@
#ifndef liblldb_CompactUnwindInfo_h_
#define liblldb_CompactUnwindInfo_h_
+#include <mutex>
#include <vector>
#include "lldb/Core/DataExtractor.h"
#include "lldb/Core/RangeMap.h"
-#include "lldb/Host/Mutex.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/lldb-private.h"
@@ -133,11 +133,17 @@ private:
bool
CreateUnwindPlan_i386 (Target &target, FunctionInfo &function_info, UnwindPlan &unwind_plan, Address pc_or_function_start);
+ bool
+ CreateUnwindPlan_arm64 (Target &target, FunctionInfo &function_info, UnwindPlan &unwind_plan, Address pc_or_function_start);
+
+ bool
+ CreateUnwindPlan_armv7 (Target &target, FunctionInfo &function_info, UnwindPlan &unwind_plan, Address pc_or_function_start);
+
ObjectFile &m_objfile;
lldb::SectionSP m_section_sp;
lldb::DataBufferSP m_section_contents_if_encrypted; // if the binary is encrypted, read the sect contents
// out of live memory and cache them here
- Mutex m_mutex;
+ std::mutex m_mutex;
std::vector<UnwindIndex> m_indexes;
LazyBool m_indexes_computed; // eLazyBoolYes once we've tried to parse the unwind info
diff --git a/include/lldb/Symbol/CompileUnit.h b/include/lldb/Symbol/CompileUnit.h
index 0c331c38f8c6..2f596f89ec5f 100644
--- a/include/lldb/Symbol/CompileUnit.h
+++ b/include/lldb/Symbol/CompileUnit.h
@@ -68,11 +68,16 @@ public:
/// of this compile unit.
///
/// @param[in] is_optimized
- /// true if this compile unit was compiled with optimization.
+ /// A value that can initialized with eLazyBoolYes, eLazyBoolNo
+ /// or eLazyBoolCalculate. If set to eLazyBoolCalculate, then
+ /// an extra call into SymbolVendor will be made to calculate if
+ /// the compile unit is optimized will be made when
+ /// CompileUnit::GetIsOptimized() is called.
///
/// @see lldb::LanguageType
//------------------------------------------------------------------
- CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const char *pathname, lldb::user_id_t uid, lldb::LanguageType language, bool is_optimized);
+ CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const char *pathname, lldb::user_id_t uid,
+ lldb::LanguageType language, lldb_private::LazyBool is_optimized);
//------------------------------------------------------------------
/// Construct with a module, file spec, UID and language.
@@ -103,11 +108,16 @@ public:
/// of this compile unit.
///
/// @param[in] is_optimized
- /// true if this compile unit was compiled with optimization.
+ /// A value that can initialized with eLazyBoolYes, eLazyBoolNo
+ /// or eLazyBoolCalculate. If set to eLazyBoolCalculate, then
+ /// an extra call into SymbolVendor will be made to calculate if
+ /// the compile unit is optimized will be made when
+ /// CompileUnit::GetIsOptimized() is called.
///
/// @see lldb::LanguageType
//------------------------------------------------------------------
- CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const FileSpec &file_spec, lldb::user_id_t uid, lldb::LanguageType language, bool is_optimized);
+ CompileUnit(const lldb::ModuleSP &module_sp, void *user_data, const FileSpec &file_spec, lldb::user_id_t uid,
+ lldb::LanguageType language, lldb_private::LazyBool is_optimized);
//------------------------------------------------------------------
/// Destructor
@@ -446,7 +456,7 @@ protected:
std::unique_ptr<LineTable> m_line_table_ap; ///< Line table that will get parsed on demand.
DebugMacrosSP m_debug_macros_sp; ///< Debug macros that will get parsed on demand.
lldb::VariableListSP m_variables; ///< Global and static variable list that will get parsed on demand.
- bool m_is_optimized; /// eLazyBoolYes if this compile unit was compiled with optimization.
+ lldb_private::LazyBool m_is_optimized; /// eLazyBoolYes if this compile unit was compiled with optimization.
private:
enum
diff --git a/include/lldb/Symbol/CompilerDecl.h b/include/lldb/Symbol/CompilerDecl.h
index b749e79b459a..19654ab165bb 100644
--- a/include/lldb/Symbol/CompilerDecl.h
+++ b/include/lldb/Symbol/CompilerDecl.h
@@ -65,12 +65,6 @@ public:
IsClang () const;
//----------------------------------------------------------------------
- // Object linked to the decl
- //----------------------------------------------------------------------
- lldb::VariableSP
- GetAsVariable ();
-
- //----------------------------------------------------------------------
// Accessors
//----------------------------------------------------------------------
diff --git a/include/lldb/Symbol/CompilerDeclContext.h b/include/lldb/Symbol/CompilerDeclContext.h
index 9135b44323b5..7432adac6133 100644
--- a/include/lldb/Symbol/CompilerDeclContext.h
+++ b/include/lldb/Symbol/CompilerDeclContext.h
@@ -66,7 +66,7 @@ public:
IsClang () const;
std::vector<CompilerDecl>
- FindDeclByName (ConstString name);
+ FindDeclByName (ConstString name, const bool ignore_using_decls);
//----------------------------------------------------------------------
/// Checks if this decl context represents a method of a class.
diff --git a/include/lldb/Symbol/CompilerType.h b/include/lldb/Symbol/CompilerType.h
index 4f3ecc54ba1a..36f6ef3ba6eb 100644
--- a/include/lldb/Symbol/CompilerType.h
+++ b/include/lldb/Symbol/CompilerType.h
@@ -149,9 +149,18 @@ public:
IsFunctionPointerType () const;
bool
- IsIntegerType (bool &is_signed) const;
+ IsBlockPointerType (CompilerType *function_pointer_type_ptr) const;
bool
+ IsIntegerType (bool &is_signed) const;
+
+ bool
+ IsEnumerationType (bool &is_signed) const;
+
+ bool
+ IsIntegerOrEnumerationType (bool &is_signed) const;
+
+ bool
IsPolymorphicClass () const;
bool
diff --git a/include/lldb/Symbol/DWARFCallFrameInfo.h b/include/lldb/Symbol/DWARFCallFrameInfo.h
index cc497c039a4e..da7f87ced0a0 100644
--- a/include/lldb/Symbol/DWARFCallFrameInfo.h
+++ b/include/lldb/Symbol/DWARFCallFrameInfo.h
@@ -11,6 +11,7 @@
#define liblldb_DWARFCallFrameInfo_h_
#include <map>
+#include <mutex>
#include "lldb/Core/AddressRange.h"
#include "lldb/Core/DataExtractor.h"
@@ -18,7 +19,6 @@
#include "lldb/Core/RangeMap.h"
#include "lldb/Core/VMRange.h"
#include "lldb/Core/dwarf.h"
-#include "lldb/Host/Mutex.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/lldb-private.h"
@@ -73,6 +73,9 @@ public:
void
GetFunctionAddressAndSizeVector (FunctionAddressAndSizeVector &function_info);
+ void
+ ForEachFDEEntries(const std::function<bool(lldb::addr_t, uint32_t, dw_offset_t)>& callback);
+
private:
enum
{
@@ -152,7 +155,7 @@ private:
FDEEntryMap m_fde_index;
bool m_fde_index_initialized; // only scan the section for FDEs once
- Mutex m_fde_index_mutex; // and isolate the thread that does it
+ std::mutex m_fde_index_mutex; // and isolate the thread that does it
bool m_is_eh_frame;
diff --git a/include/lldb/Symbol/FuncUnwinders.h b/include/lldb/Symbol/FuncUnwinders.h
index 728b4c6fcb32..6d5991cc2b33 100644
--- a/include/lldb/Symbol/FuncUnwinders.h
+++ b/include/lldb/Symbol/FuncUnwinders.h
@@ -1,12 +1,12 @@
#ifndef liblldb_FuncUnwinders_h
#define liblldb_FuncUnwinders_h
+#include <mutex>
#include <vector>
#include "lldb/Core/AddressRange.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/AddressRange.h"
-#include "lldb/Host/Mutex.h"
namespace lldb_private {
@@ -116,10 +116,18 @@ private:
lldb::UnwindAssemblySP
GetUnwindAssemblyProfiler (Target& target);
+ // Do a simplistic comparison for the register restore rule for getting
+ // the caller's pc value on two UnwindPlans -- returns LazyBoolYes if
+ // they have the same unwind rule for the pc, LazyBoolNo if they do not
+ // have the same unwind rule for the pc, and LazyBoolCalculate if it was
+ // unable to determine this for some reason.
+ lldb_private::LazyBool
+ CompareUnwindPlansForIdenticalInitialPCLocation (Thread& thread, const lldb::UnwindPlanSP &a, const lldb::UnwindPlanSP &b);
+
UnwindTable& m_unwind_table;
AddressRange m_range;
- Mutex m_mutex;
+ std::recursive_mutex m_mutex;
lldb::UnwindPlanSP m_unwind_plan_assembly_sp;
lldb::UnwindPlanSP m_unwind_plan_eh_frame_sp;
diff --git a/include/lldb/Symbol/Function.h b/include/lldb/Symbol/Function.h
index cd2df9b6078f..9892d620ce47 100644
--- a/include/lldb/Symbol/Function.h
+++ b/include/lldb/Symbol/Function.h
@@ -574,6 +574,14 @@ public:
CompilerType
GetCompilerType ();
+ //------------------------------------------------------------------
+ /// Get the size of the prologue instructions for this function. The "prologue"
+ /// instructions include any instructions given line number 0 immediately following
+ /// the prologue end.
+ ///
+ /// @return
+ /// The size of the prologue.
+ //------------------------------------------------------------------
uint32_t
GetPrologueByteSize ();
diff --git a/include/lldb/Symbol/GoASTContext.h b/include/lldb/Symbol/GoASTContext.h
index 09d79bacc585..ec0203bc3221 100644
--- a/include/lldb/Symbol/GoASTContext.h
+++ b/include/lldb/Symbol/GoASTContext.h
@@ -85,17 +85,6 @@ class GoASTContext : public TypeSystem
return ConstString();
}
- lldb::VariableSP
- DeclGetVariable (void *opaque_decl) override
- {
- return lldb::VariableSP();
- }
-
- void
- DeclLinkToObject (void *opaque_decl, std::shared_ptr<void> object) override
- {
- }
-
//----------------------------------------------------------------------
// CompilerDeclContext functions
//----------------------------------------------------------------------
@@ -176,6 +165,8 @@ class GoASTContext : public TypeSystem
CompilerType GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index) override;
bool IsFunctionPointerType(lldb::opaque_compiler_type_t type) override;
+
+ bool IsBlockPointerType (lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) override;
bool IsIntegerType(lldb::opaque_compiler_type_t type, bool &is_signed) override;
diff --git a/include/lldb/Symbol/JavaASTContext.h b/include/lldb/Symbol/JavaASTContext.h
new file mode 100644
index 000000000000..7d5a37649f6f
--- /dev/null
+++ b/include/lldb/Symbol/JavaASTContext.h
@@ -0,0 +1,385 @@
+//===-- JavaASTContext.h ----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_JavaASTContext_h_
+#define liblldb_JavaASTContext_h_
+
+// C Includes
+// C++ Includes
+#include <map>
+#include <memory>
+#include <set>
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/ConstString.h"
+#include "lldb/Symbol/TypeSystem.h"
+
+namespace lldb_private
+{
+
+class JavaASTContext : public TypeSystem
+{
+public:
+ class JavaType;
+ typedef std::map<ConstString, std::unique_ptr<JavaType>> JavaTypeMap;
+
+ JavaASTContext(const ArchSpec &arch);
+ ~JavaASTContext() override;
+
+ //------------------------------------------------------------------
+ // PluginInterface functions
+ //------------------------------------------------------------------
+ ConstString
+ GetPluginName() override;
+
+ uint32_t
+ GetPluginVersion() override;
+
+ static ConstString
+ GetPluginNameStatic();
+
+ static lldb::TypeSystemSP
+ CreateInstance(lldb::LanguageType language, Module *module, Target *target);
+
+ static void
+ EnumerateSupportedLanguages(std::set<lldb::LanguageType> &languages_for_types,
+ std::set<lldb::LanguageType> &languages_for_expressions);
+
+ static void
+ Initialize();
+
+ static void
+ Terminate();
+
+ DWARFASTParser *
+ GetDWARFParser() override;
+
+ uint32_t
+ GetPointerByteSize() override;
+
+ //----------------------------------------------------------------------
+ // CompilerDecl functions
+ //----------------------------------------------------------------------
+ ConstString
+ DeclGetName(void *opaque_decl) override;
+
+ //----------------------------------------------------------------------
+ // CompilerDeclContext functions
+ //----------------------------------------------------------------------
+
+ std::vector<CompilerDecl>
+ DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name, const bool ignore_imported_decls) override;
+
+ bool
+ DeclContextIsStructUnionOrClass(void *opaque_decl_ctx) override;
+
+ ConstString
+ DeclContextGetName(void *opaque_decl_ctx) override;
+
+ bool
+ DeclContextIsClassMethod(void *opaque_decl_ctx, lldb::LanguageType *language_ptr, bool *is_instance_method_ptr,
+ ConstString *language_object_name_ptr) override;
+
+ //----------------------------------------------------------------------
+ // Tests
+ //----------------------------------------------------------------------
+
+ bool
+ IsArrayType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size,
+ bool *is_incomplete) override;
+
+ bool
+ IsAggregateType(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsCharType(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsFloatingPointType(lldb::opaque_compiler_type_t type, uint32_t &count, bool &is_complex) override;
+
+ bool
+ IsFunctionType(lldb::opaque_compiler_type_t type, bool *is_variadic_ptr = nullptr) override;
+
+ size_t
+ GetNumberOfFunctionArguments(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetFunctionArgumentAtIndex(lldb::opaque_compiler_type_t type, const size_t index) override;
+
+ bool
+ IsFunctionPointerType(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsBlockPointerType (lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) override;
+
+ bool
+ IsIntegerType(lldb::opaque_compiler_type_t type, bool &is_signed) override;
+
+ bool
+ IsPossibleDynamicType(lldb::opaque_compiler_type_t type, CompilerType *target_type, bool check_cplusplus,
+ bool check_objc) override;
+
+ bool
+ IsPointerType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type = nullptr) override;
+
+ bool
+ IsReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type = nullptr,
+ bool *is_rvalue = nullptr) override;
+
+ bool
+ IsPointerOrReferenceType(lldb::opaque_compiler_type_t type, CompilerType *pointee_type = nullptr) override;
+
+ bool
+ IsScalarType(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsVoidType(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsCStringType(lldb::opaque_compiler_type_t type, uint32_t &length) override;
+
+ bool
+ IsRuntimeGeneratedType(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsTypedefType(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsVectorType(lldb::opaque_compiler_type_t type, CompilerType *element_type, uint64_t *size) override;
+
+ bool
+ IsPolymorphicClass(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsCompleteType(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsConst(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsBeingDefined(lldb::opaque_compiler_type_t type) override;
+
+ bool
+ IsDefined(lldb::opaque_compiler_type_t type) override;
+
+ uint32_t
+ IsHomogeneousAggregate(lldb::opaque_compiler_type_t type, CompilerType *base_type_ptr) override;
+
+ bool
+ SupportsLanguage(lldb::LanguageType language) override;
+
+ bool
+ GetCompleteType(lldb::opaque_compiler_type_t type) override;
+
+ ConstString
+ GetTypeName(lldb::opaque_compiler_type_t type) override;
+
+ uint32_t
+ GetTypeInfo(lldb::opaque_compiler_type_t type, CompilerType *pointee_or_element_compiler_type = nullptr) override;
+
+ lldb::TypeClass
+ GetTypeClass(lldb::opaque_compiler_type_t type) override;
+
+ lldb::LanguageType
+ GetMinimumLanguage(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetArrayElementType(lldb::opaque_compiler_type_t type, uint64_t *stride = nullptr) override;
+
+ CompilerType
+ GetPointeeType(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetPointerType(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetCanonicalType(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetNonReferenceType(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetTypedefedType(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetBasicTypeFromAST(lldb::BasicType basic_type) override;
+
+ CompilerType
+ GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size) override;
+
+ size_t
+ GetTypeBitAlign(lldb::opaque_compiler_type_t type) override;
+
+ lldb::BasicType
+ GetBasicTypeEnumeration(lldb::opaque_compiler_type_t type) override;
+
+ uint64_t
+ GetBitSize(lldb::opaque_compiler_type_t type, ExecutionContextScope *exe_scope) override;
+
+ lldb::Encoding
+ GetEncoding(lldb::opaque_compiler_type_t type, uint64_t &count) override;
+
+ lldb::Format
+ GetFormat(lldb::opaque_compiler_type_t type) override;
+
+ unsigned
+ GetTypeQualifiers(lldb::opaque_compiler_type_t type) override;
+
+ size_t
+ GetNumTemplateArguments(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetTemplateArgument(lldb::opaque_compiler_type_t type, size_t idx, lldb::TemplateArgumentKind &kind) override;
+
+ int
+ GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type, size_t idx) override;
+
+ CompilerType
+ GetFunctionReturnType(lldb::opaque_compiler_type_t type) override;
+
+ size_t
+ GetNumMemberFunctions(lldb::opaque_compiler_type_t type) override;
+
+ TypeMemberFunctionImpl
+ GetMemberFunctionAtIndex(lldb::opaque_compiler_type_t type, size_t idx) override;
+
+ uint32_t
+ GetNumFields(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetFieldAtIndex(lldb::opaque_compiler_type_t type, size_t idx, std::string &name, uint64_t *bit_offset_ptr,
+ uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) override;
+
+ uint32_t
+ GetNumChildren(lldb::opaque_compiler_type_t type, bool omit_empty_base_classes) override;
+
+ uint32_t
+ GetNumDirectBaseClasses(lldb::opaque_compiler_type_t type) override;
+
+ uint32_t
+ GetNumVirtualBaseClasses(lldb::opaque_compiler_type_t type) override;
+
+ CompilerType
+ GetDirectBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr) override;
+
+ CompilerType
+ GetVirtualBaseClassAtIndex(lldb::opaque_compiler_type_t type, size_t idx, uint32_t *bit_offset_ptr) override;
+
+ size_t
+ ConvertStringToFloatValue(lldb::opaque_compiler_type_t type, const char *s, uint8_t *dst, size_t dst_size) override;
+
+ void
+ DumpValue(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, lldb::Format format,
+ const DataExtractor &data, lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size,
+ uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth) override;
+
+ bool
+ DumpTypeValue(lldb::opaque_compiler_type_t type, Stream *s, lldb::Format format, const DataExtractor &data,
+ lldb::offset_t data_offset, size_t data_byte_size, uint32_t bitfield_bit_size,
+ uint32_t bitfield_bit_offset, ExecutionContextScope *exe_scope) override;
+
+ void
+ DumpTypeDescription(lldb::opaque_compiler_type_t type) override;
+
+ void
+ DumpTypeDescription(lldb::opaque_compiler_type_t type, Stream *s) override;
+
+ void
+ DumpSummary(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data,
+ lldb::offset_t data_offset, size_t data_byte_size) override;
+
+ CompilerType
+ GetChildCompilerTypeAtIndex(lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, size_t idx,
+ bool transparent_pointers, bool omit_empty_base_classes, bool ignore_array_bounds,
+ std::string &child_name, uint32_t &child_byte_size, int32_t &child_byte_offset,
+ uint32_t &child_bitfield_bit_size, uint32_t &child_bitfield_bit_offset,
+ bool &child_is_base_class, bool &child_is_deref_of_parent, ValueObject *valobj,
+ uint64_t &language_flags) override;
+
+ uint32_t
+ GetIndexOfChildWithName(lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes) override;
+
+ size_t
+ GetIndexOfChildMemberWithName(lldb::opaque_compiler_type_t type, const char *name, bool omit_empty_base_classes,
+ std::vector<uint32_t> &child_indexes) override;
+
+ CompilerType
+ GetLValueReferenceType(lldb::opaque_compiler_type_t type) override;
+
+ ConstString
+ DeclContextGetScopeQualifiedName(lldb::opaque_compiler_type_t opaque_decl_ctx) override;
+
+ CompilerType
+ CreateBaseType(const ConstString &name);
+
+ CompilerType
+ CreateObjectType(const ConstString &name, const ConstString &linkage_name, uint32_t byte_size);
+
+ CompilerType
+ CreateArrayType(const ConstString &linkage_name, const CompilerType &element_type,
+ const DWARFExpression &length_expression, const lldb::addr_t data_offset);
+
+ CompilerType
+ CreateReferenceType(const CompilerType &pointee_type);
+
+ void
+ CompleteObjectType(const CompilerType &object_type);
+
+ void
+ AddBaseClassToObject(const CompilerType &object_type, const CompilerType &member_type, uint32_t member_offset);
+
+ void
+ AddMemberToObject(const CompilerType &object_type, const ConstString &name, const CompilerType &member_type,
+ uint32_t member_offset);
+
+ void
+ SetDynamicTypeId(const CompilerType &type, const DWARFExpression &type_id);
+
+ static uint64_t
+ CalculateDynamicTypeId(ExecutionContext *exe_ctx, const CompilerType &type, ValueObject &in_value);
+
+ static ConstString
+ GetLinkageName(const CompilerType &type);
+
+ static uint32_t
+ CalculateArraySize(const CompilerType &type, ValueObject &in_value);
+
+ static uint64_t
+ CalculateArrayElementOffset(const CompilerType &type, size_t index);
+
+ //------------------------------------------------------------------
+ // llvm casting support
+ //------------------------------------------------------------------
+ static bool
+ classof(const TypeSystem *ts)
+ {
+ return ts->getKind() == TypeSystem::eKindJava;
+ }
+
+private:
+ uint32_t m_pointer_byte_size;
+ std::unique_ptr<DWARFASTParser> m_dwarf_ast_parser_ap;
+ JavaTypeMap m_array_type_map;
+ JavaTypeMap m_base_type_map;
+ JavaTypeMap m_reference_type_map;
+ JavaTypeMap m_object_type_map;
+
+ JavaASTContext(const JavaASTContext &) = delete;
+ const JavaASTContext &
+ operator=(const JavaASTContext &) = delete;
+};
+}
+#endif // liblldb_JavaASTContext_h_
diff --git a/include/lldb/Symbol/LineEntry.h b/include/lldb/Symbol/LineEntry.h
index 374c04a7fcec..e6a05c10a764 100644
--- a/include/lldb/Symbol/LineEntry.h
+++ b/include/lldb/Symbol/LineEntry.h
@@ -168,10 +168,21 @@ struct LineEntry
GetSameLineContiguousAddressRange () const;
//------------------------------------------------------------------
+ /// Apply file mappings from target.source-map to the LineEntry's file.
+ ///
+ /// @param[in] target_sp
+ /// Shared pointer to the target this LineEntry belongs to.
+ //------------------------------------------------------------------
+
+ void
+ ApplyFileMappings(lldb::TargetSP target_sp);
+
+ //------------------------------------------------------------------
// Member variables.
//------------------------------------------------------------------
AddressRange range; ///< The section offset address range for this line entry.
- FileSpec file;
+ FileSpec file; ///< The source file, possibly mapped by the target.source-map setting
+ FileSpec original_file; ///< The original source file, from debug info.
uint32_t line; ///< The source line number, or zero if there is no line number information.
uint16_t column; ///< The column number of the source line, or zero if there is no column information.
uint16_t is_start_of_statement:1, ///< Indicates this entry is the beginning of a statement.
diff --git a/include/lldb/Symbol/ObjectFile.h b/include/lldb/Symbol/ObjectFile.h
index 4b0a2f9ff936..53f0f3c80517 100644
--- a/include/lldb/Symbol/ObjectFile.h
+++ b/include/lldb/Symbol/ObjectFile.h
@@ -551,6 +551,35 @@ public:
GetUnwindTable () { return m_unwind_table; }
//------------------------------------------------------------------
+ /// Returns if the function bounds for symbols in this symbol file
+ /// are likely accurate.
+ ///
+ /// The unwinder can emulate the instructions of functions to understand
+ /// prologue/epilogue code sequences, where registers are spilled on
+ /// the stack, etc. This feature relies on having the correct start
+ /// addresses of all functions. If the ObjectFile has a way to tell
+ /// that symbols have been stripped and there's no way to reconstruct
+ /// start addresses (e.g. LC_FUNCTION_STARTS on Mach-O, or eh_frame
+ /// unwind info), the ObjectFile should indicate that assembly emulation
+ /// should not be used for this module.
+ ///
+ /// It is uncommon for this to return false. An ObjectFile needs to
+ /// be sure that symbol start addresses are unavailable before false
+ /// is returned. If it is unclear, this should return true.
+ ///
+ /// @return
+ /// Returns true if assembly emulation should be used for this
+ /// module.
+ /// Only returns false if the ObjectFile is sure that symbol
+ /// addresses are insufficient for accurate assembly emulation.
+ //------------------------------------------------------------------
+ virtual bool
+ AllowAssemblyEmulationUnwindPlans ()
+ {
+ return true;
+ }
+
+ //------------------------------------------------------------------
/// Similar to Process::GetImageInfoAddress().
///
/// Some platforms embed auxiliary structures useful to debuggers in the
@@ -860,6 +889,7 @@ protected:
const lldb::addr_t m_memory_addr;
std::unique_ptr<lldb_private::SectionList> m_sections_ap;
std::unique_ptr<lldb_private::Symtab> m_symtab_ap;
+ uint32_t m_synthetic_symbol_idx;
//------------------------------------------------------------------
/// Sets the architecture for a module. At present the architecture
@@ -873,7 +903,11 @@ protected:
/// Returns \b true if the architecture was changed, \b
/// false otherwise.
//------------------------------------------------------------------
- bool SetModulesArchitecture (const ArchSpec &new_arch);
+ bool
+ SetModulesArchitecture (const ArchSpec &new_arch);
+
+ ConstString
+ GetNextSyntheticSymbolName();
private:
DISALLOW_COPY_AND_ASSIGN (ObjectFile);
diff --git a/include/lldb/Symbol/Symbol.h b/include/lldb/Symbol/Symbol.h
index c77d3dea4bd2..43f29f368d92 100644
--- a/include/lldb/Symbol/Symbol.h
+++ b/include/lldb/Symbol/Symbol.h
@@ -383,6 +383,9 @@ public:
bool prefer_file_cache,
Stream &strm);
+ bool
+ ContainsFileAddress (lldb::addr_t file_addr) const;
+
protected:
// This is the internal guts of ResolveReExportedSymbol, it assumes reexport_name is not null, and that module_spec
// is valid. We track the modules we've already seen to make sure we don't get caught in a cycle.
diff --git a/include/lldb/Symbol/SymbolContext.h b/include/lldb/Symbol/SymbolContext.h
index 9cb709d24011..f0e8e3590a8a 100644
--- a/include/lldb/Symbol/SymbolContext.h
+++ b/include/lldb/Symbol/SymbolContext.h
@@ -244,6 +244,9 @@ public:
uint32_t range_idx,
bool use_inline_block_range,
AddressRange &range) const;
+
+ bool
+ GetAddressRangeFromHereToEndLine(uint32_t end_line, AddressRange &range, Error &error);
void
GetDescription(Stream *s,
diff --git a/include/lldb/Symbol/SymbolFile.h b/include/lldb/Symbol/SymbolFile.h
index fe74ad4f933e..db97ab4f9b65 100644
--- a/include/lldb/Symbol/SymbolFile.h
+++ b/include/lldb/Symbol/SymbolFile.h
@@ -17,6 +17,8 @@
#include "lldb/Symbol/CompilerDeclContext.h"
#include "lldb/Symbol/Type.h"
+#include "llvm/ADT/DenseSet.h"
+
namespace lldb_private {
class SymbolFile :
@@ -125,6 +127,11 @@ public:
virtual bool ParseCompileUnitLineTable (const SymbolContext& sc) = 0;
virtual bool ParseCompileUnitDebugMacros (const SymbolContext& sc) = 0;
virtual bool ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpecList& support_files) = 0;
+ virtual bool
+ ParseCompileUnitIsOptimized(const lldb_private::SymbolContext &sc)
+ {
+ return false;
+ }
virtual bool ParseImportedModules (const SymbolContext &sc, std::vector<ConstString> &imported_modules) = 0;
virtual size_t ParseFunctionBlocks (const SymbolContext& sc) = 0;
virtual size_t ParseTypes (const SymbolContext& sc) = 0;
@@ -141,7 +148,7 @@ public:
virtual uint32_t FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables);
virtual uint32_t FindFunctions (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list);
virtual uint32_t FindFunctions (const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list);
- virtual uint32_t FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, TypeMap& types);
+ virtual uint32_t FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap& types);
virtual size_t FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types);
virtual void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector<ConstString> &mangled_names);
diff --git a/include/lldb/Symbol/SymbolVendor.h b/include/lldb/Symbol/SymbolVendor.h
index 19461718ed13..e992c5cde607 100644
--- a/include/lldb/Symbol/SymbolVendor.h
+++ b/include/lldb/Symbol/SymbolVendor.h
@@ -17,6 +17,7 @@
#include "lldb/Core/PluginInterface.h"
#include "lldb/Symbol/TypeList.h"
#include "lldb/Symbol/TypeMap.h"
+#include "llvm/ADT/DenseSet.h"
namespace lldb_private {
@@ -67,7 +68,10 @@ public:
virtual bool
ParseCompileUnitSupportFiles (const SymbolContext& sc,
FileSpecList& support_files);
-
+
+ virtual bool
+ ParseCompileUnitIsOptimized(const SymbolContext &sc);
+
virtual bool
ParseImportedModules (const SymbolContext &sc,
std::vector<ConstString> &imported_modules);
@@ -129,6 +133,7 @@ public:
const CompilerDeclContext *parent_decl_ctx,
bool append,
size_t max_matches,
+ llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeMap& types);
virtual size_t
diff --git a/include/lldb/Symbol/Symtab.h b/include/lldb/Symbol/Symtab.h
index 130f02c0e68b..4203a3f7599a 100644
--- a/include/lldb/Symbol/Symtab.h
+++ b/include/lldb/Symbol/Symtab.h
@@ -11,12 +11,12 @@
#ifndef liblldb_Symtab_h_
#define liblldb_Symtab_h_
+#include <mutex>
#include <vector>
#include "lldb/lldb-private.h"
#include "lldb/Core/RangeMap.h"
#include "lldb/Core/UniqueCStringMap.h"
-#include "lldb/Host/Mutex.h"
#include "lldb/Symbol/Symbol.h"
namespace lldb_private {
@@ -50,10 +50,11 @@ public:
void Dump(Stream *s, Target *target, SortOrder sort_type);
void Dump(Stream *s, Target *target, std::vector<uint32_t>& indexes) const;
uint32_t GetIndexForSymbol (const Symbol *symbol) const;
- Mutex & GetMutex ()
- {
- return m_mutex;
- }
+ std::recursive_mutex &
+ GetMutex()
+ {
+ return m_mutex;
+ }
Symbol * FindSymbolByID (lldb::user_id_t uid) const;
Symbol * SymbolAtIndex (size_t idx);
const Symbol * SymbolAtIndex (size_t idx) const;
@@ -79,7 +80,7 @@ public:
size_t FindAllSymbolsWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes);
size_t FindAllSymbolsMatchingRexExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes);
Symbol * FindFirstSymbolWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility);
- Symbol * FindSymbolContainingFileAddress (lldb::addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes);
+ Symbol * FindSymbolAtFileAddress (lldb::addr_t file_addr);
Symbol * FindSymbolContainingFileAddress (lldb::addr_t file_addr);
void ForEachSymbolContainingFileAddress(lldb::addr_t file_addr, std::function<bool(Symbol *)> const &callback);
size_t FindFunctionSymbols (const ConstString &name, uint32_t name_type_mask, SymbolContextList& sc_list);
@@ -124,7 +125,7 @@ protected:
UniqueCStringMap<uint32_t> m_basename_to_index;
UniqueCStringMap<uint32_t> m_method_to_index;
UniqueCStringMap<uint32_t> m_selector_to_index;
- mutable Mutex m_mutex; // Provide thread safety for this symbol table
+ mutable std::recursive_mutex m_mutex; // Provide thread safety for this symbol table
bool m_file_addr_to_index_computed:1,
m_name_indexes_computed:1;
private:
diff --git a/include/lldb/Symbol/Type.h b/include/lldb/Symbol/Type.h
index 224e0a112df3..9158f28998e3 100644
--- a/include/lldb/Symbol/Type.h
+++ b/include/lldb/Symbol/Type.h
@@ -428,7 +428,10 @@ public:
SetType (lldb::TypeSP type)
{
type_sp = type;
- compiler_type = type_sp->GetForwardCompilerType ();
+ if (type_sp)
+ compiler_type = type_sp->GetForwardCompilerType ();
+ else
+ compiler_type.Clear();
}
lldb::TypeSP
@@ -955,13 +958,13 @@ public:
uint64_t
GetValueAsUnsigned () const
{
- return *m_value.getRawData();
+ return m_value.getZExtValue();
}
int64_t
GetValueAsSigned () const
{
- return (int64_t) *m_value.getRawData();
+ return m_value.getSExtValue();
}
protected:
diff --git a/include/lldb/Symbol/TypeSystem.h b/include/lldb/Symbol/TypeSystem.h
index 9b43b9dec37b..466699366f0a 100644
--- a/include/lldb/Symbol/TypeSystem.h
+++ b/include/lldb/Symbol/TypeSystem.h
@@ -14,6 +14,7 @@
// C++ Includes
#include <functional>
#include <map>
+#include <mutex>
#include <string>
// Other libraries and framework includes
@@ -24,7 +25,6 @@
#include "lldb/lldb-private.h"
#include "lldb/Core/PluginInterface.h"
#include "lldb/Expression/Expression.h"
-#include "lldb/Host/Mutex.h"
#include "lldb/Symbol/CompilerDecl.h"
#include "lldb/Symbol/CompilerDeclContext.h"
@@ -74,6 +74,7 @@ public:
eKindClang,
eKindSwift,
eKindGo,
+ eKindJava,
kNumKinds
};
@@ -92,8 +93,14 @@ public:
static lldb::TypeSystemSP
CreateInstance (lldb::LanguageType language, Target *target);
+
+ // Free up any resources associated with this TypeSystem. Done before removing
+ // all the TypeSystems from the TypeSystemMap.
+ virtual void
+ Finalize() {}
+
virtual DWARFASTParser *
- GetDWARFParser ()
+ GetDWARFParser()
{
return nullptr;
}
@@ -120,12 +127,6 @@ public:
virtual ConstString
DeclGetMangledName (void *opaque_decl);
- virtual lldb::VariableSP
- DeclGetVariable (void *opaque_decl) = 0;
-
- virtual void
- DeclLinkToObject (void *opaque_decl, std::shared_ptr<void> object) = 0;
-
virtual CompilerDeclContext
DeclGetDeclContext (void *opaque_decl);
@@ -143,7 +144,9 @@ public:
//----------------------------------------------------------------------
virtual std::vector<CompilerDecl>
- DeclContextFindDeclByName (void *opaque_decl_ctx, ConstString name);
+ DeclContextFindDeclByName (void *opaque_decl_ctx,
+ ConstString name,
+ const bool ignore_imported_decls);
virtual bool
DeclContextIsStructUnionOrClass (void *opaque_decl_ctx) = 0;
@@ -201,9 +204,19 @@ public:
IsFunctionPointerType (lldb::opaque_compiler_type_t type) = 0;
virtual bool
- IsIntegerType (lldb::opaque_compiler_type_t type, bool &is_signed) = 0;
+ IsBlockPointerType (lldb::opaque_compiler_type_t type, CompilerType *function_pointer_type_ptr) = 0;
virtual bool
+ IsIntegerType (lldb::opaque_compiler_type_t type, bool &is_signed) = 0;
+
+ virtual bool
+ IsEnumerationType (lldb::opaque_compiler_type_t type, bool &is_signed)
+ {
+ is_signed = false;
+ return false;
+ }
+
+ virtual bool
IsPossibleDynamicType (lldb::opaque_compiler_type_t type,
CompilerType *target_type, // Can pass NULL
bool check_cplusplus,
@@ -582,6 +595,8 @@ protected:
TypeSystemMap ();
~TypeSystemMap();
+ // Clear calls Finalize on all the TypeSystems managed by this map, and then
+ // empties the map.
void
Clear ();
@@ -597,9 +612,15 @@ protected:
GetTypeSystemForLanguage (lldb::LanguageType language, Target *target, bool can_create);
protected:
+ // This function does not take the map mutex, and should only be called from
+ // functions that do take the mutex.
+ void
+ AddToMap (lldb::LanguageType language, lldb::TypeSystemSP const &type_system_sp);
+
typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> collection;
- mutable Mutex m_mutex; ///< A mutex to keep this object happy in multi-threaded environments.
+ mutable std::mutex m_mutex; ///< A mutex to keep this object happy in multi-threaded environments.
collection m_map;
+ bool m_clear_in_progress;
};
} // namespace lldb_private
diff --git a/include/lldb/Symbol/UnwindPlan.h b/include/lldb/Symbol/UnwindPlan.h
index 71100138413d..64c00bf12c27 100644
--- a/include/lldb/Symbol/UnwindPlan.h
+++ b/include/lldb/Symbol/UnwindPlan.h
@@ -116,6 +116,12 @@ public:
return m_type == unspecified;
}
+ bool
+ IsUndefined () const
+ {
+ return m_type == undefined;
+ }
+
bool
IsCFAPlusOffset () const
{
@@ -539,7 +545,7 @@ public:
AppendRow (const RowSP& row_sp);
void
- InsertRow (const RowSP& row_sp);
+ InsertRow (const RowSP& row_sp, bool replace_existing = false);
// Returns a pointer to the best row for the given offset into the function's instructions.
// If offset is -1 it indicates that the function start is unknown - the final row in the UnwindPlan is returned.
diff --git a/include/lldb/Symbol/UnwindTable.h b/include/lldb/Symbol/UnwindTable.h
index f69e4660de24..cb0080aff881 100644
--- a/include/lldb/Symbol/UnwindTable.h
+++ b/include/lldb/Symbol/UnwindTable.h
@@ -12,9 +12,9 @@
#define liblldb_UnwindTable_h
#include <map>
+#include <mutex>
#include "lldb/lldb-private.h"
-#include "lldb/Host/Mutex.h"
namespace lldb_private {
@@ -40,6 +40,9 @@ public:
lldb::FuncUnwindersSP
GetFuncUnwindersContainingAddress (const Address& addr, SymbolContext &sc);
+ bool
+ GetAllowAssemblyEmulationUnwindPlans ();
+
// Normally when we create a new FuncUnwinders object we track it in this UnwindTable so it can
// be reused later. But for the target modules show-unwind we want to create brand new
// UnwindPlans for the function of interest - so ignore any existing FuncUnwinders for that
@@ -66,7 +69,7 @@ private:
collection m_unwinds;
bool m_initialized; // delay some initialization until ObjectFile is set up
- Mutex m_mutex;
+ std::mutex m_mutex;
std::unique_ptr<DWARFCallFrameInfo> m_eh_frame_up;
std::unique_ptr<CompactUnwindInfo> m_compact_unwind_up;
diff --git a/include/lldb/Symbol/Variable.h b/include/lldb/Symbol/Variable.h
index 1cac5d0c5649..00761424d107 100644
--- a/include/lldb/Symbol/Variable.h
+++ b/include/lldb/Symbol/Variable.h
@@ -17,6 +17,7 @@
#include "lldb/lldb-private.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/Core/Mangled.h"
+#include "lldb/Core/RangeMap.h"
#include "lldb/Core/UserID.h"
#include "lldb/Expression/DWARFExpression.h"
#include "lldb/Symbol/Declaration.h"
@@ -27,6 +28,8 @@ class Variable : public UserID,
public std::enable_shared_from_this<Variable>
{
public:
+ typedef RangeVector<lldb::addr_t, lldb::addr_t> RangeList;
+
//------------------------------------------------------------------
// Constructors and Destructors
//------------------------------------------------------------------
@@ -36,6 +39,7 @@ public:
const lldb::SymbolFileTypeSP &symfile_type_sp,
lldb::ValueType scope,
SymbolContextScope *owner_scope,
+ const RangeList& scope_range,
Declaration* decl,
const DWARFExpression& location,
bool external,
@@ -178,12 +182,14 @@ public:
CompilerDecl
GetDecl ();
+
protected:
ConstString m_name; // The basename of the variable (no namespaces)
Mangled m_mangled; // The mangled name of the variable
lldb::SymbolFileTypeSP m_symfile_type_sp; // The type pointer of the variable (int, struct, class, etc)
lldb::ValueType m_scope; // global, parameter, local
SymbolContextScope *m_owner_scope; // The symbol file scope that this variable was defined in
+ RangeList m_scope_range; // The list of ranges inside the owner's scope where this variable is valid
Declaration m_declaration; // Declaration location for this item.
DWARFExpression m_location; // The location of this variable that can be fed to DWARFExpression::Evaluate()
uint8_t m_external:1, // Visible outside the containing compile unit?