diff options
Diffstat (limited to 'source/Core/Section.cpp')
-rw-r--r-- | source/Core/Section.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/source/Core/Section.cpp b/source/Core/Section.cpp index 87f75e1f50ac4..f30ddd2c18c37 100644 --- a/source/Core/Section.cpp +++ b/source/Core/Section.cpp @@ -1,9 +1,8 @@ //===-- Section.cpp ---------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -105,6 +104,8 @@ const char *Section::GetTypeAsCString() const { return "dwarf-str-offsets-dwo"; case eSectionTypeDWARFDebugTypes: return "dwarf-types"; + case eSectionTypeDWARFDebugTypesDwo: + return "dwarf-types-dwo"; case eSectionTypeDWARFDebugNames: return "dwarf-names"; case eSectionTypeELFSymbolTable: @@ -144,7 +145,7 @@ const char *Section::GetTypeAsCString() const { } Section::Section(const ModuleSP &module_sp, ObjectFile *obj_file, - user_id_t sect_id, const ConstString &name, + user_id_t sect_id, ConstString name, SectionType sect_type, addr_t file_addr, addr_t byte_size, lldb::offset_t file_offset, lldb::offset_t file_size, uint32_t log2align, uint32_t flags, @@ -166,7 +167,7 @@ Section::Section(const ModuleSP &module_sp, ObjectFile *obj_file, Section::Section(const lldb::SectionSP &parent_section_sp, const ModuleSP &module_sp, ObjectFile *obj_file, - user_id_t sect_id, const ConstString &name, + user_id_t sect_id, ConstString name, SectionType sect_type, addr_t file_addr, addr_t byte_size, lldb::offset_t file_offset, lldb::offset_t file_size, uint32_t log2align, uint32_t flags, @@ -343,7 +344,7 @@ void Section::DumpName(Stream *s) const { s->PutChar('.'); } else { // The top most section prints the module basename - const char *name = NULL; + const char *name = nullptr; ModuleSP module_sp(GetModule()); if (m_obj_file) { @@ -382,9 +383,7 @@ bool Section::Slide(addr_t slide_amount, bool slide_children) { return false; } -//------------------------------------------------------------------ /// Get the permissions as OR'ed bits from lldb::Permissions -//------------------------------------------------------------------ uint32_t Section::GetPermissions() const { uint32_t permissions = 0; if (m_readable) @@ -396,9 +395,7 @@ uint32_t Section::GetPermissions() const { return permissions; } -//------------------------------------------------------------------ /// Set the permissions using bits OR'ed from lldb::Permissions -//------------------------------------------------------------------ void Section::SetPermissions(uint32_t permissions) { m_readable = (permissions & ePermissionsReadable) != 0; m_writable = (permissions & ePermissionsWritable) != 0; @@ -507,14 +504,14 @@ SectionSP SectionList::GetSectionAtIndex(size_t idx) const { } SectionSP -SectionList::FindSectionByName(const ConstString §ion_dstr) const { +SectionList::FindSectionByName(ConstString section_dstr) const { SectionSP sect_sp; // Check if we have a valid section string if (section_dstr && !m_sections.empty()) { const_iterator sect_iter; const_iterator end = m_sections.end(); for (sect_iter = m_sections.begin(); - sect_iter != end && sect_sp.get() == NULL; ++sect_iter) { + sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) { Section *child_section = sect_iter->get(); if (child_section) { if (child_section->GetName() == section_dstr) { @@ -535,7 +532,7 @@ SectionSP SectionList::FindSectionByID(user_id_t sect_id) const { const_iterator sect_iter; const_iterator end = m_sections.end(); for (sect_iter = m_sections.begin(); - sect_iter != end && sect_sp.get() == NULL; ++sect_iter) { + sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) { if ((*sect_iter)->GetID() == sect_id) { sect_sp = *sect_iter; break; @@ -572,7 +569,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr, const_iterator sect_iter; const_iterator end = m_sections.end(); for (sect_iter = m_sections.begin(); - sect_iter != end && sect_sp.get() == NULL; ++sect_iter) { + sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) { Section *sect = sect_iter->get(); if (sect->ContainsFileAddress(vm_addr)) { // The file address is in this section. We need to make sure one of our @@ -582,7 +579,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr, sect_sp = sect->GetChildren().FindSectionContainingFileAddress( vm_addr, depth - 1); - if (sect_sp.get() == NULL && !sect->IsFake()) + if (sect_sp.get() == nullptr && !sect->IsFake()) sect_sp = *sect_iter; } } @@ -590,7 +587,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr, } bool SectionList::ContainsSection(user_id_t sect_id) const { - return FindSectionByID(sect_id).get() != NULL; + return FindSectionByID(sect_id).get() != nullptr; } void SectionList::Dump(Stream *s, Target *target, bool show_header, @@ -613,7 +610,7 @@ void SectionList::Dump(Stream *s, Target *target, bool show_header, const_iterator sect_iter; const_iterator end = m_sections.end(); for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) { - (*sect_iter)->Dump(s, target_has_loaded_sections ? target : NULL, depth); + (*sect_iter)->Dump(s, target_has_loaded_sections ? target : nullptr, depth); } if (show_header && !m_sections.empty()) |