LLDB mainline
Section.cpp
Go to the documentation of this file.
1//===-- Section.cpp -------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "lldb/Core/Section.h"
10#include "lldb/Core/Address.h"
11#include "lldb/Core/Module.h"
14#include "lldb/Target/Target.h"
17
18#include <cinttypes>
19#include <limits>
20#include <utility>
21
22namespace lldb_private {
23class DataExtractor;
24}
25using namespace lldb;
26using namespace lldb_private;
27
28const char *Section::GetTypeAsCString() const {
29 switch (m_type) {
31 return "invalid";
33 return "code";
35 return "container";
37 return "data";
39 return "data-cstr";
41 return "data-cstr-ptr";
43 return "data-symbol-addr";
45 return "data-4-byte";
47 return "data-8-byte";
49 return "data-16-byte";
51 return "data-ptrs";
53 return "debug";
55 return "zero-fill";
57 return "objc-message-refs";
59 return "objc-cfstrings";
61 return "dwarf-abbrev";
63 return "dwarf-abbrev-dwo";
65 return "dwarf-addr";
67 return "dwarf-aranges";
69 return "dwarf-cu-index";
71 return "dwarf-tu-index";
73 return "dwarf-frame";
75 return "dwarf-info";
77 return "dwarf-info-dwo";
79 return "dwarf-line";
81 return "dwarf-line-str";
83 return "dwarf-loc";
85 return "dwarf-loc-dwo";
87 return "dwarf-loclists";
89 return "dwarf-loclists-dwo";
91 return "dwarf-macinfo";
93 return "dwarf-macro";
95 return "dwarf-pubnames";
97 return "dwarf-pubtypes";
99 return "dwarf-ranges";
101 return "dwarf-rnglists";
103 return "dwarf-rnglists-dwo";
105 return "dwarf-str";
107 return "dwarf-str-dwo";
109 return "dwarf-str-offsets";
111 return "dwarf-str-offsets-dwo";
113 return "dwarf-types";
115 return "dwarf-types-dwo";
117 return "dwarf-names";
119 return "elf-symbol-table";
121 return "elf-dynamic-symbols";
123 return "elf-relocation-entries";
125 return "elf-dynamic-link-info";
127 return "apple-names";
129 return "apple-types";
131 return "apple-namespaces";
133 return "apple-objc";
135 return "eh-frame";
137 return "ARM.exidx";
139 return "ARM.extab";
141 return "compact-unwind";
143 return "go-symtab";
145 return "absolute";
147 return "dwarf-gnu-debugaltlink";
148 case eSectionTypeCTF:
149 return "ctf";
151 return "regular";
153 return "swift-modules";
154 }
155 return "unknown";
156}
157
158Section::Section(const ModuleSP &module_sp, ObjectFile *obj_file,
159 user_id_t sect_id, ConstString name,
160 SectionType sect_type, addr_t file_addr, addr_t byte_size,
161 lldb::offset_t file_offset, lldb::offset_t file_size,
162 uint32_t log2align, uint32_t flags,
163 uint32_t target_byte_size /*=1*/)
164 : ModuleChild(module_sp), UserID(sect_id), Flags(flags),
165 m_obj_file(obj_file), m_type(sect_type), m_parent_wp(), m_name(name),
166 m_file_addr(file_addr), m_byte_size(byte_size),
167 m_file_offset(file_offset), m_file_size(file_size),
168 m_log2align(log2align), m_children(), m_fake(false), m_encrypted(false),
169 m_thread_specific(false), m_readable(false), m_writable(false),
170 m_executable(false), m_relocated(false), m_target_byte_size(target_byte_size) {
171}
172
173Section::Section(const lldb::SectionSP &parent_section_sp,
174 const ModuleSP &module_sp, ObjectFile *obj_file,
175 user_id_t sect_id, ConstString name,
176 SectionType sect_type, addr_t file_addr, addr_t byte_size,
177 lldb::offset_t file_offset, lldb::offset_t file_size,
178 uint32_t log2align, uint32_t flags,
179 uint32_t target_byte_size /*=1*/)
180 : ModuleChild(module_sp), UserID(sect_id), Flags(flags),
181 m_obj_file(obj_file), m_type(sect_type), m_parent_wp(), m_name(name),
182 m_file_addr(file_addr), m_byte_size(byte_size),
183 m_file_offset(file_offset), m_file_size(file_size),
184 m_log2align(log2align), m_children(), m_fake(false), m_encrypted(false),
185 m_thread_specific(false), m_readable(false), m_writable(false),
186 m_executable(false), m_relocated(false), m_target_byte_size(target_byte_size) {
187 if (parent_section_sp)
188 m_parent_wp = parent_section_sp;
189}
190
191Section::~Section() = default;
192
194 SectionSP parent_sp(GetParent());
195 if (parent_sp) {
196 // This section has a parent which means m_file_addr is an offset into the
197 // parent section, so the file address for this section is the file address
198 // of the parent plus the offset
199 return parent_sp->GetFileAddress() + m_file_addr;
200 }
201 // This section has no parent, so m_file_addr is the file base address
202 return m_file_addr;
203}
204
206 SectionSP parent_sp(GetParent());
207 if (parent_sp) {
208 if (m_file_addr >= file_addr)
209 return parent_sp->SetFileAddress(m_file_addr - file_addr);
210 return false;
211 } else {
212 // This section has no parent, so m_file_addr is the file base address
213 m_file_addr = file_addr;
214 return true;
215 }
216}
217
219 // This section has a parent which means m_file_addr is an offset.
220 SectionSP parent_sp(GetParent());
221 if (parent_sp)
222 return m_file_addr;
223
224 // This section has no parent, so there is no offset to be had
225 return 0;
226}
227
229 addr_t load_base_addr = LLDB_INVALID_ADDRESS;
230 SectionSP parent_sp(GetParent());
231 if (parent_sp) {
232 load_base_addr = parent_sp->GetLoadBaseAddress(target);
233 if (load_base_addr != LLDB_INVALID_ADDRESS)
234 load_base_addr += GetOffset();
235 }
236 if (load_base_addr == LLDB_INVALID_ADDRESS) {
237 load_base_addr = target->GetSectionLoadList().GetSectionLoadAddress(
238 const_cast<Section *>(this)->shared_from_this());
239 }
240 return load_base_addr;
241}
242
244 bool allow_section_end) const {
245 const size_t num_children = m_children.GetSize();
246 for (size_t i = 0; i < num_children; i++) {
247 Section *child_section = m_children.GetSectionAtIndex(i).get();
248
249 addr_t child_offset = child_section->GetOffset();
250 if (child_offset <= offset &&
251 offset - child_offset <
252 child_section->GetByteSize() + (allow_section_end ? 1 : 0))
253 return child_section->ResolveContainedAddress(offset - child_offset,
254 so_addr, allow_section_end);
255 }
256 so_addr.SetOffset(offset);
257 so_addr.SetSection(const_cast<Section *>(this)->shared_from_this());
258
259 // Ensure that there are no orphaned (i.e., moduleless) sections.
260 assert(GetModule().get());
261 return true;
262}
263
265 const addr_t file_addr = GetFileAddress();
266 if (file_addr != LLDB_INVALID_ADDRESS && !IsThreadSpecific()) {
267 if (file_addr <= vm_addr) {
268 const addr_t offset = (vm_addr - file_addr) * m_target_byte_size;
269 return offset < GetByteSize();
270 }
271 }
272 return false;
273}
274
275void Section::Dump(llvm::raw_ostream &s, unsigned indent, Target *target,
276 uint32_t depth) const {
277 s.indent(indent);
278 s << llvm::format("0x%8.8" PRIx64 " %-16s ", GetID(), GetTypeAsCString());
279 bool resolved = true;
281
282 if (GetByteSize() == 0)
283 s.indent(39);
284 else {
285 if (target)
286 addr = GetLoadBaseAddress(target);
287
288 if (addr == LLDB_INVALID_ADDRESS) {
289 if (target)
290 resolved = false;
291 addr = GetFileAddress();
292 }
293
294 VMRange range(addr, addr + m_byte_size);
295 range.Dump(s, 0);
296 }
297
298 s << llvm::format("%c %c%c%c 0x%8.8" PRIx64 " 0x%8.8" PRIx64 " 0x%8.8x ",
299 resolved ? ' ' : '*', m_readable ? 'r' : '-',
300 m_writable ? 'w' : '-', m_executable ? 'x' : '-',
302
303 DumpName(s);
304
305 s << "\n";
306
307 if (depth > 0)
308 m_children.Dump(s, indent, target, false, depth - 1);
309}
310
311void Section::DumpName(llvm::raw_ostream &s) const {
312 SectionSP parent_sp(GetParent());
313 if (parent_sp) {
314 parent_sp->DumpName(s);
315 s << '.';
316 } else {
317 // The top most section prints the module basename
318 const char *name = nullptr;
319 ModuleSP module_sp(GetModule());
320
321 if (m_obj_file) {
322 const FileSpec &file_spec = m_obj_file->GetFileSpec();
323 name = file_spec.GetFilename().AsCString();
324 }
325 if ((!name || !name[0]) && module_sp)
326 name = module_sp->GetFileSpec().GetFilename().AsCString();
327 if (name && name[0])
328 s << name << '.';
329 }
330 s << m_name;
331}
332
333bool Section::IsDescendant(const Section *section) {
334 if (this == section)
335 return true;
336 SectionSP parent_sp(GetParent());
337 if (parent_sp)
338 return parent_sp->IsDescendant(section);
339 return false;
340}
341
342bool Section::Slide(addr_t slide_amount, bool slide_children) {
344 if (slide_amount == 0)
345 return true;
346
347 m_file_addr += slide_amount;
348
349 if (slide_children)
350 m_children.Slide(slide_amount, slide_children);
351
352 return true;
353 }
354 return false;
355}
356
357/// Get the permissions as OR'ed bits from lldb::Permissions
358uint32_t Section::GetPermissions() const {
359 uint32_t permissions = 0;
360 if (m_readable)
361 permissions |= ePermissionsReadable;
362 if (m_writable)
363 permissions |= ePermissionsWritable;
364 if (m_executable)
365 permissions |= ePermissionsExecutable;
366 return permissions;
367}
368
369/// Set the permissions using bits OR'ed from lldb::Permissions
370void Section::SetPermissions(uint32_t permissions) {
371 m_readable = (permissions & ePermissionsReadable) != 0;
372 m_writable = (permissions & ePermissionsWritable) != 0;
373 m_executable = (permissions & ePermissionsExecutable) != 0;
374}
375
377 lldb::offset_t offset) {
378 if (m_obj_file)
379 return m_obj_file->ReadSectionData(this, offset, dst, dst_len);
380 return 0;
381}
382
384 if (m_obj_file)
385 return m_obj_file->ReadSectionData(this, section_data);
386 return 0;
387}
388
390 switch (m_type) {
392 case eSectionTypeCode:
394 case eSectionTypeData:
416 // Used for "__dof_cache" in mach-o or ".debug" for COFF which isn't debug
417 // information that we parse at all. This was causing system files with no
418 // debug info to show debug info byte sizes in the "statistics dump" output
419 // for each module. New "eSectionType" enums should be created for dedicated
420 // debug info that has a predefined format if we wish for these sections to
421 // show up as debug info.
423 return false;
424
459 case eSectionTypeCTF:
461 return true;
462 }
463 return false;
464}
465
466
467#pragma mark SectionList
468
470 if (this != &rhs)
472 return *this;
473}
474
475size_t SectionList::AddSection(const lldb::SectionSP &section_sp) {
476 if (section_sp) {
477 size_t section_index = m_sections.size();
478 m_sections.push_back(section_sp);
479 return section_index;
480 }
481
482 return std::numeric_limits<size_t>::max();
483}
484
485// Warning, this can be slow as it's removing items from a std::vector.
487 if (idx < m_sections.size()) {
488 m_sections.erase(m_sections.begin() + idx);
489 return true;
490 }
491 return false;
492}
493
495 iterator sect_iter;
496 iterator begin = m_sections.begin();
497 iterator end = m_sections.end();
498 for (sect_iter = begin; sect_iter != end; ++sect_iter) {
499 if (sect_iter->get() == sect) {
500 // The secton was already in this section list
501 return std::distance(begin, sect_iter);
502 }
503 }
504 return UINT32_MAX;
505}
506
508 size_t sect_idx = FindSectionIndex(sect_sp.get());
509 if (sect_idx == UINT32_MAX) {
510 sect_idx = AddSection(sect_sp);
511 }
512 return sect_idx;
513}
514
516 const lldb::SectionSP &sect_sp,
517 uint32_t depth) {
518 iterator sect_iter, end = m_sections.end();
519 for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
520 if ((*sect_iter)->GetID() == sect_id) {
521 *sect_iter = sect_sp;
522 return true;
523 } else if (depth > 0) {
524 if ((*sect_iter)
525 ->GetChildren()
526 .ReplaceSection(sect_id, sect_sp, depth - 1))
527 return true;
528 }
529 }
530 return false;
531}
532
533size_t SectionList::GetNumSections(uint32_t depth) const {
534 size_t count = m_sections.size();
535 if (depth > 0) {
536 const_iterator sect_iter, end = m_sections.end();
537 for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
538 count += (*sect_iter)->GetChildren().GetNumSections(depth - 1);
539 }
540 }
541 return count;
542}
543
545 SectionSP sect_sp;
546 if (idx < m_sections.size())
547 sect_sp = m_sections[idx];
548 return sect_sp;
549}
550
553 SectionSP sect_sp;
554 // Check if we have a valid section string
555 if (section_dstr && !m_sections.empty()) {
556 const_iterator sect_iter;
558 for (sect_iter = m_sections.begin();
559 sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
560 Section *child_section = sect_iter->get();
561 if (child_section) {
562 if (child_section->GetName() == section_dstr) {
563 sect_sp = *sect_iter;
564 } else {
565 sect_sp =
566 child_section->GetChildren().FindSectionByName(section_dstr);
567 }
568 }
569 }
570 }
571 return sect_sp;
572}
573
575 SectionSP sect_sp;
576 if (sect_id) {
577 const_iterator sect_iter;
579 for (sect_iter = m_sections.begin();
580 sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
581 if ((*sect_iter)->GetID() == sect_id) {
582 sect_sp = *sect_iter;
583 break;
584 } else {
585 sect_sp = (*sect_iter)->GetChildren().FindSectionByID(sect_id);
586 }
587 }
588 }
589 return sect_sp;
590}
591
593 bool check_children,
594 size_t start_idx) const {
595 SectionSP sect_sp;
596 size_t num_sections = m_sections.size();
597 for (size_t idx = start_idx; idx < num_sections; ++idx) {
598 if (m_sections[idx]->GetType() == sect_type) {
599 sect_sp = m_sections[idx];
600 break;
601 } else if (check_children) {
602 sect_sp = m_sections[idx]->GetChildren().FindSectionByType(
603 sect_type, check_children, 0);
604 if (sect_sp)
605 break;
606 }
607 }
608 return sect_sp;
609}
610
612 uint32_t depth) const {
613 SectionSP sect_sp;
614 const_iterator sect_iter;
616 for (sect_iter = m_sections.begin();
617 sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
618 Section *sect = sect_iter->get();
619 if (sect->ContainsFileAddress(vm_addr)) {
620 // The file address is in this section. We need to make sure one of our
621 // child sections doesn't contain this address as well as obeying the
622 // depth limit that was passed in.
623 if (depth > 0)
625 vm_addr, depth - 1);
626
627 if (sect_sp.get() == nullptr && !sect->IsFake())
628 sect_sp = *sect_iter;
629 }
630 }
631 return sect_sp;
632}
633
635 return FindSectionByID(sect_id).get() != nullptr;
636}
637
638void SectionList::Dump(llvm::raw_ostream &s, unsigned indent, Target *target,
639 bool show_header, uint32_t depth) const {
640 bool target_has_loaded_sections =
641 target && !target->GetSectionLoadList().IsEmpty();
642 if (show_header && !m_sections.empty()) {
643 s.indent(indent);
644 s << llvm::formatv(
645 "SectID Type {0} Address "
646 " Perm File Off. File Size Flags "
647 " Section Name\n",
648 target_has_loaded_sections ? "Load" : "File");
649 s.indent(indent);
650 s << "---------- ---------------- "
651 "--------------------------------------- ---- ---------- "
652 "---------- "
653 "---------- ----------------------------\n";
654 }
655
656 for (const auto &section_sp : m_sections)
657 section_sp->Dump(s, indent, target_has_loaded_sections ? target : nullptr,
658 depth);
659}
660
661size_t SectionList::Slide(addr_t slide_amount, bool slide_children) {
662 size_t count = 0;
663 const_iterator pos, end = m_sections.end();
664 for (pos = m_sections.begin(); pos != end; ++pos) {
665 if ((*pos)->Slide(slide_amount, slide_children))
666 ++count;
667 }
668 return count;
669}
670
672 uint64_t debug_info_size = 0;
673 for (const auto &section : m_sections) {
674 const SectionList &sub_sections = section->GetChildren();
675 if (sub_sections.GetSize() > 0)
676 debug_info_size += sub_sections.GetDebugInfoSize();
677 else if (section->ContainsOnlyDebugInfo())
678 debug_info_size += section->GetFileSize();
679 }
680 return debug_info_size;
681}
682
683namespace llvm {
684namespace json {
685
686bool fromJSON(const llvm::json::Value &value,
687 lldb_private::JSONSection &section, llvm::json::Path path) {
688 llvm::json::ObjectMapper o(value, path);
689 return o && o.map("name", section.name) && o.map("type", section.type) &&
690 o.map("size", section.address) && o.map("size", section.size);
691}
692
693bool fromJSON(const llvm::json::Value &value, lldb::SectionType &type,
694 llvm::json::Path path) {
695 if (auto str = value.getAsString()) {
696 type = llvm::StringSwitch<lldb::SectionType>(*str)
697 .Case("code", eSectionTypeCode)
698 .Case("container", eSectionTypeContainer)
699 .Case("data", eSectionTypeData)
700 .Case("debug", eSectionTypeDebug)
701 .Default(eSectionTypeInvalid);
702
703 if (type == eSectionTypeInvalid) {
704 path.report("invalid section type");
705 return false;
706 }
707
708 return true;
709 }
710 path.report("expected string");
711 return false;
712}
713} // namespace json
714} // namespace llvm
A section + offset based address class.
Definition: Address.h:62
void SetSection(const lldb::SectionSP &section_sp)
Set accessor for the section.
Definition: Address.h:473
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
Definition: Address.h:448
A uniqued constant string class.
Definition: ConstString.h:40
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:188
An data extractor class.
Definition: DataExtractor.h:48
A file utility class.
Definition: FileSpec.h:56
const ConstString & GetFilename() const
Filename string const get accessor.
Definition: FileSpec.h:240
A class to manage flags.
Definition: Flags.h:22
ValueType Get() const
Get accessor for all flags.
Definition: Flags.h:40
A mix in class that contains a pointer back to the module that owns the object which inherits from it...
Definition: ModuleChild.h:19
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
Definition: ModuleChild.cpp:24
A plug-in interface definition class for object file parsers.
Definition: ObjectFile.h:44
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
Definition: ObjectFile.h:274
virtual size_t ReadSectionData(Section *section, lldb::offset_t section_offset, void *dst, size_t dst_len)
Definition: ObjectFile.cpp:476
const_iterator begin() const
Definition: Section.h:41
bool ContainsSection(lldb::user_id_t sect_id) const
Definition: Section.cpp:634
const_iterator end() const
Definition: Section.h:42
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
Definition: Section.cpp:552
collection::iterator iterator
Definition: Section.h:38
size_t GetNumSections(uint32_t depth) const
Definition: Section.cpp:533
lldb::SectionSP FindSectionByID(lldb::user_id_t sect_id) const
Definition: Section.cpp:574
size_t Slide(lldb::addr_t slide_amount, bool slide_children)
Definition: Section.cpp:661
lldb::SectionSP FindSectionContainingFileAddress(lldb::addr_t addr, uint32_t depth=UINT32_MAX) const
Definition: Section.cpp:611
uint64_t GetDebugInfoSize() const
Get the debug information size from all sections that contain debug information.
Definition: Section.cpp:671
size_t GetSize() const
Definition: Section.h:75
bool DeleteSection(size_t idx)
Definition: Section.cpp:486
size_t AddSection(const lldb::SectionSP &section_sp)
Definition: Section.cpp:475
bool ReplaceSection(lldb::user_id_t sect_id, const lldb::SectionSP &section_sp, uint32_t depth=UINT32_MAX)
Definition: Section.cpp:515
SectionList & operator=(const SectionList &rhs)
Definition: Section.cpp:469
size_t FindSectionIndex(const Section *sect)
Definition: Section.cpp:494
lldb::SectionSP FindSectionByType(lldb::SectionType sect_type, bool check_children, size_t start_idx=0) const
Definition: Section.cpp:592
size_t AddUniqueSection(const lldb::SectionSP &section_sp)
Definition: Section.cpp:507
void Dump(llvm::raw_ostream &s, unsigned indent, Target *target, bool show_header, uint32_t depth) const
Definition: Section.cpp:638
lldb::SectionSP GetSectionAtIndex(size_t idx) const
Definition: Section.cpp:544
collection::const_iterator const_iterator
Definition: Section.h:39
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp) const
bool IsThreadSpecific() const
Definition: Section.h:194
bool ContainsFileAddress(lldb::addr_t vm_addr) const
Definition: Section.cpp:264
lldb::addr_t m_byte_size
Definition: Section.h:269
lldb::addr_t GetOffset() const
Definition: Section.cpp:218
lldb::addr_t m_file_addr
Definition: Section.h:266
void SetPermissions(uint32_t permissions)
Set the permissions using bits OR'ed from lldb::Permissions.
Definition: Section.cpp:370
ConstString GetName() const
Definition: Section.h:184
bool IsFake() const
Definition: Section.h:174
void DumpName(llvm::raw_ostream &s) const
Definition: Section.cpp:311
lldb::offset_t GetSectionData(void *dst, lldb::offset_t dst_len, lldb::offset_t offset=0)
Read the section data from the object file that the section resides in.
Definition: Section.cpp:376
bool IsDescendant(const Section *section)
Definition: Section.cpp:333
ObjectFile * m_obj_file
Definition: Section.h:261
lldb::SectionSP GetParent() const
Definition: Section.h:192
uint32_t GetPermissions() const
Get the permissions as OR'ed bits from lldb::Permissions.
Definition: Section.cpp:358
bool SetFileAddress(lldb::addr_t file_addr)
Definition: Section.cpp:205
Section(const lldb::ModuleSP &module_sp, ObjectFile *obj_file, lldb::user_id_t sect_id, ConstString name, lldb::SectionType sect_type, lldb::addr_t file_vm_addr, lldb::addr_t vm_size, lldb::offset_t file_offset, lldb::offset_t file_size, uint32_t log2align, uint32_t flags, uint32_t target_byte_size=1)
Definition: Section.cpp:158
lldb::SectionWP m_parent_wp
Definition: Section.h:264
ConstString m_name
Definition: Section.h:265
lldb::addr_t GetFileAddress() const
Definition: Section.cpp:193
SectionList & GetChildren()
Definition: Section.h:140
lldb::SectionType m_type
Definition: Section.h:263
bool ContainsOnlyDebugInfo() const
Returns true if this section contains debug information.
Definition: Section.cpp:389
void Dump(llvm::raw_ostream &s, unsigned indent, Target *target, uint32_t depth) const
Definition: Section.cpp:275
const char * GetTypeAsCString() const
Definition: Section.cpp:28
lldb::addr_t GetLoadBaseAddress(Target *target) const
Definition: Section.cpp:228
bool Slide(lldb::addr_t slide_amount, bool slide_children)
Definition: Section.cpp:342
bool ResolveContainedAddress(lldb::addr_t offset, Address &so_addr, bool allow_section_end=false) const
Definition: Section.cpp:243
lldb::offset_t m_file_offset
Definition: Section.h:271
lldb::offset_t m_file_size
Definition: Section.h:272
lldb::addr_t GetByteSize() const
Definition: Section.h:170
SectionList m_children
Definition: Section.h:276
uint32_t m_target_byte_size
Definition: Section.h:288
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1127
void Dump(llvm::raw_ostream &s, lldb::addr_t base_addr=0, uint32_t addr_width=8) const
Definition: VMRange.cpp:36
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:82
#define UINT32_MAX
Definition: lldb-defines.h:19
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
bool fromJSON(const llvm::json::Value &value, TraceSupportedResponse &info, llvm::json::Path path)
Definition: SBAddress.h:15
uint64_t offset_t
Definition: lldb-types.h:83
uint64_t user_id_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::Section > SectionSP
Definition: lldb-forward.h:406
uint64_t addr_t
Definition: lldb-types.h:79
@ eSectionTypeDWARFDebugStrOffsets
@ eSectionTypeELFDynamicSymbols
Elf SHT_DYNSYM section.
@ eSectionTypeData
@ eSectionTypeInvalid
@ eSectionTypeDWARFDebugPubNames
@ eSectionTypeDataObjCCFStrings
Objective-C const CFString/NSString objects.
@ eSectionTypeData16
@ eSectionTypeZeroFill
@ eSectionTypeDWARFDebugLocDwo
@ eSectionTypeDWARFDebugFrame
@ eSectionTypeARMextab
@ eSectionTypeContainer
The section contains child sections.
@ eSectionTypeDWARFDebugLocLists
DWARF v5 .debug_loclists.
@ eSectionTypeDWARFDebugTypes
DWARF .debug_types section.
@ eSectionTypeDataSymbolAddress
Address of a symbol in the symbol table.
@ eSectionTypeELFDynamicLinkInfo
Elf SHT_DYNAMIC section.
@ eSectionTypeDWARFDebugMacInfo
@ eSectionTypeAbsoluteAddress
Dummy section for symbols with absolute address.
@ eSectionTypeCompactUnwind
compact unwind section in Mach-O, __TEXT,__unwind_info
@ eSectionTypeELFRelocationEntries
Elf SHT_REL or SHT_REL section.
@ eSectionTypeDWARFAppleNamespaces
@ eSectionTypeOther
@ eSectionTypeDWARFDebugNames
DWARF v5 .debug_names.
@ eSectionTypeDWARFDebugRngLists
DWARF v5 .debug_rnglists.
@ eSectionTypeEHFrame
@ eSectionTypeDWARFDebugStrOffsetsDwo
@ eSectionTypeDWARFDebugMacro
@ eSectionTypeDWARFAppleTypes
@ eSectionTypeDWARFDebugInfo
@ eSectionTypeDWARFDebugTypesDwo
@ eSectionTypeDWARFDebugRanges
@ eSectionTypeDWARFDebugRngListsDwo
@ eSectionTypeGoSymtab
@ eSectionTypeARMexidx
@ eSectionTypeDWARFDebugLine
@ eSectionTypeDWARFDebugPubTypes
@ eSectionTypeDataObjCMessageRefs
Pointer to function pointer + selector.
@ eSectionTypeDWARFDebugTuIndex
@ eSectionTypeData4
@ eSectionTypeDWARFDebugStr
@ eSectionTypeDWARFDebugLineStr
DWARF v5 .debug_line_str.
@ eSectionTypeDWARFDebugLoc
@ eSectionTypeDWARFAppleNames
@ eSectionTypeDataCStringPointers
Pointers to C string data.
@ eSectionTypeDWARFAppleObjC
@ eSectionTypeCode
@ eSectionTypeData8
@ eSectionTypeSwiftModules
@ eSectionTypeDebug
@ eSectionTypeDWARFDebugCuIndex
@ eSectionTypeDWARFDebugAranges
@ eSectionTypeDWARFDebugAbbrevDwo
@ eSectionTypeDWARFGNUDebugAltLink
@ eSectionTypeDWARFDebugStrDwo
@ eSectionTypeDWARFDebugAbbrev
@ eSectionTypeDataPointers
@ eSectionTypeDWARFDebugLocListsDwo
@ eSectionTypeDWARFDebugInfoDwo
@ eSectionTypeDWARFDebugAddr
@ eSectionTypeDataCString
Inlined C string data.
@ eSectionTypeELFSymbolTable
Elf SHT_SYMTAB section.
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:365
Definition: Debugger.h:53
std::optional< uint64_t > size
Definition: Section.h:107
std::optional< lldb::SectionType > type
Definition: Section.h:105
std::optional< uint64_t > address
Definition: Section.h:106
A mix in class that contains a generic user ID.
Definition: UserID.h:31
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47