diff options
Diffstat (limited to 'lldb/source/Symbol/SymbolContext.cpp')
| -rw-r--r-- | lldb/source/Symbol/SymbolContext.cpp | 92 |
1 files changed, 45 insertions, 47 deletions
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 4ac35010c74..8716f50a384 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/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; |

