aboutsummaryrefslogtreecommitdiffstats
path: root/source/Symbol
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
commitf73363f1dd94996356cefbf24388f561891acf0b (patch)
treee3c31248bdb36eaec5fd833490d4278162dba2a0 /source/Symbol
parent160ee69dd7ae18978f4068116777639ea98dc951 (diff)
downloadsrc-f73363f1dd94996356cefbf24388f561891acf0b.tar.gz
src-f73363f1dd94996356cefbf24388f561891acf0b.zip
Vendor import of lldb trunk r338150:vendor/lldb/lldb-trunk-r338150
Notes
Notes: svn path=/vendor/lldb/dist/; revision=336823 svn path=/vendor/lldb/lldb-trunk-r338150/; revision=336824; tag=vendor/lldb/lldb-trunk-r338150
Diffstat (limited to 'source/Symbol')
-rw-r--r--source/Symbol/ArmUnwindInfo.cpp15
-rw-r--r--source/Symbol/Block.cpp3
-rw-r--r--source/Symbol/CMakeLists.txt1
-rw-r--r--source/Symbol/ClangASTContext.cpp418
-rw-r--r--source/Symbol/ClangASTImporter.cpp12
-rw-r--r--source/Symbol/CompactUnwindInfo.cpp92
-rw-r--r--source/Symbol/CompileUnit.cpp95
-rw-r--r--source/Symbol/CompilerType.cpp27
-rw-r--r--source/Symbol/DWARFCallFrameInfo.cpp207
-rw-r--r--source/Symbol/Declaration.cpp2
-rw-r--r--source/Symbol/FuncUnwinders.cpp36
-rw-r--r--source/Symbol/Function.cpp25
-rw-r--r--source/Symbol/GoASTContext.cpp21
-rw-r--r--source/Symbol/LineEntry.cpp22
-rw-r--r--source/Symbol/LineTable.cpp76
-rw-r--r--source/Symbol/ObjectFile.cpp195
-rw-r--r--source/Symbol/Symbol.cpp59
-rw-r--r--source/Symbol/SymbolContext.cpp92
-rw-r--r--source/Symbol/SymbolFile.cpp24
-rw-r--r--source/Symbol/SymbolVendor.cpp44
-rw-r--r--source/Symbol/Symtab.cpp117
-rw-r--r--source/Symbol/Type.cpp49
-rw-r--r--source/Symbol/TypeList.cpp37
-rw-r--r--source/Symbol/TypeMap.cpp36
-rw-r--r--source/Symbol/UnwindPlan.cpp6
-rw-r--r--source/Symbol/UnwindTable.cpp17
-rw-r--r--source/Symbol/Variable.cpp37
27 files changed, 843 insertions, 922 deletions
diff --git a/source/Symbol/ArmUnwindInfo.cpp b/source/Symbol/ArmUnwindInfo.cpp
index 4da307bf0c32..6dcad62f2f9d 100644
--- a/source/Symbol/ArmUnwindInfo.cpp
+++ b/source/Symbol/ArmUnwindInfo.cpp
@@ -65,17 +65,16 @@ ArmUnwindInfo::ArmUnwindInfo(ObjectFile &objfile, SectionSP &arm_exidx,
}
// Sort the entries in the exidx section. The entries should be sorted inside
- // the section but
- // some old compiler isn't sorted them.
+ // the section but some old compiler isn't sorted them.
std::sort(m_exidx_entries.begin(), m_exidx_entries.end());
}
ArmUnwindInfo::~ArmUnwindInfo() {}
-// Read a byte from the unwind instruction stream with the given offset.
-// Custom function is required because have to red in order of significance
-// within their containing
-// word (most significant byte first) and in increasing word address order.
+// Read a byte from the unwind instruction stream with the given offset. Custom
+// function is required because have to red in order of significance within
+// their containing word (most significant byte first) and in increasing word
+// address order.
uint8_t ArmUnwindInfo::GetByteAtOffset(const uint32_t *data,
uint16_t offset) const {
uint32_t value = data[offset / 4];
@@ -276,8 +275,8 @@ bool ArmUnwindInfo::GetUnwindPlan(Target &target, const Address &addr,
return false;
} else if ((byte1 & 0xff) == 0xc8) {
// 11001000 sssscccc
- // Pop VFP double precision registers D[16+ssss]-D[16+ssss+cccc] saved (as
- // if) by FSTMFDD (see remarks d,e)
+ // Pop VFP double precision registers D[16+ssss]-D[16+ssss+cccc] saved
+ // (as if) by FSTMFDD (see remarks d,e)
if (byte_offset >= byte_count)
return false;
diff --git a/source/Symbol/Block.cpp b/source/Symbol/Block.cpp
index 648d8ee48bf5..46f875fca776 100644
--- a/source/Symbol/Block.cpp
+++ b/source/Symbol/Block.cpp
@@ -60,8 +60,7 @@ void Block::Dump(Stream *s, addr_t base_addr, int32_t depth,
if (depth < 0) {
Block *parent = GetParent();
if (parent) {
- // We have a depth that is less than zero, print our parent blocks
- // first
+ // We have a depth that is less than zero, print our parent blocks first
parent->Dump(s, base_addr, depth + 1, show_context);
}
}
diff --git a/source/Symbol/CMakeLists.txt b/source/Symbol/CMakeLists.txt
index 69a2b5a1699c..6f8a8cb9f9f2 100644
--- a/source/Symbol/CMakeLists.txt
+++ b/source/Symbol/CMakeLists.txt
@@ -50,7 +50,6 @@ add_lldb_library(lldbSymbol
lldbPluginExpressionParserGo
lldbPluginSymbolFileDWARF
lldbPluginSymbolFilePDB
- lldbPluginObjectContainerBSDArchive
lldbPluginCPlusPlusLanguage
lldbPluginObjCLanguage
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index 673124cc0de5..95e7f8a68d44 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -138,8 +138,8 @@ static ClangASTMap &GetASTMap() {
return *g_map_ptr;
}
-static bool IsOperator(const char *name,
- clang::OverloadedOperatorKind &op_kind) {
+bool ClangASTContext::IsOperator(const char *name,
+ clang::OverloadedOperatorKind &op_kind) {
if (name == nullptr || name[0] == '\0')
return false;
@@ -163,8 +163,8 @@ static bool IsOperator(const char *name,
#undef OPERATOR_PREFIX
#undef OPERATOR_PREFIX_LENGTH
- // This is an operator, set the overloaded operator kind to invalid
- // in case this is a conversion operator...
+ // This is an operator, set the overloaded operator kind to invalid in case
+ // this is a conversion operator...
op_kind = clang::NUM_OVERLOADED_OPERATORS;
switch (post_op_name[0]) {
@@ -375,9 +375,9 @@ ClangASTContext::ConvertAccessTypeToAccessSpecifier(AccessType access) {
static void ParseLangArgs(LangOptions &Opts, InputKind IK, const char *triple) {
// FIXME: Cleanup per-file based stuff.
- // Set some properties which depend solely on the input kind; it would be nice
- // to move these to the language standard, and have the driver resolve the
- // input kind + language standard.
+ // Set some properties which depend solely on the input kind; it would be
+ // nice to move these to the language standard, and have the driver resolve
+ // the input kind + language standard.
if (IK.getLanguage() == InputKind::Asm) {
Opts.AsmPreprocessor = 1;
} else if (IK.isObjectiveC()) {
@@ -408,6 +408,9 @@ static void ParseLangArgs(LangOptions &Opts, InputKind IK, const char *triple) {
case InputKind::ObjCXX:
LangStd = LangStandard::lang_gnucxx98;
break;
+ case InputKind::HIP:
+ LangStd = LangStandard::lang_hip;
+ break;
}
}
@@ -437,8 +440,8 @@ static void ParseLangArgs(LangOptions &Opts, InputKind IK, const char *triple) {
Opts.setValueVisibilityMode(DefaultVisibility);
- // Mimicing gcc's behavior, trigraphs are only enabled if -trigraphs
- // is specified, or -std is set to a conforming mode.
+ // Mimicing gcc's behavior, trigraphs are only enabled if -trigraphs is
+ // specified, or -std is set to a conforming mode.
Opts.Trigraphs = !Opts.GNUMode;
Opts.CharIsSigned = ArchSpec(triple).CharIsSignedByDefault();
Opts.OptimizeSize = 0;
@@ -659,8 +662,8 @@ ASTContext *ClangASTContext::getASTContext() {
m_ast_ap->getDiagnostics().setClient(getDiagnosticConsumer(), false);
// This can be NULL if we don't know anything about the architecture or if
- // the
- // target for an architecture isn't enabled in the llvm/clang that we built
+ // the target for an architecture isn't enabled in the llvm/clang that we
+ // built
TargetInfo *target_info = getTargetInfo();
if (target_info)
m_ast_ap->InitBuiltinTypes(*target_info);
@@ -1251,8 +1254,8 @@ CompilerType ClangASTContext::GetTypeForDecl(clang::NamedDecl *decl) {
}
CompilerType ClangASTContext::GetTypeForDecl(TagDecl *decl) {
- // No need to call the getASTContext() accessor (which can create the AST
- // if it isn't created yet, because we can't have created a decl in this
+ // No need to call the getASTContext() accessor (which can create the AST if
+ // it isn't created yet, because we can't have created a decl in this
// AST if our AST didn't already exist...
ASTContext *ast = &decl->getASTContext();
if (ast)
@@ -1261,8 +1264,8 @@ CompilerType ClangASTContext::GetTypeForDecl(TagDecl *decl) {
}
CompilerType ClangASTContext::GetTypeForDecl(ObjCInterfaceDecl *decl) {
- // No need to call the getASTContext() accessor (which can create the AST
- // if it isn't created yet, because we can't have created a decl in this
+ // No need to call the getASTContext() accessor (which can create the AST if
+ // it isn't created yet, because we can't have created a decl in this
// AST if our AST didn't already exist...
ASTContext *ast = &decl->getASTContext();
if (ast)
@@ -1291,9 +1294,9 @@ CompilerType ClangASTContext::CreateRecordType(DeclContext *decl_ctx,
}
// NOTE: Eventually CXXRecordDecl will be merged back into RecordDecl and
- // we will need to update this code. I was told to currently always use
- // the CXXRecordDecl class since we often don't know from debug information
- // if something is struct or a class, so we default to always use the more
+ // we will need to update this code. I was told to currently always use the
+ // CXXRecordDecl class since we often don't know from debug information if
+ // something is struct or a class, so we default to always use the more
// complete definition just in case.
bool is_anonymous = (!name) || (!name[0]);
@@ -1388,7 +1391,7 @@ static TemplateParameterList *CreateTemplateParameterList(
clang::FunctionTemplateDecl *ClangASTContext::CreateFunctionTemplateDecl(
clang::DeclContext *decl_ctx, clang::FunctionDecl *func_decl,
const char *name, const TemplateParameterInfos &template_param_infos) {
- // /// \brief Create a function template node.
+ // /// Create a function template node.
ASTContext *ast = getASTContext();
llvm::SmallVector<NamedDecl *, 8> template_param_decls;
@@ -1482,6 +1485,29 @@ ClassTemplateDecl *ClangASTContext::CreateClassTemplateDecl(
return class_template_decl;
}
+TemplateTemplateParmDecl *
+ClangASTContext::CreateTemplateTemplateParmDecl(const char *template_name) {
+ ASTContext *ast = getASTContext();
+
+ auto *decl_ctx = ast->getTranslationUnitDecl();
+
+ IdentifierInfo &identifier_info = ast->Idents.get(template_name);
+ llvm::SmallVector<NamedDecl *, 8> template_param_decls;
+
+ ClangASTContext::TemplateParameterInfos template_param_infos;
+ TemplateParameterList *template_param_list = CreateTemplateParameterList(
+ ast, template_param_infos, template_param_decls);
+
+ // LLDB needs to create those decls only to be able to display a
+ // type that includes a template template argument. Only the name matters for
+ // this purpose, so we use dummy values for the other characterisitcs of the
+ // type.
+ return TemplateTemplateParmDecl::Create(
+ *ast, decl_ctx, SourceLocation(),
+ /*Depth*/ 0, /*Position*/ 0,
+ /*IsParameterPack*/ false, &identifier_info, template_param_list);
+}
+
ClassTemplateSpecializationDecl *
ClangASTContext::CreateClassTemplateSpecializationDecl(
DeclContext *decl_ctx, ClassTemplateDecl *class_template_decl, int kind,
@@ -1623,7 +1649,7 @@ bool ClangASTContext::RecordHasFields(const RecordDecl *record_decl) {
return false;
}
-#pragma mark Objective C Classes
+#pragma mark Objective-C Classes
CompilerType ClangASTContext::CreateObjCClass(const char *name,
DeclContext *decl_ctx,
@@ -1907,11 +1933,10 @@ ClangASTContext::GetDeclarationName(const char *name,
return DeclarationName(&getASTContext()->Idents.get(
name)); // Not operator, but a regular function.
- // Check the number of operator parameters. Sometimes we have
- // seen bad DWARF that doesn't correctly describe operators and
- // if we try to create a method and add it to the class, clang
- // will assert and crash, so we need to make sure things are
- // acceptable.
+ // Check the number of operator parameters. Sometimes we have seen bad DWARF
+ // that doesn't correctly describe operators and if we try to create a method
+ // and add it to the class, clang will assert and crash, so we need to make
+ // sure things are acceptable.
clang::QualType method_qual_type(ClangUtil::GetQualType(function_clang_type));
const clang::FunctionProtoType *function_type =
llvm::dyn_cast<clang::FunctionProtoType>(method_qual_type.getTypePtr());
@@ -2121,51 +2146,6 @@ ClangASTContext::CreateEnumerationType(const char *name, DeclContext *decl_ctx,
return CompilerType();
}
-// Disable this for now since I can't seem to get a nicely formatted float
-// out of the APFloat class without just getting the float, double or quad
-// and then using a formatted print on it which defeats the purpose. We ideally
-// would like to get perfect string values for any kind of float semantics
-// so we can support remote targets. The code below also requires a patch to
-// llvm::APInt.
-// bool
-// ClangASTContext::ConvertFloatValueToString (ASTContext *ast,
-// lldb::opaque_compiler_type_t clang_type, const uint8_t* bytes, size_t
-// byte_size, int apint_byte_order, std::string &float_str)
-//{
-// uint32_t count = 0;
-// bool is_complex = false;
-// if (ClangASTContext::IsFloatingPointType (clang_type, count, is_complex))
-// {
-// unsigned num_bytes_per_float = byte_size / count;
-// unsigned num_bits_per_float = num_bytes_per_float * 8;
-//
-// float_str.clear();
-// uint32_t i;
-// for (i=0; i<count; i++)
-// {
-// APInt ap_int(num_bits_per_float, bytes + i * num_bytes_per_float,
-// (APInt::ByteOrder)apint_byte_order);
-// bool is_ieee = false;
-// APFloat ap_float(ap_int, is_ieee);
-// char s[1024];
-// unsigned int hex_digits = 0;
-// bool upper_case = false;
-//
-// if (ap_float.convertToHexString(s, hex_digits, upper_case,
-// APFloat::rmNearestTiesToEven) > 0)
-// {
-// if (i > 0)
-// float_str.append(", ");
-// float_str.append(s);
-// if (i == 1 && is_complex)
-// float_str.append(1, 'i');
-// }
-// }
-// return !float_str.empty();
-// }
-// return false;
-//}
-
CompilerType ClangASTContext::GetIntTypeFromBitSize(clang::ASTContext *ast,
size_t bit_size,
bool is_signed) {
@@ -2266,8 +2246,8 @@ bool ClangASTContext::DeclsAreEquivalent(clang::Decl *lhs_decl,
if (lhs_decl_kind == rhs_decl_kind) {
//------------------------------------------------------------------
- // Now check that the decl contexts kinds are all equivalent
- // before we have to check any names of the decl contexts...
+ // Now check that the decl contexts kinds are all equivalent before we
+ // have to check any names of the decl contexts...
//------------------------------------------------------------------
clang::DeclContext *lhs_decl_ctx = lhs_decl->getDeclContext();
clang::DeclContext *rhs_decl_ctx = rhs_decl->getDeclContext();
@@ -2309,8 +2289,8 @@ bool ClangASTContext::DeclsAreEquivalent(clang::Decl *lhs_decl,
return false;
//--------------------------------------------------------------
- // We know that the decl context kinds all match, so now we need
- // to make sure the names match as well
+ // We know that the decl context kinds all match, so now we need to
+ // make sure the names match as well
//--------------------------------------------------------------
lhs_decl_ctx = lhs_decl->getDeclContext();
rhs_decl_ctx = rhs_decl->getDeclContext();
@@ -2580,8 +2560,7 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
clang::ObjCInterfaceDecl *class_interface_decl =
objc_class_type->getInterface();
// We currently can't complete objective C types through the newly added
- // ASTContext
- // because it only supports TagDecl objects right now...
+ // ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
if (class_interface_decl->getDefinition())
return true;
@@ -2901,8 +2880,8 @@ bool ClangASTContext::IsCStringType(lldb::opaque_compiler_type_t type,
if (type_flags.AnySet(eTypeIsArray | eTypeIsPointer)) {
if (pointee_or_element_clang_type.IsCharType()) {
if (type_flags.Test(eTypeIsArray)) {
- // We know the size of the array and it could be a C string
- // since it is an array of characters
+ // We know the size of the array and it could be a C string since it is
+ // an array of characters
length = llvm::cast<clang::ConstantArrayType>(
GetCanonicalQualType(type).getTypePtr())
->getSize()
@@ -3642,9 +3621,8 @@ bool ClangASTContext::IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
if (success) {
// Check to make sure what we are pointing too is a possible dynamic C++
- // type
- // We currently accept any "void *" (in case we have a class that has been
- // watered down to an opaque pointer) and virtual C++ classes.
+ // type We currently accept any "void *" (in case we have a class that
+ // has been watered down to an opaque pointer) and virtual C++ classes.
const clang::Type::TypeClass pointee_type_class =
pointee_qual_type.getCanonicalType()->getTypeClass();
switch (pointee_type_class) {
@@ -3964,7 +3942,10 @@ ClangASTContext::GetTypeInfo(lldb::opaque_compiler_type_t type,
case clang::Type::DependentTemplateSpecialization:
return eTypeIsTemplate;
case clang::Type::Decltype:
- return 0;
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::DecltypeType>(qual_type)->getUnderlyingType())
+ .GetTypeInfo(pointee_or_element_clang_type);
case clang::Type::Enum:
if (pointee_or_element_clang_type)
@@ -4046,9 +4027,16 @@ ClangASTContext::GetTypeInfo(lldb::opaque_compiler_type_t type,
->getUnderlyingType())
.GetTypeInfo(pointee_or_element_clang_type);
case clang::Type::TypeOfExpr:
- return 0;
+ return CompilerType(getASTContext(),
+ llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType())
+ .GetTypeInfo(pointee_or_element_clang_type);
case clang::Type::TypeOf:
- return 0;
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetTypeInfo(pointee_or_element_clang_type);
case clang::Type::UnresolvedUsing:
return 0;
@@ -4178,6 +4166,8 @@ ClangASTContext::GetTypeClass(lldb::opaque_compiler_type_t type) {
return lldb::eTypeClassArray;
case clang::Type::DependentSizedExtVector:
return lldb::eTypeClassVector;
+ case clang::Type::DependentVector:
+ return lldb::eTypeClassVector;
case clang::Type::ExtVector:
return lldb::eTypeClassVector;
case clang::Type::Vector:
@@ -4255,11 +4245,21 @@ ClangASTContext::GetTypeClass(lldb::opaque_compiler_type_t type) {
break;
case clang::Type::TypeOfExpr:
- break;
+ return CompilerType(getASTContext(),
+ llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType())
+ .GetTypeClass();
case clang::Type::TypeOf:
- break;
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetTypeClass();
case clang::Type::Decltype:
- break;
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetTypeClass();
case clang::Type::TemplateSpecialization:
break;
case clang::Type::DeducedTemplateSpecialization:
@@ -4776,9 +4776,8 @@ ClangASTContext::CreateTypedef(lldb::opaque_compiler_type_t type,
}
// Check whether this declaration is an anonymous struct, union, or enum,
- // hidden behind a typedef. If so, we
- // try to check whether we have a typedef tag to attach to the original
- // record declaration
+ // hidden behind a typedef. If so, we try to check whether we have a
+ // typedef tag to attach to the original record declaration
if (tdecl && !tdecl->getIdentifier() && !tdecl->getTypedefNameForAnonDecl())
tdecl->setTypedefNameForAnonDecl(decl);
@@ -4903,6 +4902,7 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::Type::ConstantArray:
break;
+ case clang::Type::DependentVector:
case clang::Type::ExtVector:
case clang::Type::Vector:
// TODO: Set this to more than one???
@@ -4917,8 +4917,6 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::BuiltinType::Char_S:
case clang::BuiltinType::SChar:
case clang::BuiltinType::WChar_S:
- case clang::BuiltinType::Char16:
- case clang::BuiltinType::Char32:
case clang::BuiltinType::Short:
case clang::BuiltinType::Int:
case clang::BuiltinType::Long:
@@ -4929,6 +4927,9 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::BuiltinType::Char_U:
case clang::BuiltinType::UChar:
case clang::BuiltinType::WChar_U:
+ case clang::BuiltinType::Char8:
+ case clang::BuiltinType::Char16:
+ case clang::BuiltinType::Char32:
case clang::BuiltinType::UShort:
case clang::BuiltinType::UInt:
case clang::BuiltinType::ULong:
@@ -4936,6 +4937,33 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::BuiltinType::UInt128:
return lldb::eEncodingUint;
+ // Fixed point types. Note that they are currently ignored.
+ case clang::BuiltinType::ShortAccum:
+ case clang::BuiltinType::Accum:
+ case clang::BuiltinType::LongAccum:
+ case clang::BuiltinType::UShortAccum:
+ case clang::BuiltinType::UAccum:
+ case clang::BuiltinType::ULongAccum:
+ case clang::BuiltinType::ShortFract:
+ case clang::BuiltinType::Fract:
+ case clang::BuiltinType::LongFract:
+ case clang::BuiltinType::UShortFract:
+ case clang::BuiltinType::UFract:
+ case clang::BuiltinType::ULongFract:
+ case clang::BuiltinType::SatShortAccum:
+ case clang::BuiltinType::SatAccum:
+ case clang::BuiltinType::SatLongAccum:
+ case clang::BuiltinType::SatUShortAccum:
+ case clang::BuiltinType::SatUAccum:
+ case clang::BuiltinType::SatULongAccum:
+ case clang::BuiltinType::SatShortFract:
+ case clang::BuiltinType::SatFract:
+ case clang::BuiltinType::SatLongFract:
+ case clang::BuiltinType::SatUShortFract:
+ case clang::BuiltinType::SatUFract:
+ case clang::BuiltinType::SatULongFract:
+ break;
+
case clang::BuiltinType::Half:
case clang::BuiltinType::Float:
case clang::BuiltinType::Float16:
@@ -5004,9 +5032,8 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
break;
}
break;
- // All pointer types are represented as unsigned integer encodings.
- // We may nee to add a eEncodingPointer if we ever need to know the
- // difference
+ // All pointer types are represented as unsigned integer encodings. We may
+ // nee to add a eEncodingPointer if we ever need to know the difference
case clang::Type::ObjCObjectPointer:
case clang::Type::BlockPointer:
case clang::Type::Pointer:
@@ -5060,7 +5087,22 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
return CompilerType(getASTContext(),
llvm::cast<clang::ParenType>(qual_type)->desugar())
.GetEncoding(count);
-
+ case clang::Type::TypeOfExpr:
+ return CompilerType(getASTContext(),
+ llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType())
+ .GetEncoding(count);
+ case clang::Type::TypeOf:
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetEncoding(count);
+ case clang::Type::Decltype:
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::DecltypeType>(qual_type)->getUnderlyingType())
+ .GetEncoding(count);
case clang::Type::DependentSizedArray:
case clang::Type::DependentSizedExtVector:
case clang::Type::UnresolvedUsing:
@@ -5074,9 +5116,6 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::Type::PackExpansion:
case clang::Type::ObjCObject:
- case clang::Type::TypeOfExpr:
- case clang::Type::TypeOf:
- case clang::Type::Decltype:
case clang::Type::TemplateSpecialization:
case clang::Type::DeducedTemplateSpecialization:
case clang::Type::Atomic:
@@ -5118,6 +5157,7 @@ lldb::Format ClangASTContext::GetFormat(lldb::opaque_compiler_type_t type) {
case clang::Type::ConstantArray:
return lldb::eFormatVoid; // no value
+ case clang::Type::DependentVector:
case clang::Type::ExtVector:
case clang::Type::Vector:
break;
@@ -5214,6 +5254,22 @@ lldb::Format ClangASTContext::GetFormat(lldb::opaque_compiler_type_t type) {
getASTContext(),
llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType())
.GetFormat();
+ case clang::Type::TypeOfExpr:
+ return CompilerType(getASTContext(),
+ llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType())
+ .GetFormat();
+ case clang::Type::TypeOf:
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetFormat();
+ case clang::Type::Decltype:
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::DecltypeType>(qual_type)->getUnderlyingType())
+ .GetFormat();
case clang::Type::DependentSizedArray:
case clang::Type::DependentSizedExtVector:
case clang::Type::UnresolvedUsing:
@@ -5227,9 +5283,6 @@ lldb::Format ClangASTContext::GetFormat(lldb::opaque_compiler_type_t type) {
case clang::Type::PackExpansion:
case clang::Type::ObjCObject:
- case clang::Type::TypeOfExpr:
- case clang::Type::TypeOf:
- case clang::Type::Decltype:
case clang::Type::TemplateSpecialization:
case clang::Type::DeducedTemplateSpecialization:
case clang::Type::Atomic:
@@ -5298,10 +5351,9 @@ uint32_t ClangASTContext::GetNumChildren(lldb::opaque_compiler_type_t type,
llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
if (cxx_record_decl) {
if (omit_empty_base_classes) {
- // Check each base classes to see if it or any of its
- // base classes contain any fields. This can help
- // limit the noise in variable views by not having to
- // show base classes that contain no members.
+ // Check each base classes to see if it or any of its base classes
+ // contain any fields. This can help limit the noise in variable
+ // views by not having to show base classes that contain no members.
clang::CXXRecordDecl::base_class_const_iterator base_class,
base_class_end;
for (base_class = cxx_record_decl->bases_begin(),
@@ -5394,8 +5446,8 @@ uint32_t ClangASTContext::GetNumChildren(lldb::opaque_compiler_type_t type,
CompilerType(getASTContext(), pointee_type)
.GetNumChildren(omit_empty_base_classes);
if (num_pointee_children == 0) {
- // We have a pointer to a pointee type that claims it has no children.
- // We will want to look at
+ // We have a pointer to a pointee type that claims it has no children. We
+ // will want to look at
num_children = GetNumPointeeChildren(pointee_type);
} else
num_children = num_pointee_children;
@@ -6264,11 +6316,15 @@ uint32_t ClangASTContext::GetNumPointeeChildren(clang::QualType type) {
return GetNumPointeeChildren(
llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType());
case clang::Type::TypeOfExpr:
- return 0;
+ return GetNumPointeeChildren(llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType());
case clang::Type::TypeOf:
- return 0;
+ return GetNumPointeeChildren(
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType());
case clang::Type::Decltype:
- return 0;
+ return GetNumPointeeChildren(
+ llvm::cast<clang::DecltypeType>(qual_type)->getUnderlyingType());
case clang::Type::Record:
return 0;
case clang::Type::Enum:
@@ -6585,15 +6641,12 @@ CompilerType ClangASTContext::GetChildCompilerTypeAtIndex(
child_byte_size = ivar_type_info.Width / 8;
// Figure out the field offset within the current
- // struct/union/class type
- // For ObjC objects, we can't trust the bit offset we get from
- // the Clang AST, since
- // that doesn't account for the space taken up by unbacked
- // properties, or from
- // the changing size of base classes that are newer than this
- // class.
- // So if we have a process around that we can ask about this
- // object, do so.
+ // struct/union/class type For ObjC objects, we can't trust the
+ // bit offset we get from the Clang AST, since that doesn't
+ // account for the space taken up by unbacked properties, or
+ // from the changing size of base classes that are newer than
+ // this class. So if we have a process around that we can ask
+ // about this object, do so.
child_byte_offset = LLDB_INVALID_IVAR_OFFSET;
Process *process = nullptr;
if (exe_ctx)
@@ -6621,9 +6674,8 @@ CompilerType ClangASTContext::GetChildCompilerTypeAtIndex(
}
// Note, the ObjC Ivar Byte offset is just that, it doesn't
- // account for the bit offset
- // of a bitfield within its containing object. So regardless of
- // where we get the byte
+ // account for the bit offset of a bitfield within its
+ // containing object. So regardless of where we get the byte
// offset from, we still need to get the bit offset for
// bitfields from the layout.
@@ -6895,8 +6947,8 @@ static uint32_t GetIndexForRecordChild(const clang::RecordDecl *record_decl,
}
// Look for a child member (doesn't include base classes, but it does include
-// their members) in the type hierarchy. Returns an index path into "clang_type"
-// on how to reach the appropriate member.
+// their members) in the type hierarchy. Returns an index path into
+// "clang_type" on how to reach the appropriate member.
//
// class A
// {
@@ -6919,16 +6971,13 @@ static uint32_t GetIndexForRecordChild(const clang::RecordDecl *record_decl,
// "m_b" in it:
//
// With omit_empty_base_classes == false we would get an integer array back
-// with:
-// { 1, 1 }
-// The first index 1 is the child index for "class A" within class C
-// The second index 1 is the child index for "m_b" within class A
+// with: { 1, 1 } The first index 1 is the child index for "class A" within
+// class C The second index 1 is the child index for "m_b" within class A
//
-// With omit_empty_base_classes == true we would get an integer array back with:
-// { 0, 1 }
-// The first index 0 is the child index for "class A" within class C (since
-// class B doesn't have any members it doesn't count)
-// The second index 1 is the child index for "m_b" within class A
+// With omit_empty_base_classes == true we would get an integer array back
+// with: { 0, 1 } The first index 0 is the child index for "class A" within
+// class C (since class B doesn't have any members it doesn't count) The second
+// index 1 is the child index for "m_b" within class A
size_t ClangASTContext::GetIndexOfChildMemberWithName(
lldb::opaque_compiler_type_t type, const char *name,
@@ -7063,9 +7112,9 @@ size_t ClangASTContext::GetIndexOfChildMemberWithName(
}
if (superclass_interface_decl) {
- // The super class index is always zero for ObjC classes,
- // so we push it onto the child indexes in case we find
- // an ivar in our superclass...
+ // The super class index is always zero for ObjC classes, so we
+ // push it onto the child indexes in case we find an ivar in our
+ // superclass...
child_indexes.push_back(0);
CompilerType superclass_clang_type(
@@ -7073,14 +7122,13 @@ size_t ClangASTContext::GetIndexOfChildMemberWithName(
superclass_interface_decl));
if (superclass_clang_type.GetIndexOfChildMemberWithName(
name, omit_empty_base_classes, child_indexes)) {
- // We did find an ivar in a superclass so just
- // return the results!
+ // We did find an ivar in a superclass so just return the
+ // results!
return child_indexes.size();
}
- // We didn't find an ivar matching "name" in our
- // superclass, pop the superclass zero index that
- // we pushed on above.
+ // We didn't find an ivar matching "name" in our superclass, pop
+ // the superclass zero index that we pushed on above.
child_indexes.pop_back();
}
}
@@ -7673,8 +7721,8 @@ clang::FieldDecl *ClangASTContext::AddFieldToRecordType(
clang::ICIS_NoInit); // HasInit
if (!name) {
- // Determine whether this field corresponds to an anonymous
- // struct or union.
+ // Determine whether this field corresponds to an anonymous struct or
+ // union.
if (const clang::TagType *TagT =
field->getType()->getAs<clang::TagType>()) {
if (clang::RecordDecl *Rec =
@@ -7818,8 +7866,8 @@ void ClangASTContext::BuildIndirectFields(const CompilerType &type) {
}
}
- // Check the last field to see if it has an incomplete array type as its
- // last member and if it does, the tell the record decl about it
+ // Check the last field to see if it has an incomplete array type as its last
+ // member and if it does, the tell the record decl about it
if (last_field_pos != field_end_pos) {
if (last_field_pos->getType()->isIncompleteArrayType())
record_decl->hasFlexibleArrayMember();
@@ -7885,7 +7933,7 @@ clang::VarDecl *ClangASTContext::AddVariableToRecordType(
}
clang::CXXMethodDecl *ClangASTContext::AddMethodToCXXRecordType(
- lldb::opaque_compiler_type_t type, const char *name,
+ lldb::opaque_compiler_type_t type, const char *name, const char *mangled_name,
const CompilerType &method_clang_type, lldb::AccessType access,
bool is_virtual, bool is_static, bool is_inline, bool is_explicit,
bool is_attr_used, bool is_artificial) {
@@ -7953,11 +8001,10 @@ clang::CXXMethodDecl *ClangASTContext::AddMethodToCXXRecordType(
if (IsOperator(name, op_kind)) {
if (op_kind != clang::NUM_OVERLOADED_OPERATORS) {
- // Check the number of operator parameters. Sometimes we have
- // seen bad DWARF that doesn't correctly describe operators and
- // if we try to create a method and add it to the class, clang
- // will assert and crash, so we need to make sure things are
- // acceptable.
+ // Check the number of operator parameters. Sometimes we have seen bad
+ // DWARF that doesn't correctly describe operators and if we try to
+ // create a method and add it to the class, clang will assert and
+ // crash, so we need to make sure things are acceptable.
const bool is_method = true;
if (!ClangASTContext::CheckOverloadedOperatorKindParameterCount(
is_method, op_kind, num_params))
@@ -8005,6 +8052,11 @@ clang::CXXMethodDecl *ClangASTContext::AddMethodToCXXRecordType(
if (is_attr_used)
cxx_method_decl->addAttr(clang::UsedAttr::CreateImplicit(*getASTContext()));
+ if (mangled_name != NULL) {
+ cxx_method_decl->addAttr(
+ clang::AsmLabelAttr::CreateImplicit(*getASTContext(), mangled_name));
+ }
+
// Populate the method decl with parameter decls
llvm::SmallVector<clang::ParmVarDecl *, 12> params;
@@ -8632,8 +8684,8 @@ bool ClangASTContext::CompleteTagDeclarationDefinition(
clang::QualType qual_type(ClangUtil::GetQualType(type));
if (!qual_type.isNull()) {
// Make sure we use the same methodology as
- // ClangASTContext::StartTagDeclarationDefinition()
- // as to how we start/end the definition. Previously we were calling
+ // ClangASTContext::StartTagDeclarationDefinition() as to how we start/end
+ // the definition. Previously we were calling
const clang::TagType *tag_type = qual_type->getAs<clang::TagType>();
if (tag_type) {
clang::TagDecl *tag_decl = tag_type->getDecl();
@@ -8903,9 +8955,8 @@ void ClangASTContext::DumpValue(
for (field = record_decl->field_begin(),
field_end = record_decl->field_end();
field != field_end; ++field, ++field_idx, ++child_idx) {
- // Print the starting squiggly bracket (if this is the
- // first member) or comma (for member 2 and beyond) for
- // the struct/union/class member.
+ // Print the starting squiggly bracket (if this is the first member) or
+ // comma (for member 2 and beyond) for the struct/union/class member.
if (child_idx == 0)
s->PutChar('{');
else
@@ -8916,8 +8967,8 @@ void ClangASTContext::DumpValue(
clang::QualType field_type = field->getType();
// Print the member type if requested
- // Figure out the type byte size (field_type_info.first) and
- // alignment (field_type_info.second) from the AST context.
+ // Figure out the type byte size (field_type_info.first) and alignment
+ // (field_type_info.second) from the AST context.
clang::TypeInfo field_type_info =
getASTContext()->getTypeInfo(field_type);
assert(field_idx < record_layout.getFieldCount());
@@ -8988,8 +9039,8 @@ void ClangASTContext::DumpValue(
return;
}
}
- // If we have gotten here we didn't get find the enumerator in the
- // enum decl, so just print the integer.
+ // If we have gotten here we didn't get find the enumerator in the enum
+ // decl, so just print the integer.
s->Printf("%" PRIi64, enum_value);
}
return;
@@ -9027,9 +9078,8 @@ void ClangASTContext::DumpValue(
lldb::Format element_format = element_clang_type.GetFormat();
for (element_idx = 0; element_idx < element_count; ++element_idx) {
- // Print the starting squiggly bracket (if this is the
- // first member) or comman (for member 2 and beyong) for
- // the struct/union/class member.
+ // Print the starting squiggly bracket (if this is the first member) or
+ // comman (for member 2 and beyong) for the struct/union/class member.
if (element_idx == 0)
s->PutChar('{');
else
@@ -9225,8 +9275,8 @@ bool ClangASTContext::DumpTypeValue(
} break;
case clang::Type::Enum:
- // If our format is enum or default, show the enumeration value as
- // its enumeration string value, else just display it as requested.
+ // If our format is enum or default, show the enumeration value as its
+ // enumeration string value, else just display it as requested.
if ((format == eFormatEnum || format == eFormatDefault) &&
GetCompleteType(type)) {
const clang::EnumType *enutype =
@@ -9518,9 +9568,9 @@ void ClangASTContext::DumpTypeName(const CompilerType &type) {
if (objc_class_type) {
clang::ObjCInterfaceDecl *class_interface_decl =
objc_class_type->getInterface();
- // We currently can't complete objective C types through the newly added
- // ASTContext
- // because it only supports TagDecl objects right now...
+ // We currently can't complete objective C types through the newly
+ // added ASTContext because it only supports TagDecl objects right
+ // now...
if (class_interface_decl)
printf("@class %s", class_interface_decl->getName().str().c_str());
}
@@ -9778,15 +9828,12 @@ std::vector<CompilerDecl> ClangASTContext::DeclContextFindDeclByName(
// Look for child_decl_ctx's lookup scope in frame_decl_ctx and its parents,
// and return the number of levels it took to find it, or
-// LLDB_INVALID_DECL_LEVEL
-// if not found. If the decl was imported via a using declaration, its name
-// and/or
-// type, if set, will be used to check that the decl found in the scope is a
-// match.
+// LLDB_INVALID_DECL_LEVEL if not found. If the decl was imported via a using
+// declaration, its name and/or type, if set, will be used to check that the
+// decl found in the scope is a match.
//
// The optional name is required by languages (like C++) to handle using
-// declarations
-// like:
+// declarations like:
//
// void poo();
// namespace ns {
@@ -9815,14 +9862,10 @@ std::vector<CompilerDecl> ClangASTContext::DeclContextFindDeclByName(
//
// NOTE: Because file statics are at the TranslationUnit along with globals, a
// function at file scope will return the same level as a function at global
-// scope.
-// Ideally we'd like to treat the file scope as an additional scope just below
-// the
-// global scope. More work needs to be done to recognise that, if the decl
-// we're
-// trying to look up is static, we should compare its source file with that of
-// the
-// current scope and return a lower number for it.
+// scope. Ideally we'd like to treat the file scope as an additional scope just
+// below the global scope. More work needs to be done to recognise that, if
+// the decl we're trying to look up is static, we should compare its source
+// file with that of the current scope and return a lower number for it.
uint32_t ClangASTContext::CountDeclLevels(clang::DeclContext *frame_decl_ctx,
clang::DeclContext *child_decl_ctx,
ConstString *child_name,
@@ -9851,10 +9894,8 @@ uint32_t ClangASTContext::CountDeclLevels(clang::DeclContext *frame_decl_ctx,
continue;
// Currently DWARF has one shared translation unit for all Decls at top
- // level, so this
- // would erroneously find using statements anywhere. So don't look at
- // the top-level
- // translation unit.
+ // level, so this would erroneously find using statements anywhere. So
+ // don't look at the top-level translation unit.
// TODO fix this and add a testcase that depends on it.
if (llvm::isa<clang::TranslationUnitDecl>(it->second))
@@ -10086,4 +10127,3 @@ ClangASTContextForExpressions::GetMergerUnchecked() {
lldbassert(m_scratch_ast_source_ap != nullptr);
return m_scratch_ast_source_ap->GetMergerUnchecked();
}
-
diff --git a/source/Symbol/ClangASTImporter.cpp b/source/Symbol/ClangASTImporter.cpp
index 72ccaed43eaa..ea3b141c9e74 100644
--- a/source/Symbol/ClangASTImporter.cpp
+++ b/source/Symbol/ClangASTImporter.cpp
@@ -354,8 +354,7 @@ bool ClangASTImporter::CanImport(const CompilerType &type) {
clang::ObjCInterfaceDecl *class_interface_decl =
objc_class_type->getInterface();
// We currently can't complete objective C types through the newly added
- // ASTContext
- // because it only supports TagDecl objects right now...
+ // ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
if (ResolveDeclOrigin(class_interface_decl, NULL, NULL))
return true;
@@ -431,8 +430,7 @@ bool ClangASTImporter::Import(const CompilerType &type) {
clang::ObjCInterfaceDecl *class_interface_decl =
objc_class_type->getInterface();
// We currently can't complete objective C types through the newly added
- // ASTContext
- // because it only supports TagDecl objects right now...
+ // ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
if (ResolveDeclOrigin(class_interface_decl, NULL, NULL))
return CompleteAndFetchChildren(qual_type);
@@ -896,9 +894,9 @@ void ClangASTImporter::Minion::ImportDefinitionTo(clang::Decl *to,
}
}
- // If we're dealing with an Objective-C class, ensure that the inheritance has
- // been set up correctly. The ASTImporter may not do this correctly if the
- // class was originally sourced from symbols.
+ // If we're dealing with an Objective-C class, ensure that the inheritance
+ // has been set up correctly. The ASTImporter may not do this correctly if
+ // the class was originally sourced from symbols.
if (ObjCInterfaceDecl *to_objc_interface = dyn_cast<ObjCInterfaceDecl>(to)) {
do {
diff --git a/source/Symbol/CompactUnwindInfo.cpp b/source/Symbol/CompactUnwindInfo.cpp
index df71b17c09d0..7dda877582cc 100644
--- a/source/Symbol/CompactUnwindInfo.cpp
+++ b/source/Symbol/CompactUnwindInfo.cpp
@@ -262,8 +262,7 @@ void CompactUnwindInfo::ScanIndex(const ProcessSP &process_sp) {
if (m_unwindinfo_data_computed == false) {
if (m_section_sp->IsEncrypted()) {
// Can't get section contents of a protected/encrypted section until we
- // have a live
- // process and can read them out of memory.
+ // have a live process and can read them out of memory.
if (process_sp.get() == nullptr)
return;
m_section_contents_if_encrypted.reset(
@@ -329,11 +328,10 @@ void CompactUnwindInfo::ScanIndex(const ProcessSP &process_sp) {
return;
}
- // Parse the basic information from the indexes
- // We wait to scan the second level page info until it's needed
+ // Parse the basic information from the indexes We wait to scan the second
+ // level page info until it's needed
- // struct unwind_info_section_header_index_entry
- // {
+ // struct unwind_info_section_header_index_entry {
// uint32_t functionOffset;
// uint32_t secondLevelPagesSectionOffset;
// uint32_t lsdaIndexArraySectionOffset;
@@ -388,8 +386,7 @@ void CompactUnwindInfo::ScanIndex(const ProcessSP &process_sp) {
uint32_t CompactUnwindInfo::GetLSDAForFunctionOffset(uint32_t lsda_offset,
uint32_t lsda_count,
uint32_t function_offset) {
- // struct unwind_info_section_header_lsda_index_entry
- // {
+ // struct unwind_info_section_header_lsda_index_entry {
// uint32_t functionOffset;
// uint32_t lsdaOffset;
// };
@@ -419,8 +416,7 @@ lldb::offset_t CompactUnwindInfo::BinarySearchRegularSecondPage(
uint32_t entry_page_offset, uint32_t entry_count, uint32_t function_offset,
uint32_t *entry_func_start_offset, uint32_t *entry_func_end_offset) {
// typedef uint32_t compact_unwind_encoding_t;
- // struct unwind_info_regular_second_level_entry
- // {
+ // struct unwind_info_regular_second_level_entry {
// uint32_t functionOffset;
// compact_unwind_encoding_t encoding;
@@ -539,9 +535,9 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
auto next_it = it + 1;
if (next_it != m_indexes.end()) {
- // initialize the function offset end range to be the start of the
- // next index offset. If we find an entry which is at the end of
- // the index table, this will establish the range end.
+ // initialize the function offset end range to be the start of the next
+ // index offset. If we find an entry which is at the end of the index
+ // table, this will establish the range end.
unwind_info.valid_range_offset_end = next_it->function_offset;
}
@@ -554,15 +550,13 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
&offset); // UNWIND_SECOND_LEVEL_REGULAR or UNWIND_SECOND_LEVEL_COMPRESSED
if (kind == UNWIND_SECOND_LEVEL_REGULAR) {
- // struct unwind_info_regular_second_level_page_header
- // {
+ // struct unwind_info_regular_second_level_page_header {
// uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR
// uint16_t entryPageOffset;
// uint16_t entryCount;
// typedef uint32_t compact_unwind_encoding_t;
- // struct unwind_info_regular_second_level_entry
- // {
+ // struct unwind_info_regular_second_level_entry {
// uint32_t functionOffset;
// compact_unwind_encoding_t encoding;
@@ -612,8 +606,7 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
}
return true;
} else if (kind == UNWIND_SECOND_LEVEL_COMPRESSED) {
- // struct unwind_info_compressed_second_level_page_header
- // {
+ // struct unwind_info_compressed_second_level_page_header {
// uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED
// uint16_t entryPageOffset; // offset from this 2nd lvl page
// idx to array of entries
@@ -721,8 +714,8 @@ enum x86_64_eh_regnum {
// enough
};
-// Convert the compact_unwind_info.h register numbering scheme
-// to eRegisterKindEHFrame (eh_frame) register numbering scheme.
+// Convert the compact_unwind_info.h register numbering scheme to
+// eRegisterKindEHFrame (eh_frame) register numbering scheme.
uint32_t translate_to_eh_frame_regnum_x86_64(uint32_t unwind_regno) {
switch (unwind_regno) {
case UNWIND_X86_64_REG_RBX:
@@ -802,9 +795,8 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
case UNWIND_X86_64_MODE_STACK_IND: {
// The clang in Xcode 6 is emitting incorrect compact unwind encodings for
- // this
- // style of unwind. It was fixed in llvm r217020.
- // The clang in Xcode 7 has this fixed.
+ // this style of unwind. It was fixed in llvm r217020. The clang in Xcode
+ // 7 has this fixed.
return false;
} break;
@@ -861,17 +853,17 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
if (register_count > 0) {
- // We need to include (up to) 6 registers in 10 bits.
- // That would be 18 bits if we just used 3 bits per reg to indicate
- // the order they're saved on the stack.
+ // We need to include (up to) 6 registers in 10 bits. That would be 18
+ // bits if we just used 3 bits per reg to indicate the order they're
+ // saved on the stack.
//
// This is done with Lehmer code permutation, e.g. see
- // http://stackoverflow.com/questions/1506078/fast-permutation-number-permutation-mapping-algorithms
+ // http://stackoverflow.com/questions/1506078/fast-permutation-number-
+ // permutation-mapping-algorithms
int permunreg[6] = {0, 0, 0, 0, 0, 0};
- // This decodes the variable-base number in the 10 bits
- // and gives us the Lehmer code sequence which can then
- // be decoded.
+ // This decodes the variable-base number in the 10 bits and gives us the
+ // Lehmer code sequence which can then be decoded.
switch (register_count) {
case 6:
@@ -923,8 +915,8 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
break;
}
- // Decode the Lehmer code for this permutation of
- // the registers v. http://en.wikipedia.org/wiki/Lehmer_code
+ // Decode the Lehmer code for this permutation of the registers v.
+ // http://en.wikipedia.org/wiki/Lehmer_code
int registers[6] = {UNWIND_X86_64_REG_NONE, UNWIND_X86_64_REG_NONE,
UNWIND_X86_64_REG_NONE, UNWIND_X86_64_REG_NONE,
@@ -993,8 +985,8 @@ enum i386_eh_regnum {
// enough
};
-// Convert the compact_unwind_info.h register numbering scheme
-// to eRegisterKindEHFrame (eh_frame) register numbering scheme.
+// Convert the compact_unwind_info.h register numbering scheme to
+// eRegisterKindEHFrame (eh_frame) register numbering scheme.
uint32_t translate_to_eh_frame_regnum_i386(uint32_t unwind_regno) {
switch (unwind_regno) {
case UNWIND_X86_REG_EBX:
@@ -1123,17 +1115,17 @@ bool CompactUnwindInfo::CreateUnwindPlan_i386(Target &target,
if (register_count > 0) {
- // We need to include (up to) 6 registers in 10 bits.
- // That would be 18 bits if we just used 3 bits per reg to indicate
- // the order they're saved on the stack.
+ // We need to include (up to) 6 registers in 10 bits. That would be 18
+ // bits if we just used 3 bits per reg to indicate the order they're
+ // saved on the stack.
//
// This is done with Lehmer code permutation, e.g. see
- // http://stackoverflow.com/questions/1506078/fast-permutation-number-permutation-mapping-algorithms
+ // http://stackoverflow.com/questions/1506078/fast-permutation-number-
+ // permutation-mapping-algorithms
int permunreg[6] = {0, 0, 0, 0, 0, 0};
- // This decodes the variable-base number in the 10 bits
- // and gives us the Lehmer code sequence which can then
- // be decoded.
+ // This decodes the variable-base number in the 10 bits and gives us the
+ // Lehmer code sequence which can then be decoded.
switch (register_count) {
case 6:
@@ -1185,8 +1177,8 @@ bool CompactUnwindInfo::CreateUnwindPlan_i386(Target &target,
break;
}
- // Decode the Lehmer code for this permutation of
- // the registers v. http://en.wikipedia.org/wiki/Lehmer_code
+ // Decode the Lehmer code for this permutation of the registers v.
+ // http://en.wikipedia.org/wiki/Lehmer_code
int registers[6] = {UNWIND_X86_REG_NONE, UNWIND_X86_REG_NONE,
UNWIND_X86_REG_NONE, UNWIND_X86_REG_NONE,
@@ -1260,14 +1252,10 @@ enum arm64_eh_regnum {
pc = 32,
// Compact unwind encodes d8-d15 but we don't have eh_frame / dwarf reg #'s
- // for the 64-bit
- // fp regs. Normally in DWARF it's context sensitive - so it knows it is
- // fetching a
- // 32- or 64-bit quantity from reg v8 to indicate s0 or d0 - but the unwinder
- // is operating
- // at a lower level and we'd try to fetch 128 bits if we were told that v8
- // were stored on
- // the stack...
+ // for the 64-bit fp regs. Normally in DWARF it's context sensitive - so it
+ // knows it is fetching a 32- or 64-bit quantity from reg v8 to indicate s0
+ // or d0 - but the unwinder is operating at a lower level and we'd try to
+ // fetch 128 bits if we were told that v8 were stored on the stack...
v8 = 72,
v9 = 73,
v10 = 74,
diff --git a/source/Symbol/CompileUnit.cpp b/source/Symbol/CompileUnit.cpp
index 8ba83d438803..a4f0d4231e2f 100644
--- a/source/Symbol/CompileUnit.cpp
+++ b/source/Symbol/CompileUnit.cpp
@@ -67,10 +67,10 @@ void CompileUnit::GetDescription(Stream *s,
}
//----------------------------------------------------------------------
-// Dump the current contents of this object. No functions that cause on
-// demand parsing of functions, globals, statics are called, so this
-// is a good function to call to get an idea of the current contents of
-// the CompileUnit object.
+// Dump the current contents of this object. No functions that cause on demand
+// parsing of functions, globals, statics are called, so this is a good
+// function to call to get an idea of the current contents of the CompileUnit
+// object.
//----------------------------------------------------------------------
void CompileUnit::Dump(Stream *s, bool show_context) const {
const char *language = Language::GetNameForLanguageType(m_language);
@@ -118,28 +118,27 @@ FunctionSP CompileUnit::GetFunctionAtIndex(size_t idx) {
}
//----------------------------------------------------------------------
-// Find functions using the Mangled::Tokens token list. This
-// function currently implements an interactive approach designed to find
-// all instances of certain functions. It isn't designed to the
-// quickest way to lookup functions as it will need to iterate through
-// all functions and see if they match, though it does provide a powerful
-// and context sensitive way to search for all functions with a certain
-// name, all functions in a namespace, or all functions of a template
-// type. See Mangled::Tokens::Parse() comments for more information.
+// Find functions using the Mangled::Tokens token list. This function currently
+// implements an interactive approach designed to find all instances of certain
+// functions. It isn't designed to the quickest way to lookup functions as it
+// will need to iterate through all functions and see if they match, though it
+// does provide a powerful and context sensitive way to search for all
+// functions with a certain name, all functions in a namespace, or all
+// functions of a template type. See Mangled::Tokens::Parse() comments for more
+// information.
//
-// The function prototype will need to change to return a list of
-// results. It was originally used to help debug the Mangled class
-// and the Mangled::Tokens::MatchesQuery() function and it currently
-// will print out a list of matching results for the functions that
-// are currently in this compile unit.
+// The function prototype will need to change to return a list of results. It
+// was originally used to help debug the Mangled class and the
+// Mangled::Tokens::MatchesQuery() function and it currently will print out a
+// list of matching results for the functions that are currently in this
+// compile unit.
//
// A FindFunctions method should be called prior to this that takes
-// a regular function name (const char * or ConstString as a parameter)
-// before resorting to this slower but more complete function. The
-// other FindFunctions method should be able to take advantage of any
-// accelerator tables available in the debug information (which is
-// parsed by the SymbolFile parser plug-ins and registered with each
-// Module).
+// a regular function name (const char * or ConstString as a parameter) before
+// resorting to this slower but more complete function. The other FindFunctions
+// method should be able to take advantage of any accelerator tables available
+// in the debug information (which is parsed by the SymbolFile parser plug-ins
+// and registered with each Module).
//----------------------------------------------------------------------
// void
// CompileUnit::FindFunctions(const Mangled::Tokens& tokens)
@@ -283,13 +282,12 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
bool exact, uint32_t resolve_scope,
SymbolContextList &sc_list) {
// First find all of the file indexes that match our "file_spec". If
- // "file_spec" has an empty directory, then only compare the basenames
- // when finding file indexes
+ // "file_spec" has an empty directory, then only compare the basenames when
+ // finding file indexes
std::vector<uint32_t> file_indexes;
const bool full_match = (bool)file_spec.GetDirectory();
- const bool remove_backup_dots = true;
bool file_spec_matches_cu_file_spec =
- FileSpec::Equal(file_spec, *this, full_match, remove_backup_dots);
+ FileSpec::Equal(file_spec, *this, full_match);
// If we are not looking for inlined functions and our file spec doesn't
// match then we are done...
@@ -297,11 +295,10 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
return 0;
uint32_t file_idx =
- GetSupportFiles().FindFileIndex(1, file_spec, true, remove_backup_dots);
+ GetSupportFiles().FindFileIndex(1, file_spec, true);
while (file_idx != UINT32_MAX) {
file_indexes.push_back(file_idx);
- file_idx = GetSupportFiles().FindFileIndex(file_idx + 1, file_spec, true,
- remove_backup_dots);
+ file_idx = GetSupportFiles().FindFileIndex(file_idx + 1, file_spec, true);
}
const size_t num_file_indexes = file_indexes.size();
@@ -321,23 +318,23 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
uint32_t line_idx;
if (num_file_indexes == 1) {
- // We only have a single support file that matches, so use
- // the line table function that searches for a line entries
- // that match a single support file index
+ // We only have a single support file that matches, so use the line
+ // table function that searches for a line entries that match a single
+ // support file index
LineEntry line_entry;
line_idx = line_table->FindLineEntryIndexByFileIndex(
0, file_indexes.front(), line, exact, &line_entry);
- // If "exact == true", then "found_line" will be the same
- // as "line". If "exact == false", the "found_line" will be the
- // closest line entry with a line number greater than "line" and
- // we will use this for our subsequent line exact matches below.
+ // If "exact == true", then "found_line" will be the same as "line". If
+ // "exact == false", the "found_line" will be the closest line entry
+ // with a line number greater than "line" and we will use this for our
+ // subsequent line exact matches below.
found_line = line_entry.line;
while (line_idx != UINT32_MAX) {
- // If they only asked for the line entry, then we're done, we can just
- // copy that over.
- // But if they wanted more than just the line number, fill it in.
+ // If they only asked for the line entry, then we're done, we can
+ // just copy that over. But if they wanted more than just the line
+ // number, fill it in.
if (resolve_scope == eSymbolContextLineEntry) {
sc.line_entry = line_entry;
} else {
@@ -351,17 +348,17 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
&line_entry);
}
} else {
- // We found multiple support files that match "file_spec" so use
- // the line table function that searches for a line entries
- // that match a multiple support file indexes.
+ // We found multiple support files that match "file_spec" so use the
+ // line table function that searches for a line entries that match a
+ // multiple support file indexes.
LineEntry line_entry;
line_idx = line_table->FindLineEntryIndexByFileIndex(
0, file_indexes, line, exact, &line_entry);
- // If "exact == true", then "found_line" will be the same
- // as "line". If "exact == false", the "found_line" will be the
- // closest line entry with a line number greater than "line" and
- // we will use this for our subsequent line exact matches below.
+ // If "exact == true", then "found_line" will be the same as "line". If
+ // "exact == false", the "found_line" will be the closest line entry
+ // with a line number greater than "line" and we will use this for our
+ // subsequent line exact matches below.
found_line = line_entry.line;
while (line_idx != UINT32_MAX) {
@@ -379,8 +376,8 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
}
}
} else if (file_spec_matches_cu_file_spec && !check_inlines) {
- // only append the context if we aren't looking for inline call sites
- // by file and line and if the file spec matches that of the compile unit
+ // only append the context if we aren't looking for inline call sites by
+ // file and line and if the file spec matches that of the compile unit
sc_list.Append(sc);
}
return sc_list.GetSize() - prev_size;
diff --git a/source/Symbol/CompilerType.cpp b/source/Symbol/CompilerType.cpp
index 5d845361b03c..2dd1d3ebd04b 100644
--- a/source/Symbol/CompilerType.cpp
+++ b/source/Symbol/CompilerType.cpp
@@ -638,8 +638,8 @@ CompilerType CompilerType::GetChildCompilerTypeAtIndex(
}
// Look for a child member (doesn't include base classes, but it does include
-// their members) in the type hierarchy. Returns an index path into "clang_type"
-// on how to reach the appropriate member.
+// their members) in the type hierarchy. Returns an index path into
+// "clang_type" on how to reach the appropriate member.
//
// class A
// {
@@ -662,16 +662,13 @@ CompilerType CompilerType::GetChildCompilerTypeAtIndex(
// "m_b" in it:
//
// With omit_empty_base_classes == false we would get an integer array back
-// with:
-// { 1, 1 }
-// The first index 1 is the child index for "class A" within class C
-// The second index 1 is the child index for "m_b" within class A
+// with: { 1, 1 } The first index 1 is the child index for "class A" within
+// class C The second index 1 is the child index for "m_b" within class A
//
-// With omit_empty_base_classes == true we would get an integer array back with:
-// { 0, 1 }
-// The first index 0 is the child index for "class A" within class C (since
-// class B doesn't have any members it doesn't count)
-// The second index 1 is the child index for "m_b" within class A
+// With omit_empty_base_classes == true we would get an integer array back
+// with: { 0, 1 } The first index 0 is the child index for "class A" within
+// class C (since class B doesn't have any members it doesn't count) The second
+// index 1 is the child index for "m_b" within class A
size_t CompilerType::GetIndexOfChildMemberWithName(
const char *name, bool omit_empty_base_classes,
@@ -987,8 +984,8 @@ bool CompilerType::ReadFromMemory(lldb_private::ExecutionContext *exe_ctx,
if (!IsValid())
return false;
- // Can't convert a file address to anything valid without more
- // context (which Module it came from)
+ // Can't convert a file address to anything valid without more context (which
+ // Module it came from)
if (address_type == eAddressTypeFile)
return false;
@@ -1029,8 +1026,8 @@ bool CompilerType::WriteToMemory(lldb_private::ExecutionContext *exe_ctx,
if (!IsValid())
return false;
- // Can't convert a file address to anything valid without more
- // context (which Module it came from)
+ // Can't convert a file address to anything valid without more context (which
+ // Module it came from)
if (address_type == eAddressTypeFile)
return false;
diff --git a/source/Symbol/DWARFCallFrameInfo.cpp b/source/Symbol/DWARFCallFrameInfo.cpp
index 572648d05f09..1bf9ff99e015 100644
--- a/source/Symbol/DWARFCallFrameInfo.cpp
+++ b/source/Symbol/DWARFCallFrameInfo.cpp
@@ -27,8 +27,8 @@ using namespace lldb_private;
//----------------------------------------------------------------------
// GetDwarfEHPtr
//
-// Used for calls when the value type is specified by a DWARF EH Frame
-// pointer encoding.
+// Used for calls when the value type is specified by a DWARF EH Frame pointer
+// encoding.
//----------------------------------------------------------------------
static uint64_t
GetGNUEHPointer(const DataExtractor &DE, offset_t *offset_ptr,
@@ -83,8 +83,8 @@ GetGNUEHPointer(const DataExtractor &DE, offset_t *offset_ptr,
break;
case DW_EH_PE_aligned: {
- // SetPointerSize should be called prior to extracting these so the
- // pointer size is cached
+ // SetPointerSize should be called prior to extracting these so the pointer
+ // size is cached
assert(addr_size != 0);
if (addr_size) {
// Align to a address size boundary first
@@ -154,8 +154,8 @@ DWARFCallFrameInfo::DWARFCallFrameInfo(ObjectFile &objfile,
bool DWARFCallFrameInfo::GetUnwindPlan(Address addr, UnwindPlan &unwind_plan) {
FDEEntryMap::Entry fde_entry;
- // Make sure that the Address we're searching for is the same object file
- // as this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
+ // Make sure that the Address we're searching for is the same object file as
+ // this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
ModuleSP module_sp = addr.GetModule();
if (module_sp.get() == nullptr || module_sp->GetObjectFile() == nullptr ||
module_sp->GetObjectFile() != &m_objfile)
@@ -168,8 +168,8 @@ bool DWARFCallFrameInfo::GetUnwindPlan(Address addr, UnwindPlan &unwind_plan) {
bool DWARFCallFrameInfo::GetAddressRange(Address addr, AddressRange &range) {
- // Make sure that the Address we're searching for is the same object file
- // as this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
+ // Make sure that the Address we're searching for is the same object file as
+ // this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
ModuleSP module_sp = addr.GetModule();
if (module_sp.get() == nullptr || module_sp->GetObjectFile() == nullptr ||
module_sp->GetObjectFile() != &m_objfile)
@@ -291,8 +291,8 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) {
return nullptr;
}
- // m_cfi_data uses address size from target architecture of the process
- // may ignore these fields?
+ // m_cfi_data uses address size from target architecture of the process may
+ // ignore these fields?
if (m_type == DWARF && cie_sp->version >= CFI_VERSION4) {
cie_sp->address_size = m_cfi_data.GetU8(&offset);
cie_sp->segment_size = m_cfi_data.GetU8(&offset);
@@ -307,15 +307,15 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) {
: m_cfi_data.GetU8(&offset);
if (cie_sp->augmentation[0]) {
- // Get the length of the eh_frame augmentation data
- // which starts with a ULEB128 length in bytes
+ // Get the length of the eh_frame augmentation data which starts with a
+ // ULEB128 length in bytes
const size_t aug_data_len = (size_t)m_cfi_data.GetULEB128(&offset);
const size_t aug_data_end = offset + aug_data_len;
const size_t aug_str_len = strlen(cie_sp->augmentation);
// A 'z' may be present as the first character of the string.
- // If present, the Augmentation Data field shall be present.
- // The contents of the Augmentation Data shall be interpreted
- // according to other characters in the Augmentation String.
+ // If present, the Augmentation Data field shall be present. The contents
+ // of the Augmentation Data shall be interpreted according to other
+ // characters in the Augmentation String.
if (cie_sp->augmentation[0] == 'z') {
// Extract the Augmentation Data
size_t aug_str_idx = 0;
@@ -323,31 +323,27 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) {
char aug = cie_sp->augmentation[aug_str_idx];
switch (aug) {
case 'L':
- // Indicates the presence of one argument in the
- // Augmentation Data of the CIE, and a corresponding
- // argument in the Augmentation Data of the FDE. The
- // argument in the Augmentation Data of the CIE is
- // 1-byte and represents the pointer encoding used
- // for the argument in the Augmentation Data of the
- // FDE, which is the address of a language-specific
- // data area (LSDA). The size of the LSDA pointer is
- // specified by the pointer encoding used.
+ // Indicates the presence of one argument in the Augmentation Data
+ // of the CIE, and a corresponding argument in the Augmentation
+ // Data of the FDE. The argument in the Augmentation Data of the
+ // CIE is 1-byte and represents the pointer encoding used for the
+ // argument in the Augmentation Data of the FDE, which is the
+ // address of a language-specific data area (LSDA). The size of the
+ // LSDA pointer is specified by the pointer encoding used.
cie_sp->lsda_addr_encoding = m_cfi_data.GetU8(&offset);
break;
case 'P':
- // Indicates the presence of two arguments in the
- // Augmentation Data of the CIE. The first argument
- // is 1-byte and represents the pointer encoding
- // used for the second argument, which is the
- // address of a personality routine handler. The
- // size of the personality routine pointer is
- // specified by the pointer encoding used.
+ // Indicates the presence of two arguments in the Augmentation Data
+ // of the CIE. The first argument is 1-byte and represents the
+ // pointer encoding used for the second argument, which is the
+ // address of a personality routine handler. The size of the
+ // personality routine pointer is specified by the pointer encoding
+ // used.
//
- // The address of the personality function will
- // be stored at this location. Pre-execution, it
- // will be all zero's so don't read it until we're
- // trying to do an unwind & the reloc has been
+ // The address of the personality function will be stored at this
+ // location. Pre-execution, it will be all zero's so don't read it
+ // until we're trying to do an unwind & the reloc has been
// resolved.
{
uint8_t arg_ptr_encoding = m_cfi_data.GetU8(&offset);
@@ -360,22 +356,21 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) {
case 'R':
// A 'R' may be present at any position after the
- // first character of the string. The Augmentation
- // Data shall include a 1 byte argument that
- // represents the pointer encoding for the address
- // pointers used in the FDE.
- // Example: 0x1B == DW_EH_PE_pcrel | DW_EH_PE_sdata4
+ // first character of the string. The Augmentation Data shall
+ // include a 1 byte argument that represents the pointer encoding
+ // for the address pointers used in the FDE. Example: 0x1B ==
+ // DW_EH_PE_pcrel | DW_EH_PE_sdata4
cie_sp->ptr_encoding = m_cfi_data.GetU8(&offset);
break;
}
}
} else if (strcmp(cie_sp->augmentation, "eh") == 0) {
- // If the Augmentation string has the value "eh", then
- // the EH Data field shall be present
+ // If the Augmentation string has the value "eh", then the EH Data
+ // field shall be present
}
- // Set the offset to be the end of the augmentation data just in case
- // we didn't understand any of the data.
+ // Set the offset to be the end of the augmentation data just in case we
+ // didn't understand any of the data.
offset = (uint32_t)aug_data_end;
}
@@ -408,10 +403,8 @@ void DWARFCallFrameInfo::GetCFIData() {
}
}
// Scan through the eh_frame or debug_frame section looking for FDEs and noting
-// the start/end addresses
-// of the functions and a pointer back to the function's FDE for later
-// expansion.
-// Internalize CIEs as we come across them.
+// the start/end addresses of the functions and a pointer back to the
+// function's FDE for later expansion. Internalize CIEs as we come across them.
void DWARFCallFrameInfo::GetFDEIndex() {
if (m_section_sp.get() == nullptr || m_section_sp->IsEncrypted())
@@ -469,8 +462,8 @@ void DWARFCallFrameInfo::GetFDEIndex() {
}
// An FDE entry contains CIE_pointer in debug_frame in same place as cie_id
- // in eh_frame. CIE_pointer is an offset into the .debug_frame section.
- // So, variable cie_offset should be equal to cie_id for debug_frame.
+ // in eh_frame. CIE_pointer is an offset into the .debug_frame section. So,
+ // variable cie_offset should be equal to cie_id for debug_frame.
// FDE entries with cie_id == 0 shouldn't be ignored for it.
if ((cie_id == 0 && m_type == EH) || cie_id == UINT32_MAX || len == 0) {
auto cie_sp = ParseCIE(current_entry);
@@ -556,9 +549,8 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
// FDE entries with zeroth cie_offset may occur for debug_frame.
assert(!(m_type == EH && 0 == cie_offset) && cie_offset != UINT32_MAX);
- // Translate the CIE_id from the eh_frame format, which
- // is relative to the FDE offset, into a __eh_frame section
- // offset
+ // Translate the CIE_id from the eh_frame format, which is relative to the
+ // FDE offset, into a __eh_frame section offset
if (m_type == EH) {
unwind_plan.SetSourceName("eh_frame CFI");
cie_offset = current_entry + (is_64bit ? 12 : 4) - cie_offset;
@@ -652,10 +644,10 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
case DW_CFA_advance_loc: // (Row Creation Instruction)
{ // 0x40 - high 2 bits are 0x1, lower 6 bits are delta
// takes a single argument that represents a constant delta. The
- // required action is to create a new table row with a location
- // value that is computed by taking the current entry's location
- // value and adding (delta * code_align). All other
- // values in the new row are initially identical to the current row.
+ // required action is to create a new table row with a location value
+ // that is computed by taking the current entry's location value and
+ // adding (delta * code_align). All other values in the new row are
+ // initially identical to the current row.
unwind_plan.AppendRow(row);
UnwindPlan::Row *newrow = new UnwindPlan::Row;
*newrow = *row.get();
@@ -670,11 +662,10 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
// required action is to change the rule for the indicated register
// to the rule assigned it by the initial_instructions in the CIE.
uint32_t reg_num = extended_opcode;
- // We only keep enough register locations around to
- // unwind what is in our thread, and these are organized
- // by the register index in that state, so we need to convert our
- // eh_frame register number from the EH frame info, to a register
- // index
+ // We only keep enough register locations around to unwind what is in
+ // our thread, and these are organized by the register index in that
+ // state, so we need to convert our eh_frame register number from the
+ // EH frame info, to a register index
if (unwind_plan.IsValidRowIndex(0) &&
unwind_plan.GetRowAtIndex(0)->GetRegisterInfo(reg_num,
@@ -756,8 +747,8 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
case DW_CFA_remember_state: // 0xA
{
// These instructions define a stack of information. Encountering the
- // DW_CFA_remember_state instruction means to save the rules for every
- // register on the current row on the stack. Encountering the
+ // DW_CFA_remember_state instruction means to save the rules for
+ // every register on the current row on the stack. Encountering the
// DW_CFA_restore_state instruction means to pop the set of rules off
// the stack and place them in the current row. (This operation is
// useful for compilers that move epilogue code into the body of a
@@ -772,8 +763,8 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
case DW_CFA_restore_state: // 0xB
{
// These instructions define a stack of information. Encountering the
- // DW_CFA_remember_state instruction means to save the rules for every
- // register on the current row on the stack. Encountering the
+ // DW_CFA_remember_state instruction means to save the rules for
+ // every register on the current row on the stack. Encountering the
// DW_CFA_restore_state instruction means to pop the set of rules off
// the stack and place them in the current row. (This operation is
// useful for compilers that move epilogue code into the body of a
@@ -798,10 +789,9 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
case DW_CFA_GNU_args_size: // 0x2e
{
// The DW_CFA_GNU_args_size instruction takes an unsigned LEB128
- // operand
- // representing an argument size. This instruction specifies the total
- // of
- // the size of the arguments which have been pushed onto the stack.
+ // operand representing an argument size. This instruction specifies
+ // the total of the size of the arguments which have been pushed onto
+ // the stack.
// TODO: Figure out how we should handle this.
m_cfi_data.GetULEB128(&offset);
@@ -834,9 +824,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
// register
// takes two arguments: an unsigned LEB128 constant representing a
// factored offset and a register number. The required action is to
- // change the rule for the register indicated by the register number
- // to be an offset(N) rule with a value of
- // (N = factored offset * data_align).
+ // change the rule for the register indicated by the register number to
+ // be an offset(N) rule with a value of (N = factored offset *
+ // data_align).
uint8_t reg_num = extended_opcode;
int32_t op_offset = (int32_t)m_cfi_data.GetULEB128(&offset) * data_align;
reg_location.SetAtCFAPlusOffset(op_offset);
@@ -851,8 +841,8 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_offset_extended: // 0x5
{
- // takes two unsigned LEB128 arguments representing a register number
- // and a factored offset. This instruction is identical to DW_CFA_offset
+ // takes two unsigned LEB128 arguments representing a register number and
+ // a factored offset. This instruction is identical to DW_CFA_offset
// except for the encoding and size of the register argument.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
int32_t op_offset = (int32_t)m_cfi_data.GetULEB128(&offset) * data_align;
@@ -888,9 +878,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_register: // 0x9
{
- // takes two unsigned LEB128 arguments representing register numbers.
- // The required action is to set the rule for the first register to be
- // the second register.
+ // takes two unsigned LEB128 arguments representing register numbers. The
+ // required action is to set the rule for the first register to be the
+ // second register.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
uint32_t other_reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
UnwindPlan::Row::RegisterLocation reg_location;
@@ -901,10 +891,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa: // 0xC (CFA Definition Instruction)
{
- // Takes two unsigned LEB128 operands representing a register
- // number and a (non-factored) offset. The required action
- // is to define the current CFA rule to use the provided
- // register and offset.
+ // Takes two unsigned LEB128 operands representing a register number and
+ // a (non-factored) offset. The required action is to define the current
+ // CFA rule to use the provided register and offset.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
int32_t op_offset = (int32_t)m_cfi_data.GetULEB128(&offset);
row.GetCFAValue().SetIsRegisterPlusOffset(reg_num, op_offset);
@@ -914,8 +903,8 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa_register: // 0xD (CFA Definition Instruction)
{
// takes a single unsigned LEB128 argument representing a register
- // number. The required action is to define the current CFA rule to
- // use the provided register (but to keep the old offset).
+ // number. The required action is to define the current CFA rule to use
+ // the provided register (but to keep the old offset).
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
row.GetCFAValue().SetIsRegisterPlusOffset(reg_num,
row.GetCFAValue().GetOffset());
@@ -924,10 +913,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa_offset: // 0xE (CFA Definition Instruction)
{
- // Takes a single unsigned LEB128 operand representing a
- // (non-factored) offset. The required action is to define
- // the current CFA rule to use the provided offset (but
- // to keep the old register).
+ // Takes a single unsigned LEB128 operand representing a (non-factored)
+ // offset. The required action is to define the current CFA rule to use
+ // the provided offset (but to keep the old register).
int32_t op_offset = (int32_t)m_cfi_data.GetULEB128(&offset);
row.GetCFAValue().SetIsRegisterPlusOffset(
row.GetCFAValue().GetRegisterNumber(), op_offset);
@@ -945,14 +933,13 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_expression: // 0x10
{
- // Takes two operands: an unsigned LEB128 value representing
- // a register number, and a DW_FORM_block value representing a DWARF
- // expression. The required action is to change the rule for the
- // register indicated by the register number to be an expression(E)
- // rule where E is the DWARF expression. That is, the DWARF
- // expression computes the address. The value of the CFA is
- // pushed on the DWARF evaluation stack prior to execution of
- // the DWARF expression.
+ // Takes two operands: an unsigned LEB128 value representing a register
+ // number, and a DW_FORM_block value representing a DWARF expression. The
+ // required action is to change the rule for the register indicated by
+ // the register number to be an expression(E) rule where E is the DWARF
+ // expression. That is, the DWARF expression computes the address. The
+ // value of the CFA is pushed on the DWARF evaluation stack prior to
+ // execution of the DWARF expression.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
uint32_t block_len = (uint32_t)m_cfi_data.GetULEB128(&offset);
const uint8_t *block_data =
@@ -965,10 +952,10 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_offset_extended_sf: // 0x11
{
- // takes two operands: an unsigned LEB128 value representing a
- // register number and a signed LEB128 factored offset. This
- // instruction is identical to DW_CFA_offset_extended except
- // that the second operand is signed and factored.
+ // takes two operands: an unsigned LEB128 value representing a register
+ // number and a signed LEB128 factored offset. This instruction is
+ // identical to DW_CFA_offset_extended except that the second operand is
+ // signed and factored.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
int32_t op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
UnwindPlan::Row::RegisterLocation reg_location;
@@ -979,10 +966,10 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa_sf: // 0x12 (CFA Definition Instruction)
{
- // Takes two operands: an unsigned LEB128 value representing
- // a register number and a signed LEB128 factored offset.
- // This instruction is identical to DW_CFA_def_cfa except
- // that the second operand is signed and factored.
+ // Takes two operands: an unsigned LEB128 value representing a register
+ // number and a signed LEB128 factored offset. This instruction is
+ // identical to DW_CFA_def_cfa except that the second operand is signed
+ // and factored.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
int32_t op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
row.GetCFAValue().SetIsRegisterPlusOffset(reg_num, op_offset);
@@ -991,9 +978,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa_offset_sf: // 0x13 (CFA Definition Instruction)
{
- // takes a signed LEB128 operand representing a factored
- // offset. This instruction is identical to DW_CFA_def_cfa_offset
- // except that the operand is signed and factored.
+ // takes a signed LEB128 operand representing a factored offset. This
+ // instruction is identical to DW_CFA_def_cfa_offset except that the
+ // operand is signed and factored.
int32_t op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
uint32_t cfa_regnum = row.GetCFAValue().GetRegisterNumber();
row.GetCFAValue().SetIsRegisterPlusOffset(cfa_regnum, op_offset);
@@ -1003,9 +990,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_val_expression: // 0x16
{
// takes two operands: an unsigned LEB128 value representing a register
- // number, and a DW_FORM_block value representing a DWARF expression.
- // The required action is to change the rule for the register indicated
- // by the register number to be a val_expression(E) rule where E is the
+ // number, and a DW_FORM_block value representing a DWARF expression. The
+ // required action is to change the rule for the register indicated by
+ // the register number to be a val_expression(E) rule where E is the
// DWARF expression. That is, the DWARF expression computes the value of
// the given register. The value of the CFA is pushed on the DWARF
// evaluation stack prior to execution of the DWARF expression.
diff --git a/source/Symbol/Declaration.cpp b/source/Symbol/Declaration.cpp
index 7cee6c5a3ef3..83df578da2e3 100644
--- a/source/Symbol/Declaration.cpp
+++ b/source/Symbol/Declaration.cpp
@@ -91,7 +91,7 @@ bool lldb_private::operator==(const Declaration &lhs, const Declaration &rhs) {
return lhs.GetFile() == rhs.GetFile();
#else
if (lhs.GetLine() == rhs.GetLine())
- return FileSpec::Equal(lhs.GetFile(), rhs.GetFile(), true, true);
+ return FileSpec::Equal(lhs.GetFile(), rhs.GetFile(), true);
#endif
return false;
}
diff --git a/source/Symbol/FuncUnwinders.cpp b/source/Symbol/FuncUnwinders.cpp
index b9f50cd1b12f..2384d35e3d36 100644
--- a/source/Symbol/FuncUnwinders.cpp
+++ b/source/Symbol/FuncUnwinders.cpp
@@ -174,10 +174,9 @@ UnwindPlanSP FuncUnwinders::GetEHFrameAugmentedUnwindPlan(Target &target,
m_tried_unwind_plan_eh_frame_augmented)
return m_unwind_plan_eh_frame_augmented_sp;
- // Only supported on x86 architectures where we get eh_frame from the compiler
- // that describes
- // the prologue instructions perfectly, and sometimes the epilogue
- // instructions too.
+ // Only supported on x86 architectures where we get eh_frame from the
+ // compiler that describes the prologue instructions perfectly, and sometimes
+ // the epilogue instructions too.
if (target.GetArchitecture().GetCore() != ArchSpec::eCore_x86_32_i386 &&
target.GetArchitecture().GetCore() != ArchSpec::eCore_x86_64_x86_64 &&
target.GetArchitecture().GetCore() != ArchSpec::eCore_x86_64_x86_64h) {
@@ -194,8 +193,7 @@ UnwindPlanSP FuncUnwinders::GetEHFrameAugmentedUnwindPlan(Target &target,
m_unwind_plan_eh_frame_augmented_sp.reset(new UnwindPlan(*eh_frame_plan));
// Augment the eh_frame instructions with epilogue descriptions if necessary
- // so the
- // UnwindPlan can be used at any instruction in the function.
+ // so the UnwindPlan can be used at any instruction in the function.
UnwindAssemblySP assembly_profiler_sp(GetUnwindAssemblyProfiler(target));
if (assembly_profiler_sp) {
@@ -238,7 +236,8 @@ FuncUnwinders::GetDebugFrameAugmentedUnwindPlan(Target &target, Thread &thread,
new UnwindPlan(*debug_frame_plan));
// Augment the debug_frame instructions with epilogue descriptions if
- // necessary so the UnwindPlan can be used at any instruction in the function.
+ // necessary so the UnwindPlan can be used at any instruction in the
+ // function.
UnwindAssemblySP assembly_profiler_sp(GetUnwindAssemblyProfiler(target));
if (assembly_profiler_sp) {
@@ -275,8 +274,7 @@ UnwindPlanSP FuncUnwinders::GetAssemblyUnwindPlan(Target &target,
// This method compares the pc unwind rule in the first row of two UnwindPlans.
// If they have the same way of getting the pc value (e.g. "CFA - 8" + "CFA is
-// sp"),
-// then it will return LazyBoolTrue.
+// sp"), then it will return LazyBoolTrue.
LazyBool FuncUnwinders::CompareUnwindPlansForIdenticalInitialPCLocation(
Thread &thread, const UnwindPlanSP &a, const UnwindPlanSP &b) {
LazyBool plans_are_identical = eLazyBoolCalculate;
@@ -320,22 +318,22 @@ UnwindPlanSP FuncUnwinders::GetUnwindPlanAtNonCallSite(Target &target,
UnwindPlanSP assembly_sp =
GetAssemblyUnwindPlan(target, thread, current_offset);
- // This point of this code is to detect when a function is using a
- // non-standard ABI, and the eh_frame correctly describes that alternate ABI.
+ // This point of this code is to detect when a function is using a non-
+ // standard ABI, and the eh_frame correctly describes that alternate ABI.
// This is addressing a specific situation on x86_64 linux systems where one
// function in a library pushes a value on the stack and jumps to another
- // function. So using an assembly instruction based unwind will not work when
- // you're in the second function - the stack has been modified in a non-ABI
- // way. But we have eh_frame that correctly describes how to unwind from this
- // location. So we're looking to see if the initial pc register save location
- // from the eh_frame is different from the assembly unwind, the arch default
- // unwind, and the arch default at initial function entry.
+ // function. So using an assembly instruction based unwind will not work
+ // when you're in the second function - the stack has been modified in a non-
+ // ABI way. But we have eh_frame that correctly describes how to unwind from
+ // this location. So we're looking to see if the initial pc register save
+ // location from the eh_frame is different from the assembly unwind, the arch
+ // default unwind, and the arch default at initial function entry.
//
// We may have eh_frame that describes the entire function -- or we may have
// eh_frame that only describes the unwind after the prologue has executed --
// so we need to check both the arch default (once the prologue has executed)
- // and the arch default at initial function entry. And we may be running on a
- // target where we have only some of the assembly/arch default unwind plans
+ // and the arch default at initial function entry. And we may be running on
+ // a target where we have only some of the assembly/arch default unwind plans
// available.
if (CompareUnwindPlansForIdenticalInitialPCLocation(
diff --git a/source/Symbol/Function.cpp b/source/Symbol/Function.cpp
index 9464cef0bc73..f642c186a19f 100644
--- a/source/Symbol/Function.cpp
+++ b/source/Symbol/Function.cpp
@@ -24,9 +24,8 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// Basic function information is contained in the FunctionInfo class.
-// It is designed to contain the name, linkage name, and declaration
-// location.
+// Basic function information is contained in the FunctionInfo class. It is
+// designed to contain the name, linkage name, and declaration location.
//----------------------------------------------------------------------
FunctionInfo::FunctionInfo(const char *name, const Declaration *decl_ptr)
: m_name(name), m_declaration(decl_ptr) {}
@@ -188,8 +187,7 @@ void Function::GetEndLineSourceInfo(FileSpec &source_file, uint32_t &line_no) {
source_file.Clear();
// The -1 is kind of cheesy, but I want to get the last line entry for the
- // given function, not the
- // first entry of the next.
+ // given function, not the first entry of the next.
Address scratch_addr(GetAddressRange().GetBaseAddress());
scratch_addr.SetOffset(scratch_addr.GetOffset() +
GetAddressRange().GetByteSize() - 1);
@@ -331,9 +329,8 @@ size_t Function::MemorySize() const {
bool Function::GetIsOptimized() {
bool result = false;
- // Currently optimization is only indicted by the
- // vendor extension DW_AT_APPLE_optimized which
- // is set on a compile unit level.
+ // Currently optimization is only indicted by the vendor extension
+ // DW_AT_APPLE_optimized which is set on a compile unit level.
if (m_comp_unit) {
result = m_comp_unit->GetIsOptimized();
}
@@ -441,11 +438,11 @@ uint32_t Function::GetPrologueByteSize() {
}
}
- // If we didn't find the end of the prologue in the line tables,
- // then just use the end address of the first line table entry
+ // If we didn't find the end of the prologue in the line tables, then
+ // just use the end address of the first line table entry
if (prologue_end_file_addr == LLDB_INVALID_ADDRESS) {
- // Check the first few instructions and look for one that has
- // a line number that's different than the first entry.
+ // Check the first few instructions and look for one that has a line
+ // number that's different than the first entry.
uint32_t last_line_entry_idx = first_line_entry_idx + 6;
for (uint32_t idx = first_line_entry_idx + 1;
idx < last_line_entry_idx; ++idx) {
@@ -498,8 +495,8 @@ uint32_t Function::GetPrologueByteSize() {
}
}
- // Verify that this prologue end file address in the function's
- // address range just to be sure
+ // Verify that this prologue end file address in the function's address
+ // range just to be sure
if (func_start_file_addr < prologue_end_file_addr &&
prologue_end_file_addr < func_end_file_addr) {
m_prologue_byte_size = prologue_end_file_addr - func_start_file_addr;
diff --git a/source/Symbol/GoASTContext.cpp b/source/Symbol/GoASTContext.cpp
index 6761a605e46b..da5c82b2cb55 100644
--- a/source/Symbol/GoASTContext.cpp
+++ b/source/Symbol/GoASTContext.cpp
@@ -667,8 +667,7 @@ GoASTContext::GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type) {
}
// Returns -1 if this isn't a function of if the function doesn't have a
-// prototype
-// Returns a value >= 0 if there is a prototype.
+// prototype Returns a value >= 0 if there is a prototype.
int GoASTContext::GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) {
return GetNumberOfFunctionArguments(type);
}
@@ -1008,8 +1007,8 @@ CompilerType GoASTContext::GetChildCompilerTypeAtIndex(
return CompilerType();
}
-// Lookup a child given a name. This function will match base class names
-// and member member names in "clang_type" only, not descendants.
+// Lookup a child given a name. This function will match base class names and
+// member member names in "clang_type" only, not descendants.
uint32_t
GoASTContext::GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
const char *name,
@@ -1048,8 +1047,8 @@ size_t GoASTContext::GetIndexOfChildMemberWithName(
return 1;
}
-// Converts "s" to a floating point value and place resulting floating
-// point bytes in the "dst" buffer.
+// Converts "s" to a floating point value and place resulting floating point
+// bytes in the "dst" buffer.
size_t
GoASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
const char *s, uint8_t *dst,
@@ -1080,9 +1079,8 @@ void GoASTContext::DumpValue(lldb::opaque_compiler_type_t type,
uint32_t field_idx = 0;
for (auto *field = st->GetField(field_idx); field != nullptr;
field_idx++) {
- // Print the starting squiggly bracket (if this is the
- // first member) or comma (for member 2 and beyond) for
- // the struct/union/class member.
+ // Print the starting squiggly bracket (if this is the first member) or
+ // comma (for member 2 and beyond) for the struct/union/class member.
if (field_idx == 0)
s->PutChar('{');
else
@@ -1137,9 +1135,8 @@ void GoASTContext::DumpValue(lldb::opaque_compiler_type_t type,
uint64_t element_idx;
for (element_idx = 0; element_idx < a->GetLength(); ++element_idx) {
- // Print the starting squiggly bracket (if this is the
- // first member) or comman (for member 2 and beyong) for
- // the struct/union/class member.
+ // Print the starting squiggly bracket (if this is the first member) or
+ // comman (for member 2 and beyong) for the struct/union/class member.
if (element_idx == 0)
s->PutChar('{');
else
diff --git a/source/Symbol/LineEntry.cpp b/source/Symbol/LineEntry.cpp
index 691afdf5ed06..21aa2557518d 100644
--- a/source/Symbol/LineEntry.cpp
+++ b/source/Symbol/LineEntry.cpp
@@ -170,9 +170,9 @@ int LineEntry::Compare(const LineEntry &a, const LineEntry &b) {
if (a_byte_size > b_byte_size)
return +1;
- // Check for an end sequence entry mismatch after we have determined
- // that the address values are equal. If one of the items is an end
- // sequence, we don't care about the line, file, or column info.
+ // Check for an end sequence entry mismatch after we have determined that the
+ // address values are equal. If one of the items is an end sequence, we don't
+ // care about the line, file, or column info.
if (a.is_terminal_entry > b.is_terminal_entry)
return -1;
if (a.is_terminal_entry < b.is_terminal_entry)
@@ -192,8 +192,8 @@ int LineEntry::Compare(const LineEntry &a, const LineEntry &b) {
}
AddressRange LineEntry::GetSameLineContiguousAddressRange() const {
- // Add each LineEntry's range to complete_line_range until we find
- // a different file / line number.
+ // Add each LineEntry's range to complete_line_range until we find a
+ // different file / line number.
AddressRange complete_line_range = range;
while (true) {
@@ -206,9 +206,8 @@ AddressRange LineEntry::GetSameLineContiguousAddressRange() const {
if (next_line_sc.line_entry.IsValid() &&
next_line_sc.line_entry.range.GetByteSize() > 0 &&
original_file == next_line_sc.line_entry.original_file) {
- // Include any line 0 entries - they indicate that this is
- // compiler-generated code
- // that does not correspond to user source code.
+ // Include any line 0 entries - they indicate that this is compiler-
+ // generated code that does not correspond to user source code.
if (next_line_sc.line_entry.line == 0) {
complete_line_range.SetByteSize(
complete_line_range.GetByteSize() +
@@ -217,10 +216,9 @@ AddressRange LineEntry::GetSameLineContiguousAddressRange() const {
}
if (line == next_line_sc.line_entry.line) {
- // next_line_sc is the same file & line as this LineEntry, so extend our
- // AddressRange by its size and continue to see if there are more
- // LineEntries
- // that we can combine.
+ // next_line_sc is the same file & line as this LineEntry, so extend
+ // our AddressRange by its size and continue to see if there are more
+ // LineEntries that we can combine.
complete_line_range.SetByteSize(
complete_line_range.GetByteSize() +
next_line_sc.line_entry.range.GetByteSize());
diff --git a/source/Symbol/LineTable.cpp b/source/Symbol/LineTable.cpp
index 3cb305302927..06e30219f09a 100644
--- a/source/Symbol/LineTable.cpp
+++ b/source/Symbol/LineTable.cpp
@@ -73,30 +73,24 @@ void LineTable::AppendLineEntryToSequence(
is_terminal_entry);
entry_collection &entries = seq->m_entries;
// Replace the last entry if the address is the same, otherwise append it. If
- // we have multiple
- // line entries at the same address, this indicates illegal DWARF so this
- // "fixes" the line table
- // to be correct. If not fixed this can cause a line entry's address that when
- // resolved back to
- // a symbol context, could resolve to a different line entry. We really want a
+ // we have multiple line entries at the same address, this indicates illegal
+ // DWARF so this "fixes" the line table to be correct. If not fixed this can
+ // cause a line entry's address that when resolved back to a symbol context,
+ // could resolve to a different line entry. We really want a
// 1 to 1 mapping
- // here to avoid these kinds of inconsistencies. We will need tor revisit this
- // if the DWARF line
- // tables are updated to allow multiple entries at the same address legally.
+ // here to avoid these kinds of inconsistencies. We will need tor revisit
+ // this if the DWARF line tables are updated to allow multiple entries at the
+ // same address legally.
if (!entries.empty() && entries.back().file_addr == file_addr) {
// GCC don't use the is_prologue_end flag to mark the first instruction
// after the prologue.
// Instead of it it is issuing a line table entry for the first instruction
- // of the prologue
- // and one for the first instruction after the prologue. If the size of the
- // prologue is 0
- // instruction then the 2 line entry will have the same file address.
- // Removing it will remove
- // our ability to properly detect the location of the end of prologe so we
- // set the prologue_end
- // flag to preserve this information (setting the prologue_end flag for an
- // entry what is after
- // the prologue end don't have any effect)
+ // of the prologue and one for the first instruction after the prologue. If
+ // the size of the prologue is 0 instruction then the 2 line entry will
+ // have the same file address. Removing it will remove our ability to
+ // properly detect the location of the end of prologe so we set the
+ // prologue_end flag to preserve this information (setting the prologue_end
+ // flag for an entry what is after the prologue end don't have any effect)
entry.is_prologue_end = entry.file_idx == entries.back().file_idx;
entries.back() = entry;
} else
@@ -200,14 +194,13 @@ bool LineTable::FindLineEntryByAddress(const Address &so_addr,
if (pos->file_addr != search_entry.file_addr)
--pos;
else if (pos->file_addr == search_entry.file_addr) {
- // If this is a termination entry, it shouldn't match since
- // entries with the "is_terminal_entry" member set to true
- // are termination entries that define the range for the
- // previous entry.
+ // If this is a termination entry, it shouldn't match since entries
+ // with the "is_terminal_entry" member set to true are termination
+ // entries that define the range for the previous entry.
if (pos->is_terminal_entry) {
- // The matching entry is a terminal entry, so we skip
- // ahead to the next entry to see if there is another
- // entry following this one whose section/offset matches.
+ // The matching entry is a terminal entry, so we skip ahead to
+ // the next entry to see if there is another entry following this
+ // one whose section/offset matches.
++pos;
if (pos != end_pos) {
if (pos->file_addr != search_entry.file_addr)
@@ -216,9 +209,8 @@ bool LineTable::FindLineEntryByAddress(const Address &so_addr,
}
if (pos != end_pos) {
- // While in the same section/offset backup to find the first
- // line entry that matches the address in case there are
- // multiple
+ // While in the same section/offset backup to find the first line
+ // entry that matches the address in case there are multiple
while (pos != begin_pos) {
entry_collection::const_iterator prev_pos = pos - 1;
if (prev_pos->file_addr == search_entry.file_addr &&
@@ -232,16 +224,15 @@ bool LineTable::FindLineEntryByAddress(const Address &so_addr,
}
else
{
- // There might be code in the containing objfile before the first line
- // table entry. Make sure that does not get considered part of the first
- // line table entry.
+ // There might be code in the containing objfile before the first
+ // line table entry. Make sure that does not get considered part of
+ // the first line table entry.
if (pos->file_addr > so_addr.GetFileAddress())
return false;
}
// Make sure we have a valid match and that the match isn't a
- // terminating
- // entry for a previous line...
+ // terminating entry for a previous line...
if (pos != end_pos && pos->is_terminal_entry == false) {
uint32_t match_idx = std::distance(begin_pos, pos);
success = ConvertEntryAtIndexToLineEntry(match_idx, line_entry);
@@ -304,8 +295,7 @@ uint32_t LineTable::FindLineEntryIndexByFileIndex(
continue;
// Exact match always wins. Otherwise try to find the closest line > the
- // desired
- // line.
+ // desired line.
// FIXME: Maybe want to find the line closest before and the line closest
// after and
// if they're not in the same function, don't return a match.
@@ -349,8 +339,7 @@ uint32_t LineTable::FindLineEntryIndexByFileIndex(uint32_t start_idx,
continue;
// Exact match always wins. Otherwise try to find the closest line > the
- // desired
- // line.
+ // desired line.
// FIXME: Maybe want to find the line closest before and the line closest
// after and
// if they're not in the same function, don't return a match.
@@ -389,8 +378,8 @@ size_t LineTable::FineLineEntriesForFileIndex(uint32_t file_idx, bool append,
SymbolContext sc(m_comp_unit);
for (size_t idx = 0; idx < count; ++idx) {
- // Skip line table rows that terminate the previous row (is_terminal_entry
- // is non-zero)
+ // Skip line table rows that terminate the previous row
+ // (is_terminal_entry is non-zero)
if (m_entries[idx].is_terminal_entry)
continue;
@@ -497,10 +486,9 @@ LineTable *LineTable::LinkLineTable(const FileRangeMap &file_range_map) {
terminate_previous_entry = prev_entry_was_linked;
}
} else if (prev_entry_was_linked) {
- // This entry doesn't have a remapping and it needs to be removed.
- // Watch out in case we need to terminate a previous entry needs to
- // be terminated now that one line entry in a sequence is not longer
- // valid.
+ // This entry doesn't have a remapping and it needs to be removed. Watch
+ // out in case we need to terminate a previous entry needs to be
+ // terminated now that one line entry in a sequence is not longer valid.
if (!sequence.m_entries.empty() &&
!sequence.m_entries.back().is_terminal_entry) {
terminate_previous_entry = true;
diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp
index 2129a4463cdd..59012b1f8261 100644
--- a/source/Symbol/ObjectFile.cpp
+++ b/source/Symbol/ObjectFile.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
#include "lldb/Symbol/ObjectFile.h"
-#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
@@ -16,7 +15,6 @@
#include "lldb/Symbol/ObjectContainer.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Target/Process.h"
-#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataBuffer.h"
@@ -51,10 +49,9 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
const bool file_exists = file->Exists();
if (!data_sp) {
- // We have an object name which most likely means we have
- // a .o file in a static archive (.a file). Try and see if
- // we have a cached archive first without reading any data
- // first
+ // We have an object name which most likely means we have a .o file in
+ // a static archive (.a file). Try and see if we have a cached archive
+ // first without reading any data first
if (file_exists && module_sp->GetObjectName()) {
for (uint32_t idx = 0;
(create_object_container_callback =
@@ -73,10 +70,10 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
return object_file_sp;
}
}
- // Ok, we didn't find any containers that have a named object, now
- // lets read the first 512 bytes from the file so the object file
- // and object container plug-ins can use these bytes to see if they
- // can parse this file.
+ // Ok, we didn't find any containers that have a named object, now lets
+ // read the first 512 bytes from the file so the object file and object
+ // container plug-ins can use these bytes to see if they can parse this
+ // file.
if (file_size > 0) {
data_sp =
DataBufferLLVM::CreateSliceFromPath(file->GetPath(), 512, file_offset);
@@ -99,11 +96,12 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
file = &archive_file;
module_sp->SetFileSpecAndObjectName(archive_file, archive_object);
// Check if this is a object container by iterating through all
- // object
- // container plugin instances and then trying to get an object file
- // from the container plugins since we had a name. Also, don't read
+ // object container plugin instances and then trying to get an
+ // object file from the container plugins since we had a name.
+ // Also, don't read
// ANY data in case there is data cached in the container plug-ins
- // (like BSD archives caching the contained objects within an file).
+ // (like BSD archives caching the contained objects within an
+ // file).
for (uint32_t idx = 0;
(create_object_container_callback =
PluginManager::GetObjectContainerCreateCallbackAtIndex(
@@ -120,8 +118,8 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
if (object_file_sp.get())
return object_file_sp;
}
- // We failed to find any cached object files in the container
- // plug-ins, so lets read the first 512 bytes and try again below...
+ // We failed to find any cached object files in the container plug-
+ // ins, so lets read the first 512 bytes and try again below...
data_sp = DataBufferLLVM::CreateSliceFromPath(archive_file.GetPath(),
512, file_offset);
}
@@ -129,8 +127,8 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
}
if (data_sp && data_sp->GetByteSize() > 0) {
- // Check if this is a normal object file by iterating through
- // all object file plugin instances.
+ // Check if this is a normal object file by iterating through all
+ // object file plugin instances.
ObjectFileCreateInstance create_object_file_callback;
for (uint32_t idx = 0;
(create_object_file_callback =
@@ -143,9 +141,9 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
return object_file_sp;
}
- // Check if this is a object container by iterating through
- // all object container plugin instances and then trying to get
- // an object file from the container.
+ // Check if this is a object container by iterating through all object
+ // container plugin instances and then trying to get an object file
+ // from the container.
for (uint32_t idx = 0;
(create_object_container_callback =
PluginManager::GetObjectContainerCreateCallbackAtIndex(
@@ -164,8 +162,8 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
}
}
}
- // We didn't find it, so clear our shared pointer in case it
- // contains anything and return an empty shared pointer
+ // We didn't find it, so clear our shared pointer in case it contains
+ // anything and return an empty shared pointer
object_file_sp.reset();
return object_file_sp;
}
@@ -186,8 +184,8 @@ ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
static_cast<void *>(process_sp.get()), header_addr);
uint32_t idx;
- // Check if this is a normal object file by iterating through
- // all object file plugin instances.
+ // Check if this is a normal object file by iterating through all object
+ // file plugin instances.
ObjectFileCreateMemoryInstance create_callback;
for (idx = 0;
(create_callback =
@@ -201,8 +199,8 @@ ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
}
}
- // We didn't find it, so clear our shared pointer in case it
- // contains anything and return an empty shared pointer
+ // We didn't find it, so clear our shared pointer in case it contains
+ // anything and return an empty shared pointer
object_file_sp.reset();
return object_file_sp;
}
@@ -326,11 +324,11 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
const SectionType section_type = section_sp->GetType();
switch (section_type) {
case eSectionTypeInvalid:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSectionTypeCode:
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSectionTypeContainer:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSectionTypeData:
case eSectionTypeDataCString:
case eSectionTypeDataCStringPointers:
@@ -343,7 +341,7 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
case eSectionTypeDataObjCMessageRefs:
case eSectionTypeDataObjCCFStrings:
case eSectionTypeGoSymtab:
- return eAddressClassData;
+ return AddressClass::eData;
case eSectionTypeDebug:
case eSectionTypeDWARFDebugAbbrev:
case eSectionTypeDWARFDebugAddr:
@@ -355,33 +353,34 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
case eSectionTypeDWARFDebugLoc:
case eSectionTypeDWARFDebugMacInfo:
case eSectionTypeDWARFDebugMacro:
+ case eSectionTypeDWARFDebugNames:
case eSectionTypeDWARFDebugPubNames:
case eSectionTypeDWARFDebugPubTypes:
case eSectionTypeDWARFDebugRanges:
case eSectionTypeDWARFDebugStr:
case eSectionTypeDWARFDebugStrOffsets:
+ case eSectionTypeDWARFDebugTypes:
case eSectionTypeDWARFAppleNames:
case eSectionTypeDWARFAppleTypes:
case eSectionTypeDWARFAppleNamespaces:
case eSectionTypeDWARFAppleObjC:
- return eAddressClassDebug;
+ case eSectionTypeDWARFGNUDebugAltLink:
+ return AddressClass::eDebug;
case eSectionTypeEHFrame:
case eSectionTypeARMexidx:
case eSectionTypeARMextab:
case eSectionTypeCompactUnwind:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSectionTypeELFSymbolTable:
case eSectionTypeELFDynamicSymbols:
case eSectionTypeELFRelocationEntries:
case eSectionTypeELFDynamicLinkInfo:
case eSectionTypeOther:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSectionTypeAbsoluteAddress:
// In case of absolute sections decide the address class based on
- // the symbol
- // type because the section type isn't specify if it is a code or a
- // data
- // section.
+ // the symbol type because the section type isn't specify if it is
+ // a code or a data section.
break;
}
}
@@ -390,67 +389,67 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
const SymbolType symbol_type = symbol->GetType();
switch (symbol_type) {
case eSymbolTypeAny:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeAbsolute:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeCode:
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSymbolTypeTrampoline:
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSymbolTypeResolver:
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSymbolTypeData:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeRuntime:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeException:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeSourceFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeHeaderFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeObjectFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeCommonBlock:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeBlock:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLocal:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeParam:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeVariable:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeVariableType:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLineEntry:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLineHeader:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeScopeBegin:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeScopeEnd:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeAdditional:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeCompiler:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeInstrumentation:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeUndefined:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeObjCClass:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeObjCMetaClass:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeObjCIVar:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeReExported:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
}
}
}
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
}
DataBufferSP ObjectFile::ReadMemory(const ProcessSP &process_sp,
@@ -470,16 +469,14 @@ DataBufferSP ObjectFile::ReadMemory(const ProcessSP &process_sp,
size_t ObjectFile::GetData(lldb::offset_t offset, size_t length,
DataExtractor &data) const {
// The entire file has already been mmap'ed into m_data, so just copy from
- // there
- // as the back mmap buffer will be shared with shared pointers.
+ // there as the back mmap buffer will be shared with shared pointers.
return data.SetData(m_data, offset, length);
}
size_t ObjectFile::CopyData(lldb::offset_t offset, size_t length,
void *dst) const {
// The entire file has already been mmap'ed into m_data, so just copy from
- // there
- // Note that the data remains in target byte order.
+ // there Note that the data remains in target byte order.
return m_data.CopyData(offset, length, dst);
}
@@ -559,8 +556,8 @@ size_t ObjectFile::ReadSectionData(Section *section,
return GetData(section->GetFileOffset(), section->GetFileSize(),
section_data);
} else {
- // The object file now contains a full mmap'ed copy of the object file data,
- // so just use this
+ // The object file now contains a full mmap'ed copy of the object file
+ // data, so just use this
if (!section->IsRelocated())
RelocateSection(section);
@@ -581,7 +578,7 @@ bool ObjectFile::SplitArchivePathWithObject(const char *path_with_object,
std::string obj;
if (regex_match.GetMatchAtIndex(path_with_object, 1, path) &&
regex_match.GetMatchAtIndex(path_with_object, 2, obj)) {
- archive_file.SetFile(path, false);
+ archive_file.SetFile(path, false, FileSpec::Style::native);
archive_object.SetCString(obj.c_str());
if (must_exist && !archive_file.Exists())
return false;
@@ -648,41 +645,31 @@ ConstString ObjectFile::GetNextSyntheticSymbolName() {
return ConstString(ss.GetString());
}
-Status ObjectFile::LoadInMemory(Target &target, bool set_pc) {
- Status error;
- ProcessSP process = target.CalculateProcess();
- if (!process)
- return Status("No Process");
- if (set_pc && !GetEntryPointAddress().IsValid())
- return Status("No entry address in object file");
-
+std::vector<ObjectFile::LoadableData>
+ObjectFile::GetLoadableData(Target &target) {
+ std::vector<LoadableData> loadables;
SectionList *section_list = GetSectionList();
if (!section_list)
- return Status("No section in object file");
+ return loadables;
+ // Create a list of loadable data from loadable sections
size_t section_count = section_list->GetNumSections(0);
for (size_t i = 0; i < section_count; ++i) {
+ LoadableData loadable;
SectionSP section_sp = section_list->GetSectionAtIndex(i);
- addr_t addr = target.GetSectionLoadList().GetSectionLoadAddress(section_sp);
- if (addr != LLDB_INVALID_ADDRESS) {
- DataExtractor section_data;
- // We can skip sections like bss
- if (section_sp->GetFileSize() == 0)
- continue;
- section_sp->GetSectionData(section_data);
- lldb::offset_t written = process->WriteMemory(
- addr, section_data.GetDataStart(), section_data.GetByteSize(), error);
- if (written != section_data.GetByteSize())
- return error;
- }
- }
- if (set_pc) {
- ThreadList &thread_list = process->GetThreadList();
- ThreadSP curr_thread(thread_list.GetSelectedThread());
- RegisterContextSP reg_context(curr_thread->GetRegisterContext());
- Address file_entry = GetEntryPointAddress();
- reg_context->SetPC(file_entry.GetLoadAddress(&target));
+ loadable.Dest =
+ target.GetSectionLoadList().GetSectionLoadAddress(section_sp);
+ if (loadable.Dest == LLDB_INVALID_ADDRESS)
+ continue;
+ // We can skip sections like bss
+ if (section_sp->GetFileSize() == 0)
+ continue;
+ DataExtractor section_data;
+ section_sp->GetSectionData(section_data);
+ loadable.Contents = llvm::ArrayRef<uint8_t>(section_data.GetDataStart(),
+ section_data.GetByteSize());
+ loadables.push_back(loadable);
}
- return error;
+ return loadables;
}
void ObjectFile::RelocateSection(lldb_private::Section *section)
diff --git a/source/Symbol/Symbol.cpp b/source/Symbol/Symbol.cpp
index ab297ef330f2..69fd5424bd9a 100644
--- a/source/Symbol/Symbol.cpp
+++ b/source/Symbol/Symbol.cpp
@@ -122,9 +122,9 @@ ConstString Symbol::GetDisplayName() const {
ConstString Symbol::GetReExportedSymbolName() const {
if (m_type == eSymbolTypeReExported) {
- // For eSymbolTypeReExported, the "const char *" from a ConstString
- // is used as the offset in the address range base address. We can
- // then make this back into a string that is the re-exported name.
+ // For eSymbolTypeReExported, the "const char *" from a ConstString is used
+ // as the offset in the address range base address. We can then make this
+ // back into a string that is the re-exported name.
intptr_t str_ptr = m_addr_range.GetBaseAddress().GetOffset();
if (str_ptr != 0)
return ConstString((const char *)str_ptr);
@@ -136,9 +136,9 @@ ConstString Symbol::GetReExportedSymbolName() const {
FileSpec Symbol::GetReExportedSymbolSharedLibrary() const {
if (m_type == eSymbolTypeReExported) {
- // For eSymbolTypeReExported, the "const char *" from a ConstString
- // is used as the offset in the address range base address. We can
- // then make this back into a string that is the re-exported name.
+ // For eSymbolTypeReExported, the "const char *" from a ConstString is used
+ // as the offset in the address range base address. We can then make this
+ // back into a string that is the re-exported name.
intptr_t str_ptr = m_addr_range.GetByteSize();
if (str_ptr != 0)
return FileSpec((const char *)str_ptr, false);
@@ -148,15 +148,15 @@ FileSpec Symbol::GetReExportedSymbolSharedLibrary() const {
void Symbol::SetReExportedSymbolName(const ConstString &name) {
SetType(eSymbolTypeReExported);
- // For eSymbolTypeReExported, the "const char *" from a ConstString
- // is used as the offset in the address range base address.
+ // For eSymbolTypeReExported, the "const char *" from a ConstString is used
+ // as the offset in the address range base address.
m_addr_range.GetBaseAddress().SetOffset((uintptr_t)name.GetCString());
}
bool Symbol::SetReExportedSymbolSharedLibrary(const FileSpec &fspec) {
if (m_type == eSymbolTypeReExported) {
- // For eSymbolTypeReExported, the "const char *" from a ConstString
- // is used as the offset in the address range base address.
+ // For eSymbolTypeReExported, the "const char *" from a ConstString is used
+ // as the offset in the address range base address.
m_addr_range.SetByteSize(
(uintptr_t)ConstString(fspec.GetPath().c_str()).GetCString());
return true;
@@ -262,9 +262,8 @@ uint32_t Symbol::GetPrologueByteSize() {
Function *function = base_address.CalculateSymbolContextFunction();
if (function) {
// Functions have line entries which can also potentially have end of
- // prologue information.
- // So if this symbol points to a function, use the prologue information
- // from there.
+ // prologue information. So if this symbol points to a function, use
+ // the prologue information from there.
m_type_data = function->GetPrologueByteSize();
} else {
ModuleSP module_sp(base_address.GetModule());
@@ -280,10 +279,9 @@ uint32_t Symbol::GetPrologueByteSize() {
Address addr(base_address);
addr.Slide(m_type_data);
- // Check the first few instructions and look for one that has a line
- // number that is
- // different than the first entry. This is also done in
- // Function::GetPrologueByteSize().
+ // Check the first few instructions and look for one that has a
+ // line number that is different than the first entry. This is also
+ // done in Function::GetPrologueByteSize().
uint16_t total_offset = m_type_data;
for (int idx = 0; idx < 6; ++idx) {
SymbolContext sc_temp;
@@ -293,8 +291,8 @@ uint32_t Symbol::GetPrologueByteSize() {
if (!(resolved_flags & eSymbolContextLineEntry))
break;
- // If this line number is different than our first one, use it and
- // we're done.
+ // If this line number is different than our first one, use it
+ // and we're done.
if (sc_temp.line_entry.line != sc.line_entry.line) {
m_type_data = total_offset;
break;
@@ -309,12 +307,10 @@ uint32_t Symbol::GetPrologueByteSize() {
}
// Sanity check - this may be a function in the middle of code that
- // has debug information, but
- // not for this symbol. So the line entries surrounding us won't
- // lie inside our function.
- // In that case, the line entry will be bigger than we are, so we do
- // that quick check and
- // if that is true, we just return 0.
+ // has debug information, but not for this symbol. So the line
+ // entries surrounding us won't lie inside our function. In that
+ // case, the line entry will be bigger than we are, so we do that
+ // quick check and if that is true, we just return 0.
if (m_type_data >= m_addr_range.GetByteSize())
m_type_data = 0;
} else {
@@ -420,9 +416,9 @@ Symbol *Symbol::ResolveReExportedSymbolInModuleSpec(
// Try searching for the module file spec first using the full path
module_sp = target.GetImages().FindFirstModule(module_spec);
if (!module_sp) {
- // Next try and find the module by basename in case environment
- // variables or other runtime trickery causes shared libraries
- // to be loaded from alternate paths
+ // Next try and find the module by basename in case environment variables
+ // or other runtime trickery causes shared libraries to be loaded from
+ // alternate paths
module_spec.GetFileSpec().GetDirectory().Clear();
module_sp = target.GetImages().FindFirstModule(module_spec);
}
@@ -430,8 +426,7 @@ Symbol *Symbol::ResolveReExportedSymbolInModuleSpec(
if (module_sp) {
// There should not be cycles in the reexport list, but we don't want to
- // crash if there are so make sure
- // we haven't seen this before:
+ // crash if there are so make sure we haven't seen this before:
if (!seen_modules.AppendIfNeeded(module_sp))
return nullptr;
@@ -449,8 +444,8 @@ Symbol *Symbol::ResolveReExportedSymbolInModuleSpec(
}
}
// If we didn't find the symbol in this module, it may be because this
- // module re-exports some
- // whole other library. We have to search those as well:
+ // module re-exports some whole other library. We have to search those as
+ // well:
seen_modules.Append(module_sp);
FileSpecList reexported_libraries =
diff --git a/source/Symbol/SymbolContext.cpp b/source/Symbol/SymbolContext.cpp
index 4ac35010c74c..8716f50a384d 100644
--- a/source/Symbol/SymbolContext.cpp
+++ b/source/Symbol/SymbolContext.cpp
@@ -359,8 +359,7 @@ void SymbolContext::Dump(Stream *s, Target *target) const {
if (block != nullptr)
*s << " {0x" << block->GetID() << '}';
// Dump the block and pass it a negative depth to we print all the parent
- // blocks
- // if (block != NULL)
+ // blocks if (block != NULL)
// block->Dump(s, function->GetFileAddress(), INT_MIN);
s->EOL();
s->Indent();
@@ -468,27 +467,27 @@ bool SymbolContext::GetParentOfInlinedScope(const Address &curr_frame_pc,
if (block) {
// const addr_t curr_frame_file_addr = curr_frame_pc.GetFileAddress();
- // In order to get the parent of an inlined function we first need to
- // see if we are in an inlined block as "this->block" could be an
- // inlined block, or a parent of "block" could be. So lets check if
- // this block or one of this blocks parents is an inlined function.
+ // In order to get the parent of an inlined function we first need to see
+ // if we are in an inlined block as "this->block" could be an inlined
+ // block, or a parent of "block" could be. So lets check if this block or
+ // one of this blocks parents is an inlined function.
Block *curr_inlined_block = block->GetContainingInlinedBlock();
if (curr_inlined_block) {
- // "this->block" is contained in an inline function block, so to
- // get the scope above the inlined block, we get the parent of the
- // inlined block itself
+ // "this->block" is contained in an inline function block, so to get the
+ // scope above the inlined block, we get the parent of the inlined block
+ // itself
Block *next_frame_block = curr_inlined_block->GetParent();
// Now calculate the symbol context of the containing block
next_frame_block->CalculateSymbolContext(&next_frame_sc);
// If we get here we weren't able to find the return line entry using the
- // nesting of the blocks and
- // the line table. So just use the call site info from our inlined block.
+ // nesting of the blocks and the line table. So just use the call site
+ // info from our inlined block.
AddressRange range;
if (curr_inlined_block->GetRangeContainingAddress(curr_frame_pc, range)) {
- // To see there this new frame block it, we need to look at the
- // call site information from
+ // To see there this new frame block it, we need to look at the call
+ // site information from
const InlineFunctionInfo *curr_inlined_block_inlined_info =
curr_inlined_block->GetInlinedFunctionInfo();
next_frame_pc = range.GetBaseAddress();
@@ -550,22 +549,22 @@ bool SymbolContext::GetParentOfInlinedScope(const Address &curr_frame_pc,
Block *SymbolContext::GetFunctionBlock() {
if (function) {
if (block) {
- // If this symbol context has a block, check to see if this block
- // is itself, or is contained within a block with inlined function
- // information. If so, then the inlined block is the block that
- // defines the function.
+ // If this symbol context has a block, check to see if this block is
+ // itself, or is contained within a block with inlined function
+ // information. If so, then the inlined block is the block that defines
+ // the function.
Block *inlined_block = block->GetContainingInlinedBlock();
if (inlined_block)
return inlined_block;
- // The block in this symbol context is not inside an inlined
- // block, so the block that defines the function is the function's
- // top level block, which is returned below.
+ // The block in this symbol context is not inside an inlined block, so
+ // the block that defines the function is the function's top level block,
+ // which is returned below.
}
- // There is no block information in this symbol context, so we must
- // assume that the block that is desired is the top level block of
- // the function itself.
+ // There is no block information in this symbol context, so we must assume
+ // that the block that is desired is the top level block of the function
+ // itself.
return &function->GetBlock(true);
}
return nullptr;
@@ -594,8 +593,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
isInlinedblock = true;
//----------------------------------------------------------------------
- // Find all types that match the current block if we have one and put
- // them first in the list. Keep iterating up through all blocks.
+ // Find all types that match the current block if we have one and put them
+ // first in the list. Keep iterating up through all blocks.
//----------------------------------------------------------------------
while (curr_block != nullptr && !isInlinedblock) {
type_map.ForEach(
@@ -606,8 +605,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
return true; // Keep iterating
});
- // Remove any entries that are now in "type_list" from "type_map"
- // since we can't remove from type_map while iterating
+ // Remove any entries that are now in "type_list" from "type_map" since we
+ // can't remove from type_map while iterating
type_list.ForEach([&type_map](const lldb::TypeSP &type_sp) -> bool {
type_map.Remove(type_sp);
return true; // Keep iterating
@@ -615,8 +614,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
curr_block = curr_block->GetParent();
}
//----------------------------------------------------------------------
- // Find all types that match the current function, if we have onem, and
- // put them next in the list.
+ // Find all types that match the current function, if we have onem, and put
+ // them next in the list.
//----------------------------------------------------------------------
if (function != nullptr && !type_map.Empty()) {
const size_t old_type_list_size = type_list.GetSize();
@@ -627,8 +626,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
return true; // Keep iterating
});
- // Remove any entries that are now in "type_list" from "type_map"
- // since we can't remove from type_map while iterating
+ // Remove any entries that are now in "type_list" from "type_map" since we
+ // can't remove from type_map while iterating
const size_t new_type_list_size = type_list.GetSize();
if (new_type_list_size > old_type_list_size) {
for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
@@ -636,8 +635,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
}
}
//----------------------------------------------------------------------
- // Find all types that match the current compile unit, if we have one,
- // and put them next in the list.
+ // Find all types that match the current compile unit, if we have one, and
+ // put them next in the list.
//----------------------------------------------------------------------
if (comp_unit != nullptr && !type_map.Empty()) {
const size_t old_type_list_size = type_list.GetSize();
@@ -649,8 +648,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
return true; // Keep iterating
});
- // Remove any entries that are now in "type_list" from "type_map"
- // since we can't remove from type_map while iterating
+ // Remove any entries that are now in "type_list" from "type_map" since we
+ // can't remove from type_map while iterating
const size_t new_type_list_size = type_list.GetSize();
if (new_type_list_size > old_type_list_size) {
for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
@@ -658,8 +657,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
}
}
//----------------------------------------------------------------------
- // Find all types that match the current module, if we have one, and put
- // them next in the list.
+ // Find all types that match the current module, if we have one, and put them
+ // next in the list.
//----------------------------------------------------------------------
if (module_sp && !type_map.Empty()) {
const size_t old_type_list_size = type_list.GetSize();
@@ -669,8 +668,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
type_list.Insert(type_sp);
return true; // Keep iterating
});
- // Remove any entries that are now in "type_list" from "type_map"
- // since we can't remove from type_map while iterating
+ // Remove any entries that are now in "type_list" from "type_map" since we
+ // can't remove from type_map while iterating
const size_t new_type_list_size = type_list.GetSize();
if (new_type_list_size > old_type_list_size) {
for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
@@ -831,9 +830,9 @@ SymbolContext::FindBestGlobalDataSymbol(const ConstString &name, Status &error)
case eSymbolTypeObjCMetaClass:
case eSymbolTypeObjCIVar:
if (symbol->GetDemangledNameIsSynthesized()) {
- // If the demangled name was synthesized, then don't use it
- // for expressions. Only let the symbol match if the mangled
- // named matches for these symbols.
+ // If the demangled name was synthesized, then don't use it for
+ // expressions. Only let the symbol match if the mangled named
+ // matches for these symbols.
if (symbol->GetMangled().GetMangledName() != name)
break;
}
@@ -861,8 +860,8 @@ SymbolContext::FindBestGlobalDataSymbol(const ConstString &name, Status &error)
target.GetImages().FindFirstModule(reexport_module_spec);
}
}
- // Don't allow us to try and resolve a re-exported symbol if it is
- // the same as the current symbol
+ // Don't allow us to try and resolve a re-exported symbol if it
+ // is the same as the current symbol
if (name == symbol->GetReExportedSymbolName() &&
module == reexport_module_sp.get())
return nullptr;
@@ -1012,9 +1011,8 @@ bool SymbolContextSpecifier::AddSpecification(const char *spec_string,
} break;
case eFileSpecified:
// CompUnits can't necessarily be resolved here, since an inlined function
- // might show up in
- // a number of CompUnits. Instead we just convert to a FileSpec and store
- // it away.
+ // might show up in a number of CompUnits. Instead we just convert to a
+ // FileSpec and store it away.
m_file_spec_ap.reset(new FileSpec(spec_string, false));
m_type |= eFileSpecified;
break;
diff --git a/source/Symbol/SymbolFile.cpp b/source/Symbol/SymbolFile.cpp
index eb20b80f4916..6b4da9c53009 100644
--- a/source/Symbol/SymbolFile.cpp
+++ b/source/Symbol/SymbolFile.cpp
@@ -30,8 +30,7 @@ SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
if (obj_file != nullptr) {
// We need to test the abilities of this section list. So create what it
- // would
- // be with this new obj_file.
+ // would be with this new obj_file.
lldb::ModuleSP module_sp(obj_file->GetModule());
if (module_sp) {
// Default to the main module section list.
@@ -60,16 +59,16 @@ SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
if (sym_file_abilities > best_symfile_abilities) {
best_symfile_abilities = sym_file_abilities;
best_symfile_ap.reset(curr_symfile_ap.release());
- // If any symbol file parser has all of the abilities, then
- // we should just stop looking.
+ // If any symbol file parser has all of the abilities, then we should
+ // just stop looking.
if ((kAllAbilities & sym_file_abilities) == kAllAbilities)
break;
}
}
}
if (best_symfile_ap.get()) {
- // Let the winning symbol file parser initialize itself more
- // completely now that it has been chosen
+ // Let the winning symbol file parser initialize itself more completely
+ // now that it has been chosen
best_symfile_ap->InitializeObject();
}
}
@@ -97,19 +96,16 @@ uint32_t SymbolFile::ResolveSymbolContext(const FileSpec &file_spec,
return 0;
}
-uint32_t SymbolFile::FindGlobalVariables(
- const ConstString &name, const CompilerDeclContext *parent_decl_ctx,
- bool append, uint32_t max_matches, VariableList &variables) {
- if (!append)
- variables.Clear();
+uint32_t
+SymbolFile::FindGlobalVariables(const ConstString &name,
+ const CompilerDeclContext *parent_decl_ctx,
+ uint32_t max_matches, VariableList &variables) {
return 0;
}
uint32_t SymbolFile::FindGlobalVariables(const RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
VariableList &variables) {
- if (!append)
- variables.Clear();
return 0;
}
diff --git a/source/Symbol/SymbolVendor.cpp b/source/Symbol/SymbolVendor.cpp
index f5a08739f24d..245f7bbf8add 100644
--- a/source/Symbol/SymbolVendor.cpp
+++ b/source/Symbol/SymbolVendor.cpp
@@ -26,9 +26,9 @@ using namespace lldb_private;
//----------------------------------------------------------------------
// FindPlugin
//
-// Platforms can register a callback to use when creating symbol
-// vendors to allow for complex debug information file setups, and to
-// also allow for finding separate debug information files.
+// Platforms can register a callback to use when creating symbol vendors to
+// allow for complex debug information file setups, and to also allow for
+// finding separate debug information files.
//----------------------------------------------------------------------
SymbolVendor *SymbolVendor::FindPlugin(const lldb::ModuleSP &module_sp,
lldb_private::Stream *feedback_strm) {
@@ -45,8 +45,8 @@ SymbolVendor *SymbolVendor::FindPlugin(const lldb::ModuleSP &module_sp,
return instance_ap.release();
}
}
- // The default implementation just tries to create debug information using the
- // file representation for the module.
+ // The default implementation just tries to create debug information using
+ // the file representation for the module.
instance_ap.reset(new SymbolVendor(module_sp));
if (instance_ap.get()) {
ObjectFile *objfile = module_sp->GetObjectFile();
@@ -88,11 +88,11 @@ bool SymbolVendor::SetCompileUnitAtIndex(size_t idx, const CompUnitSP &cu_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
const size_t num_compile_units = GetNumCompileUnits();
if (idx < num_compile_units) {
- // Fire off an assertion if this compile unit already exists for now.
- // The partial parsing should take care of only setting the compile
- // unit once, so if this assertion fails, we need to make sure that
- // we don't have a race condition, or have a second parse of the same
- // compile unit.
+ // Fire off an assertion if this compile unit already exists for now. The
+ // partial parsing should take care of only setting the compile unit
+ // once, so if this assertion fails, we need to make sure that we don't
+ // have a race condition, or have a second parse of the same compile
+ // unit.
assert(m_compile_units[idx].get() == nullptr);
m_compile_units[idx] = cu_sp;
return true;
@@ -111,10 +111,10 @@ size_t SymbolVendor::GetNumCompileUnits() {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
if (m_compile_units.empty()) {
if (m_sym_file_ap.get()) {
- // Resize our array of compile unit shared pointers -- which will
- // each remain NULL until someone asks for the actual compile unit
- // information. When this happens, the symbol file will be asked
- // to parse this compile unit information.
+ // Resize our array of compile unit shared pointers -- which will each
+ // remain NULL until someone asks for the actual compile unit
+ // information. When this happens, the symbol file will be asked to
+ // parse this compile unit information.
m_compile_units.resize(m_sym_file_ap->GetNumCompileUnits());
}
}
@@ -260,28 +260,28 @@ uint32_t SymbolVendor::ResolveSymbolContext(const FileSpec &file_spec,
return 0;
}
-size_t SymbolVendor::FindGlobalVariables(
- const ConstString &name, const CompilerDeclContext *parent_decl_ctx,
- bool append, size_t max_matches, VariableList &variables) {
+size_t
+SymbolVendor::FindGlobalVariables(const ConstString &name,
+ const CompilerDeclContext *parent_decl_ctx,
+ size_t max_matches, VariableList &variables) {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
if (m_sym_file_ap.get())
- return m_sym_file_ap->FindGlobalVariables(name, parent_decl_ctx, append,
+ return m_sym_file_ap->FindGlobalVariables(name, parent_decl_ctx,
max_matches, variables);
}
return 0;
}
size_t SymbolVendor::FindGlobalVariables(const RegularExpression &regex,
- bool append, size_t max_matches,
+ size_t max_matches,
VariableList &variables) {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
if (m_sym_file_ap.get())
- return m_sym_file_ap->FindGlobalVariables(regex, append, max_matches,
- variables);
+ return m_sym_file_ap->FindGlobalVariables(regex, max_matches, variables);
}
return 0;
}
@@ -392,6 +392,8 @@ void SymbolVendor::Dump(Stream *s) {
}
}
s->EOL();
+ if (m_sym_file_ap)
+ m_sym_file_ap->Dump(*s);
s->IndentMore();
m_type_list.Dump(s, show_context);
diff --git a/source/Symbol/Symtab.cpp b/source/Symbol/Symtab.cpp
index 4ac30649110f..c502b18555f0 100644
--- a/source/Symbol/Symtab.cpp
+++ b/source/Symbol/Symtab.cpp
@@ -100,9 +100,8 @@ void Symtab::Dump(Stream *s, Target *target, SortOrder sort_order) {
} break;
case eSortOrderByName: {
- // Although we maintain a lookup by exact name map, the table
- // isn't sorted by name. So we must make the ordered symbol list
- // up ourselves.
+ // Although we maintain a lookup by exact name map, the table isn't
+ // sorted by name. So we must make the ordered symbol list up ourselves.
s->PutCString(" (sorted by name):\n");
DumpSymbolHeader(s);
typedef std::multimap<const char *, const Symbol *,
@@ -228,8 +227,8 @@ void Symtab::InitNameIndexes() {
m_name_to_index.Reserve(num_symbols);
#else
// TODO: benchmark this to see if we save any memory. Otherwise we
- // will always keep the memory reserved in the vector unless we pull
- // some STL swap magic and then recopy...
+ // will always keep the memory reserved in the vector unless we pull some
+ // STL swap magic and then recopy...
uint32_t actual_count = 0;
for (const_iterator pos = m_symbols.begin(), end = m_symbols.end();
pos != end; ++pos) {
@@ -255,11 +254,10 @@ void Symtab::InitNameIndexes() {
for (entry.value = 0; entry.value < num_symbols; ++entry.value) {
const Symbol *symbol = &m_symbols[entry.value];
- // Don't let trampolines get into the lookup by name map
- // If we ever need the trampoline symbols to be searchable by name
- // we can remove this and then possibly add a new bool to any of the
- // Symtab functions that lookup symbols by name to indicate if they
- // want trampolines.
+ // Don't let trampolines get into the lookup by name map If we ever need
+ // the trampoline symbols to be searchable by name we can remove this and
+ // then possibly add a new bool to any of the Symtab functions that
+ // lookup symbols by name to indicate if they want trampolines.
if (symbol->IsTrampoline())
continue;
@@ -293,10 +291,9 @@ void Symtab::InitNameIndexes() {
mangled.GetDemangledName(lldb::eLanguageTypeC_plus_plus));
entry.cstring = ConstString(cxx_method.GetBasename());
if (entry.cstring) {
- // ConstString objects permanently store the string in the pool so
- // calling
- // GetCString() on the value gets us a const char * that will
- // never go away
+ // ConstString objects permanently store the string in the pool
+ // so calling GetCString() on the value gets us a const char *
+ // that will never go away
const char *const_context =
ConstString(cxx_method.GetContext()).GetCString();
@@ -312,25 +309,25 @@ void Symtab::InitNameIndexes() {
if (entry_ref[0] == '~' ||
!cxx_method.GetQualifiers().empty()) {
// The first character of the demangled basename is '~' which
- // means we have a class destructor. We can use this information
- // to help us know what is a class and what isn't.
+ // means we have a class destructor. We can use this
+ // information to help us know what is a class and what
+ // isn't.
if (class_contexts.find(const_context) == class_contexts.end())
class_contexts.insert(const_context);
m_method_to_index.Append(entry);
} else {
if (class_contexts.find(const_context) !=
class_contexts.end()) {
- // The current decl context is in our "class_contexts" which
- // means
- // this is a method on a class
+ // The current decl context is in our "class_contexts"
+ // which means this is a method on a class
m_method_to_index.Append(entry);
} else {
- // We don't know if this is a function basename or a method,
- // so put it into a temporary collection so once we are done
- // we can look in class_contexts to see if each entry is a
- // class
- // or just a function and will put any remaining items into
- // m_method_to_index or m_basename_to_index as needed
+ // We don't know if this is a function basename or a
+ // method, so put it into a temporary collection so once we
+ // are done we can look in class_contexts to see if each
+ // entry is a class or just a function and will put any
+ // remaining items into m_method_to_index or
+ // m_basename_to_index as needed
mangled_name_to_index.Append(entry);
symbol_contexts[entry.value] = const_context;
}
@@ -354,9 +351,8 @@ void Symtab::InitNameIndexes() {
}
}
- // If the demangled name turns out to be an ObjC name, and
- // is a category name, add the version without categories to the index
- // too.
+ // If the demangled name turns out to be an ObjC name, and is a category
+ // name, add the version without categories to the index too.
ObjCLanguage::MethodName objc_method(entry.cstring.GetStringRef(), true);
if (objc_method.IsValid(true)) {
entry.cstring = objc_method.GetSelector();
@@ -383,8 +379,7 @@ void Symtab::InitNameIndexes() {
m_method_to_index.Append(entry);
} else {
// If we got here, we have something that had a context (was inside
- // a namespace or class)
- // yet we don't know if the entry
+ // a namespace or class) yet we don't know if the entry
m_method_to_index.Append(entry);
m_basename_to_index.Append(entry);
}
@@ -520,20 +515,15 @@ struct SymbolIndexComparator {
std::vector<lldb::addr_t> &addr_cache;
// Getting from the symbol to the Address to the File Address involves some
- // work.
- // Since there are potentially many symbols here, and we're using this for
- // sorting so
- // we're going to be computing the address many times, cache that in
- // addr_cache.
- // The array passed in has to be the same size as the symbols array passed
- // into the
- // member variable symbols, and should be initialized with
- // LLDB_INVALID_ADDRESS.
+ // work. Since there are potentially many symbols here, and we're using this
+ // for sorting so we're going to be computing the address many times, cache
+ // that in addr_cache. The array passed in has to be the same size as the
+ // symbols array passed into the member variable symbols, and should be
+ // initialized with LLDB_INVALID_ADDRESS.
// NOTE: You have to make addr_cache externally and pass it in because
// std::stable_sort
// makes copies of the comparator it is initially passed in, and you end up
- // spending
- // huge amounts of time copying this array...
+ // spending huge amounts of time copying this array...
SymbolIndexComparator(const std::vector<Symbol> &s,
std::vector<lldb::addr_t> &a)
@@ -584,8 +574,7 @@ void Symtab::SortSymbolIndexesByValue(std::vector<uint32_t> &indexes,
// NOTE: The use of std::stable_sort instead of std::sort here is strictly for
// performance,
// not correctness. The indexes vector tends to be "close" to sorted, which
- // the
- // stable sort handles better.
+ // the stable sort handles better.
std::vector<lldb::addr_t> addr_cache(m_symbols.size(), LLDB_INVALID_ADDRESS);
@@ -752,14 +741,14 @@ Symtab::FindAllSymbolsWithNameAndType(const ConstString &name,
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
- // Initialize all of the lookup by name indexes before converting NAME
- // to a uniqued string NAME_STR below.
+ // Initialize all of the lookup by name indexes before converting NAME to a
+ // uniqued string NAME_STR below.
if (!m_name_indexes_computed)
InitNameIndexes();
if (name) {
- // The string table did have a string that matched, but we need
- // to check the symbols and match the symbol_type if any was given.
+ // The string table did have a string that matched, but we need to check
+ // the symbols and match the symbol_type if any was given.
AppendSymbolIndexesWithNameAndType(name, symbol_type, symbol_indexes);
}
return symbol_indexes.size();
@@ -772,14 +761,14 @@ size_t Symtab::FindAllSymbolsWithNameAndType(
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
- // Initialize all of the lookup by name indexes before converting NAME
- // to a uniqued string NAME_STR below.
+ // Initialize all of the lookup by name indexes before converting NAME to a
+ // uniqued string NAME_STR below.
if (!m_name_indexes_computed)
InitNameIndexes();
if (name) {
- // The string table did have a string that matched, but we need
- // to check the symbols and match the symbol_type if any was given.
+ // The string table did have a string that matched, but we need to check
+ // the symbols and match the symbol_type if any was given.
AppendSymbolIndexesWithNameAndType(name, symbol_type, symbol_debug_type,
symbol_visibility, symbol_indexes);
}
@@ -810,8 +799,8 @@ Symbol *Symtab::FindFirstSymbolWithNameAndType(const ConstString &name,
if (name) {
std::vector<uint32_t> matching_indexes;
- // The string table did have a string that matched, but we need
- // to check the symbols and match the symbol_type if any was given.
+ // The string table did have a string that matched, but we need to check
+ // the symbols and match the symbol_type if any was given.
if (AppendSymbolIndexesWithNameAndType(name, symbol_type, symbol_debug_type,
symbol_visibility,
matching_indexes)) {
@@ -835,8 +824,8 @@ typedef struct {
addr_t match_offset;
} SymbolSearchInfo;
-// Add all the section file start address & size to the RangeVector,
-// recusively adding any children sections.
+// Add all the section file start address & size to the RangeVector, recusively
+// adding any children sections.
static void AddSectionsToRangeMap(SectionList *sectlist,
RangeVector<addr_t, addr_t> &section_ranges) {
const int num_sections = sectlist->GetNumSections(0);
@@ -885,9 +874,9 @@ void Symtab::InitAddressIndexes() {
// Create a RangeVector with the start & size of all the sections for
// this objfile. We'll need to check this for any FileRangeToIndexMap
- // entries with an uninitialized size, which could potentially be a
- // large number so reconstituting the weak pointer is busywork when it
- // is invariant information.
+ // entries with an uninitialized size, which could potentially be a large
+ // number so reconstituting the weak pointer is busywork when it is
+ // invariant information.
SectionList *sectlist = m_objfile->GetSectionList();
RangeVector<addr_t, addr_t> section_ranges;
if (sectlist) {
@@ -922,9 +911,8 @@ void Symtab::InitAddressIndexes() {
if (next_base_addr > curr_base_addr) {
addr_t size_to_next_symbol = next_base_addr - curr_base_addr;
- // Take the difference between this symbol and the next one as its
- // size,
- // if it is less than the size of the section.
+ // Take the difference between this symbol and the next one as
+ // its size, if it is less than the size of the section.
if (sym_size == 0 || size_to_next_symbol < sym_size) {
sym_size = size_to_next_symbol;
}
@@ -958,8 +946,7 @@ void Symtab::CalculateSymbolSizes() {
for (size_t i = 0; i < num_entries; ++i) {
// The entries in the m_file_addr_to_index have calculated the sizes
- // already
- // so we will use this size if we need to.
+ // already so we will use this size if we need to.
const FileRangeToIndexMap::Entry &entry =
m_file_addr_to_index.GetEntryRef(i);
@@ -1086,8 +1073,8 @@ size_t Symtab::FindFunctionSymbols(const ConstString &name,
}
if (name_type_mask & eFunctionNameTypeBase) {
- // From mangled names we can't tell what is a basename and what
- // is a method name, so we just treat them the same
+ // From mangled names we can't tell what is a basename and what is a method
+ // name, so we just treat them the same
if (!m_name_indexes_computed)
InitNameIndexes();
diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp
index 53bf3e850055..b62c55f76e2b 100644
--- a/source/Symbol/Type.cpp
+++ b/source/Symbol/Type.cpp
@@ -387,8 +387,8 @@ bool Type::DumpValueInMemory(ExecutionContext *exe_ctx, Stream *s,
bool Type::ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t addr,
AddressType address_type, DataExtractor &data) {
if (address_type == eAddressTypeFile) {
- // Can't convert a file address to anything valid without more
- // context (which Module it came from)
+ // Can't convert a file address to anything valid without more context
+ // (which Module it came from)
return false;
}
@@ -533,10 +533,8 @@ bool Type::ResolveClangType(ResolveState compiler_type_resolve_state) {
}
// When we have a EncodingUID, our "m_flags.compiler_type_resolve_state" is
- // set to eResolveStateUnresolved
- // so we need to update it to say that we now have a forward declaration
- // since that is what we created
- // above.
+ // set to eResolveStateUnresolved so we need to update it to say that we
+ // now have a forward declaration since that is what we created above.
if (m_compiler_type.IsValid())
m_flags.compiler_type_resolve_state = eResolveStateForward;
}
@@ -556,8 +554,8 @@ bool Type::ResolveClangType(ResolveState compiler_type_resolve_state) {
}
}
- // If we have an encoding type, then we need to make sure it is
- // resolved appropriately.
+ // If we have an encoding type, then we need to make sure it is resolved
+ // appropriately.
if (m_encoding_uid != LLDB_INVALID_UID) {
if (encoding_type == nullptr)
encoding_type = GetEncodingType();
@@ -847,35 +845,26 @@ TypeImpl &TypeImpl::operator=(const TypeImpl &rhs) {
}
bool TypeImpl::CheckModule(lldb::ModuleSP &module_sp) const {
- // Check if we have a module for this type. If we do and the shared pointer is
- // can be successfully initialized with m_module_wp, return true. Else return
- // false
- // if we didn't have a module, or if we had a module and it has been deleted.
- // Any
- // functions doing anything with a TypeSP in this TypeImpl class should call
- // this
- // function and only do anything with the ivars if this function returns true.
- // If
- // we have a module, the "module_sp" will be filled in with a strong reference
- // to the
- // module so that the module will at least stay around long enough for the
- // type
- // query to succeed.
+ // Check if we have a module for this type. If we do and the shared pointer
+ // is can be successfully initialized with m_module_wp, return true. Else
+ // return false if we didn't have a module, or if we had a module and it has
+ // been deleted. Any functions doing anything with a TypeSP in this TypeImpl
+ // class should call this function and only do anything with the ivars if
+ // this function returns true. If we have a module, the "module_sp" will be
+ // filled in with a strong reference to the module so that the module will at
+ // least stay around long enough for the type query to succeed.
module_sp = m_module_wp.lock();
if (!module_sp) {
lldb::ModuleWP empty_module_wp;
// If either call to "std::weak_ptr::owner_before(...) value returns true,
- // this
- // indicates that m_module_wp once contained (possibly still does) a
- // reference
- // to a valid shared pointer. This helps us know if we had a valid reference
- // to
- // a section which is now invalid because the module it was in was deleted
+ // this indicates that m_module_wp once contained (possibly still does) a
+ // reference to a valid shared pointer. This helps us know if we had a
+ // valid reference to a section which is now invalid because the module it
+ // was in was deleted
if (empty_module_wp.owner_before(m_module_wp) ||
m_module_wp.owner_before(empty_module_wp)) {
// m_module_wp had a valid reference to a module, but all strong
- // references
- // have been released and the module has been deleted
+ // references have been released and the module has been deleted
return false;
}
}
diff --git a/source/Symbol/TypeList.cpp b/source/Symbol/TypeList.cpp
index 4fcaff3daf90..4a0a06f3e8e3 100644
--- a/source/Symbol/TypeList.cpp
+++ b/source/Symbol/TypeList.cpp
@@ -32,7 +32,8 @@ TypeList::TypeList() : m_types() {}
TypeList::~TypeList() {}
void TypeList::Insert(const TypeSP &type_sp) {
- // Just push each type on the back for now. We will worry about uniquing later
+ // Just push each type on the back for now. We will worry about uniquing
+ // later
if (type_sp)
m_types.push_back(type_sp);
}
@@ -76,6 +77,7 @@ uint32_t TypeList::GetSize() const { return m_types.size(); }
TypeSP TypeList::GetTypeAtIndex(uint32_t idx) {
iterator pos, end;
uint32_t i = idx;
+ assert(i < GetSize() && "Accessing past the end of a TypeList");
for (pos = m_types.begin(), end = m_types.end(); pos != end; ++pos) {
if (i == 0)
return *pos;
@@ -123,10 +125,10 @@ void TypeList::RemoveMismatchedTypes(const char *qualified_typename,
void TypeList::RemoveMismatchedTypes(const std::string &type_scope,
const std::string &type_basename,
TypeClass type_class, bool exact_match) {
- // Our "collection" type currently is a std::map which doesn't
- // have any good way to iterate and remove items from the map
- // so we currently just make a new list and add all of the matching
- // types to it, and then swap it into m_types at the end
+ // Our "collection" type currently is a std::map which doesn't have any good
+ // way to iterate and remove items from the map so we currently just make a
+ // new list and add all of the matching types to it, and then swap it into
+ // m_types at the end
collection matching_types;
iterator pos, end = m_types.end();
@@ -161,19 +163,15 @@ void TypeList::RemoveMismatchedTypes(const std::string &type_scope,
if (type_scope_pos == match_type_scope_size - type_scope_size) {
if (type_scope_pos >= 2) {
// Our match scope ends with the type scope we were looking
- // for,
- // but we need to make sure what comes before the matching
- // type scope is a namespace boundary in case we are trying to
- // match:
- // type_basename = "d"
- // type_scope = "b::c::"
+ // for, but we need to make sure what comes before the
+ // matching type scope is a namespace boundary in case we are
+ // trying to match: type_basename = "d" type_scope = "b::c::"
// We want to match:
// match_type_scope "a::b::c::"
// But not:
// match_type_scope "a::bb::c::"
// So below we make sure what comes before "b::c::" in
- // match_type_scope
- // is "::", or the namespace boundary
+ // match_type_scope is "::", or the namespace boundary
if (match_type_scope[type_scope_pos - 1] == ':' &&
match_type_scope[type_scope_pos - 2] == ':') {
keep_match = true;
@@ -184,9 +182,8 @@ void TypeList::RemoveMismatchedTypes(const std::string &type_scope,
}
}
} else {
- // The type we are currently looking at doesn't exists
- // in a namespace or class, so it only matches if there
- // is no type scope...
+ // The type we are currently looking at doesn't exists in a namespace
+ // or class, so it only matches if there is no type scope...
keep_match =
type_scope.empty() && type_basename.compare(match_type_name) == 0;
}
@@ -203,10 +200,10 @@ void TypeList::RemoveMismatchedTypes(TypeClass type_class) {
if (type_class == eTypeClassAny)
return;
- // Our "collection" type currently is a std::map which doesn't
- // have any good way to iterate and remove items from the map
- // so we currently just make a new list and add all of the matching
- // types to it, and then swap it into m_types at the end
+ // Our "collection" type currently is a std::map which doesn't have any good
+ // way to iterate and remove items from the map so we currently just make a
+ // new list and add all of the matching types to it, and then swap it into
+ // m_types at the end
collection matching_types;
iterator pos, end = m_types.end();
diff --git a/source/Symbol/TypeMap.cpp b/source/Symbol/TypeMap.cpp
index 40c6558d5825..2838039ad603 100644
--- a/source/Symbol/TypeMap.cpp
+++ b/source/Symbol/TypeMap.cpp
@@ -45,7 +45,8 @@ TypeMap::TypeMap() : m_types() {}
TypeMap::~TypeMap() {}
void TypeMap::Insert(const TypeSP &type_sp) {
- // Just push each type on the back for now. We will worry about uniquing later
+ // Just push each type on the back for now. We will worry about uniquing
+ // later
if (type_sp)
m_types.insert(std::make_pair(type_sp->GetID(), type_sp));
}
@@ -167,10 +168,10 @@ void TypeMap::RemoveMismatchedTypes(const char *qualified_typename,
void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
const std::string &type_basename,
TypeClass type_class, bool exact_match) {
- // Our "collection" type currently is a std::map which doesn't
- // have any good way to iterate and remove items from the map
- // so we currently just make a new list and add all of the matching
- // types to it, and then swap it into m_types at the end
+ // Our "collection" type currently is a std::map which doesn't have any good
+ // way to iterate and remove items from the map so we currently just make a
+ // new list and add all of the matching types to it, and then swap it into
+ // m_types at the end
collection matching_types;
iterator pos, end = m_types.end();
@@ -205,19 +206,15 @@ void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
if (type_scope_pos == match_type_scope_size - type_scope_size) {
if (type_scope_pos >= 2) {
// Our match scope ends with the type scope we were looking
- // for,
- // but we need to make sure what comes before the matching
- // type scope is a namespace boundary in case we are trying to
- // match:
- // type_basename = "d"
- // type_scope = "b::c::"
+ // for, but we need to make sure what comes before the
+ // matching type scope is a namespace boundary in case we are
+ // trying to match: type_basename = "d" type_scope = "b::c::"
// We want to match:
// match_type_scope "a::b::c::"
// But not:
// match_type_scope "a::bb::c::"
// So below we make sure what comes before "b::c::" in
- // match_type_scope
- // is "::", or the namespace boundary
+ // match_type_scope is "::", or the namespace boundary
if (match_type_scope[type_scope_pos - 1] == ':' &&
match_type_scope[type_scope_pos - 2] == ':') {
keep_match = true;
@@ -228,9 +225,8 @@ void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
}
}
} else {
- // The type we are currently looking at doesn't exists
- // in a namespace or class, so it only matches if there
- // is no type scope...
+ // The type we are currently looking at doesn't exists in a namespace
+ // or class, so it only matches if there is no type scope...
keep_match =
type_scope.empty() && type_basename.compare(match_type_name) == 0;
}
@@ -247,10 +243,10 @@ void TypeMap::RemoveMismatchedTypes(TypeClass type_class) {
if (type_class == eTypeClassAny)
return;
- // Our "collection" type currently is a std::map which doesn't
- // have any good way to iterate and remove items from the map
- // so we currently just make a new list and add all of the matching
- // types to it, and then swap it into m_types at the end
+ // Our "collection" type currently is a std::map which doesn't have any good
+ // way to iterate and remove items from the map so we currently just make a
+ // new list and add all of the matching types to it, and then swap it into
+ // m_types at the end
collection matching_types;
iterator pos, end = m_types.end();
diff --git a/source/Symbol/UnwindPlan.cpp b/source/Symbol/UnwindPlan.cpp
index 4c0014348c42..23ca1324ab06 100644
--- a/source/Symbol/UnwindPlan.cpp
+++ b/source/Symbol/UnwindPlan.cpp
@@ -46,8 +46,7 @@ operator==(const UnwindPlan::Row::RegisterLocation &rhs) const {
}
// This function doesn't copy the dwarf expression bytes; they must remain in
-// allocated
-// memory for the lifespan of this UnwindPlan object.
+// allocated memory for the lifespan of this UnwindPlan object.
void UnwindPlan::Row::RegisterLocation::SetAtDWARFExpression(
const uint8_t *opcodes, uint32_t len) {
m_type = atDWARFExpression;
@@ -56,8 +55,7 @@ void UnwindPlan::Row::RegisterLocation::SetAtDWARFExpression(
}
// This function doesn't copy the dwarf expression bytes; they must remain in
-// allocated
-// memory for the lifespan of this UnwindPlan object.
+// allocated memory for the lifespan of this UnwindPlan object.
void UnwindPlan::Row::RegisterLocation::SetIsDWARFExpression(
const uint8_t *opcodes, uint32_t len) {
m_type = isDWARFExpression;
diff --git a/source/Symbol/UnwindTable.cpp b/source/Symbol/UnwindTable.cpp
index 405d57754ea5..7f98eaca2521 100644
--- a/source/Symbol/UnwindTable.cpp
+++ b/source/Symbol/UnwindTable.cpp
@@ -20,10 +20,9 @@
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
-// There is one UnwindTable object per ObjectFile.
-// It contains a list of Unwind objects -- one per function, populated lazily --
-// for the ObjectFile.
-// Each Unwind object has multiple UnwindPlans for different scenarios.
+// There is one UnwindTable object per ObjectFile. It contains a list of Unwind
+// objects -- one per function, populated lazily -- for the ObjectFile. Each
+// Unwind object has multiple UnwindPlans for different scenarios.
using namespace lldb;
using namespace lldb_private;
@@ -33,8 +32,7 @@ UnwindTable::UnwindTable(ObjectFile &objfile)
m_eh_frame_up(), m_compact_unwind_up(), m_arm_unwind_up() {}
// We can't do some of this initialization when the ObjectFile is running its
-// ctor; delay doing it
-// until needed for something.
+// ctor; delay doing it until needed for something.
void UnwindTable::Initialize() {
if (m_initialized)
@@ -134,10 +132,9 @@ UnwindTable::GetFuncUnwindersContainingAddress(const Address &addr,
}
// Ignore any existing FuncUnwinders for this function, create a new one and
-// don't add it to the
-// UnwindTable. This is intended for use by target modules show-unwind where we
-// want to create
-// new UnwindPlans, not re-use existing ones.
+// don't add it to the UnwindTable. This is intended for use by target modules
+// show-unwind where we want to create new UnwindPlans, not re-use existing
+// ones.
FuncUnwindersSP
UnwindTable::GetUncachedFuncUnwindersContainingAddress(const Address &addr,
SymbolContext &sc) {
diff --git a/source/Symbol/Variable.cpp b/source/Symbol/Variable.cpp
index 1957bcef1f3a..7eafef1e8955 100644
--- a/source/Symbol/Variable.cpp
+++ b/source/Symbol/Variable.cpp
@@ -239,9 +239,8 @@ bool Variable::LocationIsValidForFrame(StackFrame *frame) {
target_sp.get());
if (loclist_base_load_addr == LLDB_INVALID_ADDRESS)
return false;
- // It is a location list. We just need to tell if the location
- // list contains the current address when converted to a load
- // address
+ // It is a location list. We just need to tell if the location list
+ // contains the current address when converted to a load address
return m_location.LocationListContainsAddress(
loclist_base_load_addr,
frame->GetFrameCodeAddress().GetLoadAddress(target_sp.get()));
@@ -251,8 +250,8 @@ bool Variable::LocationIsValidForFrame(StackFrame *frame) {
}
bool Variable::LocationIsValidForAddress(const Address &address) {
- // Be sure to resolve the address to section offset prior to
- // calling this function.
+ // Be sure to resolve the address to section offset prior to calling this
+ // function.
if (address.IsSectionOffset()) {
SymbolContext sc;
CalculateSymbolContext(&sc);
@@ -268,9 +267,8 @@ bool Variable::LocationIsValidForAddress(const Address &address) {
sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
if (loclist_base_file_addr == LLDB_INVALID_ADDRESS)
return false;
- // It is a location list. We just need to tell if the location
- // list contains the current address when converted to a load
- // address
+ // It is a location list. We just need to tell if the location list
+ // contains the current address when converted to a load address
return m_location.LocationListContainsAddress(loclist_base_file_addr,
address.GetFileAddress());
}
@@ -294,8 +292,8 @@ bool Variable::IsInScope(StackFrame *frame) {
case eValueTypeVariableArgument:
case eValueTypeVariableLocal:
if (frame) {
- // We don't have a location list, we just need to see if the block
- // that this variable was defined in is currently
+ // We don't have a location list, we just need to see if the block that
+ // this variable was defined in is currently
Block *deepest_frame_block =
frame->GetSymbolContext(eSymbolContextBlock).block;
if (deepest_frame_block) {
@@ -313,8 +311,7 @@ bool Variable::IsInScope(StackFrame *frame) {
return false;
// If no scope range is specified then it means that the scope is the
- // same as the
- // scope of the enclosing lexical block.
+ // same as the scope of the enclosing lexical block.
if (m_scope_range.IsEmpty())
return true;
@@ -455,8 +452,8 @@ Status Variable::GetValuesForVariableExpressionPath(
}
bool Variable::DumpLocationForAddress(Stream *s, const Address &address) {
- // Be sure to resolve the address to section offset prior to
- // calling this function.
+ // Be sure to resolve the address to section offset prior to calling this
+ // function.
if (address.IsSectionOffset()) {
SymbolContext sc;
CalculateSymbolContext(&sc);
@@ -759,13 +756,13 @@ static void PrivateAutoComplete(
}
size_t Variable::AutoComplete(const ExecutionContext &exe_ctx,
- llvm::StringRef partial_path, StringList &matches,
- bool &word_complete) {
- word_complete = false;
+ CompletionRequest &request) {
CompilerType compiler_type;
- PrivateAutoComplete(exe_ctx.GetFramePtr(), partial_path, "", compiler_type,
- matches, word_complete);
+ bool word_complete = false;
+ PrivateAutoComplete(exe_ctx.GetFramePtr(), request.GetCursorArgumentPrefix(),
+ "", compiler_type, request.GetMatches(), word_complete);
+ request.SetWordComplete(word_complete);
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}