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 "lldb-type-summaries";
153 return "lldb-formatters";
155 return "swift-modules";
157 return "wasm-name";
159 return "regular";
160 }
161 return "unknown";
162}
163
164Section::Section(const ModuleSP &module_sp, ObjectFile *obj_file,
165 user_id_t sect_id, ConstString name, SectionType sect_type,
166 addr_t file_addr, addr_t byte_size, lldb::offset_t file_offset,
167 lldb::offset_t file_size, uint32_t log2align, uint32_t flags,
168 uint32_t target_byte_size /*=1*/)
169 : ModuleChild(module_sp), UserID(sect_id), Flags(flags),
170 m_obj_file(obj_file), m_type(sect_type), m_parent_wp(), m_name(name),
171 m_file_addr(file_addr), m_byte_size(byte_size),
172 m_file_offset(file_offset), m_file_size(file_size),
173 m_log2align(log2align), m_children(), m_fake(false), m_encrypted(false),
174 m_thread_specific(false), m_readable(false), m_writable(false),
175 m_executable(false), m_relocated(false),
176 m_target_byte_size(target_byte_size) {}
177
178Section::Section(const lldb::SectionSP &parent_section_sp,
179 const ModuleSP &module_sp, ObjectFile *obj_file,
180 user_id_t sect_id, ConstString name, SectionType sect_type,
181 addr_t file_addr, addr_t byte_size, lldb::offset_t file_offset,
182 lldb::offset_t file_size, uint32_t log2align, uint32_t flags,
183 uint32_t target_byte_size /*=1*/)
184 : ModuleChild(module_sp), UserID(sect_id), Flags(flags),
185 m_obj_file(obj_file), m_type(sect_type), m_parent_wp(), m_name(name),
186 m_file_addr(file_addr), m_byte_size(byte_size),
187 m_file_offset(file_offset), m_file_size(file_size),
188 m_log2align(log2align), m_children(), m_fake(false), m_encrypted(false),
189 m_thread_specific(false), m_readable(false), m_writable(false),
190 m_executable(false), m_relocated(false),
191 m_target_byte_size(target_byte_size) {
192 if (parent_section_sp)
193 m_parent_wp = parent_section_sp;
194}
195
196Section::~Section() = default;
197
199 SectionSP parent_sp(GetParent());
200 if (parent_sp) {
201 // This section has a parent which means m_file_addr is an offset into the
202 // parent section, so the file address for this section is the file address
203 // of the parent plus the offset
204 return parent_sp->GetFileAddress() + m_file_addr;
205 }
206 // This section has no parent, so m_file_addr is the file base address
207 return m_file_addr;
208}
209
211 SectionSP parent_sp(GetParent());
212 if (parent_sp) {
213 if (m_file_addr >= file_addr)
214 return parent_sp->SetFileAddress(m_file_addr - file_addr);
215 return false;
216 } else {
217 // This section has no parent, so m_file_addr is the file base address
218 m_file_addr = file_addr;
219 return true;
220 }
221}
222
224 // This section has a parent which means m_file_addr is an offset.
225 SectionSP parent_sp(GetParent());
226 if (parent_sp)
227 return m_file_addr;
228
229 // This section has no parent, so there is no offset to be had
230 return 0;
231}
232
234 addr_t load_base_addr = LLDB_INVALID_ADDRESS;
235 SectionSP parent_sp(GetParent());
236 if (parent_sp) {
237 load_base_addr = parent_sp->GetLoadBaseAddress(target);
238 if (load_base_addr != LLDB_INVALID_ADDRESS)
239 load_base_addr += GetOffset();
240 }
241 if (load_base_addr == LLDB_INVALID_ADDRESS) {
242 load_base_addr = target->GetSectionLoadAddress(
243 const_cast<Section *>(this)->shared_from_this());
244 }
245 return load_base_addr;
246}
247
249 bool allow_section_end) const {
250 const size_t num_children = m_children.GetSize();
251 for (size_t i = 0; i < num_children; i++) {
252 Section *child_section = m_children.GetSectionAtIndex(i).get();
253
254 addr_t child_offset = child_section->GetOffset();
255 if (child_offset <= offset &&
256 offset - child_offset <
257 child_section->GetByteSize() + (allow_section_end ? 1 : 0))
258 return child_section->ResolveContainedAddress(offset - child_offset,
259 so_addr, allow_section_end);
260 }
261 so_addr.SetOffset(offset);
262 so_addr.SetSection(const_cast<Section *>(this)->shared_from_this());
263
264 // Ensure that there are no orphaned (i.e., moduleless) sections.
265 assert(GetModule().get());
266 return true;
267}
268
270 const addr_t file_addr = GetFileAddress();
271 if (file_addr != LLDB_INVALID_ADDRESS && !IsThreadSpecific()) {
272 if (file_addr <= vm_addr) {
273 const addr_t offset = (vm_addr - file_addr) * m_target_byte_size;
274 return offset < GetByteSize();
275 }
276 }
277 return false;
278}
279
280void Section::Dump(llvm::raw_ostream &s, unsigned indent, Target *target,
281 uint32_t depth) const {
282 s.indent(indent);
283 s << llvm::format("0x%16.16" PRIx64 " %-22s ", GetID(), GetTypeAsCString());
284 bool resolved = true;
286
287 if (GetByteSize() == 0)
288 s.indent(39);
289 else {
290 if (target)
291 addr = GetLoadBaseAddress(target);
292
293 if (addr == LLDB_INVALID_ADDRESS) {
294 if (target)
295 resolved = false;
296 addr = GetFileAddress();
297 }
298
299 VMRange range(addr, addr + m_byte_size);
300 range.Dump(s, 0);
301 }
302
303 s << llvm::format("%c %c%c%c 0x%8.8" PRIx64 " 0x%8.8" PRIx64 " 0x%8.8x ",
304 resolved ? ' ' : '*', m_readable ? 'r' : '-',
305 m_writable ? 'w' : '-', m_executable ? 'x' : '-',
307
308 DumpName(s);
309
310 s << "\n";
311
312 if (depth > 0)
313 m_children.Dump(s, indent, target, false, depth - 1);
314}
315
316void Section::DumpName(llvm::raw_ostream &s) const {
317 SectionSP parent_sp(GetParent());
318 if (parent_sp) {
319 parent_sp->DumpName(s);
320 s << '.';
321 } else {
322 // The top most section prints the module basename
323 const char *name = nullptr;
324 ModuleSP module_sp(GetModule());
325
326 if (m_obj_file) {
327 const FileSpec &file_spec = m_obj_file->GetFileSpec();
328 name = file_spec.GetFilename().AsCString();
329 }
330 if ((!name || !name[0]) && module_sp)
331 name = module_sp->GetFileSpec().GetFilename().AsCString();
332 if (name && name[0])
333 s << name << '.';
334 }
335 s << m_name;
336}
337
338bool Section::IsDescendant(const Section *section) {
339 if (this == section)
340 return true;
341 SectionSP parent_sp(GetParent());
342 if (parent_sp)
343 return parent_sp->IsDescendant(section);
344 return false;
345}
346
347bool Section::Slide(addr_t slide_amount, bool slide_children) {
349 if (slide_amount == 0)
350 return true;
351
352 m_file_addr += slide_amount;
353
354 if (slide_children)
355 m_children.Slide(slide_amount, slide_children);
356
357 return true;
358 }
359 return false;
360}
361
362/// Get the permissions as OR'ed bits from lldb::Permissions
363uint32_t Section::GetPermissions() const {
364 uint32_t permissions = 0;
365 if (m_readable)
366 permissions |= ePermissionsReadable;
367 if (m_writable)
368 permissions |= ePermissionsWritable;
369 if (m_executable)
370 permissions |= ePermissionsExecutable;
371 return permissions;
372}
373
374/// Set the permissions using bits OR'ed from lldb::Permissions
375void Section::SetPermissions(uint32_t permissions) {
376 m_readable = (permissions & ePermissionsReadable) != 0;
377 m_writable = (permissions & ePermissionsWritable) != 0;
378 m_executable = (permissions & ePermissionsExecutable) != 0;
379}
380
382 lldb::offset_t offset) {
383 if (m_obj_file)
384 return m_obj_file->ReadSectionData(this, offset, dst, dst_len);
385 return 0;
386}
387
389 if (m_obj_file)
390 return m_obj_file->ReadSectionData(this, section_data);
391 return 0;
392}
393
395 switch (m_type) {
397 case eSectionTypeCode:
399 case eSectionTypeData:
422 // Used for "__dof_cache" in mach-o or ".debug" for COFF which isn't debug
423 // information that we parse at all. This was causing system files with no
424 // debug info to show debug info byte sizes in the "statistics dump" output
425 // for each module. New "eSectionType" enums should be created for dedicated
426 // debug info that has a predefined format if we wish for these sections to
427 // show up as debug info.
429 return false;
430
465 case eSectionTypeCTF:
469 return true;
470 }
471 return false;
472}
473
474#pragma mark SectionList
475
477 if (this != &rhs)
479 return *this;
480}
481
482size_t SectionList::AddSection(const lldb::SectionSP &section_sp) {
483 if (section_sp) {
484 size_t section_index = m_sections.size();
485 m_sections.push_back(section_sp);
486 return section_index;
487 }
488
489 return std::numeric_limits<size_t>::max();
490}
491
492// Warning, this can be slow as it's removing items from a std::vector.
494 if (idx < m_sections.size()) {
495 m_sections.erase(m_sections.begin() + idx);
496 return true;
497 }
498 return false;
499}
500
502 iterator sect_iter;
503 iterator begin = m_sections.begin();
504 iterator end = m_sections.end();
505 for (sect_iter = begin; sect_iter != end; ++sect_iter) {
506 if (sect_iter->get() == sect) {
507 // The secton was already in this section list
508 return std::distance(begin, sect_iter);
509 }
510 }
511 return UINT32_MAX;
512}
513
515 size_t sect_idx = FindSectionIndex(sect_sp.get());
516 if (sect_idx == UINT32_MAX) {
517 sect_idx = AddSection(sect_sp);
518 }
519 return sect_idx;
520}
521
523 const lldb::SectionSP &sect_sp,
524 uint32_t depth) {
525 iterator sect_iter, end = m_sections.end();
526 for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
527 if ((*sect_iter)->GetID() == sect_id) {
528 *sect_iter = sect_sp;
529 return true;
530 } else if (depth > 0) {
531 if ((*sect_iter)
532 ->GetChildren()
533 .ReplaceSection(sect_id, sect_sp, depth - 1))
534 return true;
535 }
536 }
537 return false;
538}
539
540size_t SectionList::GetNumSections(uint32_t depth) const {
541 size_t count = m_sections.size();
542 if (depth > 0) {
543 const_iterator sect_iter, end = m_sections.end();
544 for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
545 count += (*sect_iter)->GetChildren().GetNumSections(depth - 1);
546 }
547 }
548 return count;
549}
550
552 SectionSP sect_sp;
553 if (idx < m_sections.size())
554 sect_sp = m_sections[idx];
555 return sect_sp;
556}
557
559 SectionSP sect_sp;
560 // Check if we have a valid section string
561 if (section_dstr && !m_sections.empty()) {
562 const_iterator sect_iter;
564 for (sect_iter = m_sections.begin();
565 sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
566 Section *child_section = sect_iter->get();
567 if (child_section) {
568 if (child_section->GetName() == section_dstr) {
569 sect_sp = *sect_iter;
570 } else {
571 sect_sp =
572 child_section->GetChildren().FindSectionByName(section_dstr);
573 }
574 }
575 }
576 }
577 return sect_sp;
578}
579
581 SectionSP sect_sp;
582 if (sect_id) {
583 const_iterator sect_iter;
585 for (sect_iter = m_sections.begin();
586 sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
587 if ((*sect_iter)->GetID() == sect_id) {
588 sect_sp = *sect_iter;
589 break;
590 } else {
591 sect_sp = (*sect_iter)->GetChildren().FindSectionByID(sect_id);
592 }
593 }
594 }
595 return sect_sp;
596}
597
599 bool check_children,
600 size_t start_idx) const {
601 SectionSP sect_sp;
602 size_t num_sections = m_sections.size();
603 for (size_t idx = start_idx; idx < num_sections; ++idx) {
604 if (m_sections[idx]->GetType() == sect_type) {
605 sect_sp = m_sections[idx];
606 break;
607 } else if (check_children) {
608 sect_sp = m_sections[idx]->GetChildren().FindSectionByType(
609 sect_type, check_children, 0);
610 if (sect_sp)
611 break;
612 }
613 }
614 return sect_sp;
615}
616
618 uint32_t depth) const {
619 SectionSP sect_sp;
620 const_iterator sect_iter;
622 for (sect_iter = m_sections.begin();
623 sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
624 Section *sect = sect_iter->get();
625 if (sect->ContainsFileAddress(vm_addr)) {
626 // The file address is in this section. We need to make sure one of our
627 // child sections doesn't contain this address as well as obeying the
628 // depth limit that was passed in.
629 if (depth > 0)
631 vm_addr, depth - 1);
632
633 if (sect_sp.get() == nullptr && !sect->IsFake())
634 sect_sp = *sect_iter;
635 }
636 }
637 return sect_sp;
638}
639
641 return FindSectionByID(sect_id).get() != nullptr;
642}
643
644void SectionList::Dump(llvm::raw_ostream &s, unsigned indent, Target *target,
645 bool show_header, uint32_t depth) const {
646 bool target_has_loaded_sections = target && target->HasLoadedSections();
647 if (show_header && !m_sections.empty()) {
648 s.indent(indent);
649 s << llvm::formatv(
650 "SectID Type {0} Address "
651 " Perm File Off. File Size Flags Section Name\n",
652 target_has_loaded_sections ? "Load" : "File");
653 s.indent(indent);
654 s << "------------------ ---------------------- "
655 "--------------------------------------- ---- ---------- ---------- "
656 "---------- ----------------------------\n";
657 }
658
659 for (const auto &section_sp : m_sections)
660 section_sp->Dump(s, indent, target_has_loaded_sections ? target : nullptr,
661 depth);
662}
663
664size_t SectionList::Slide(addr_t slide_amount, bool slide_children) {
665 size_t count = 0;
666 const_iterator pos, end = m_sections.end();
667 for (pos = m_sections.begin(); pos != end; ++pos) {
668 if ((*pos)->Slide(slide_amount, slide_children))
669 ++count;
670 }
671 return count;
672}
673
675 uint64_t debug_info_size = 0;
676 for (const auto &section : m_sections) {
677 const SectionList &sub_sections = section->GetChildren();
678 if (sub_sections.GetSize() > 0)
679 debug_info_size += sub_sections.GetDebugInfoSize();
680 else if (section->ContainsOnlyDebugInfo())
681 debug_info_size += section->GetFileSize();
682 }
683 return debug_info_size;
684}
685
686namespace llvm {
687namespace json {
688
689bool fromJSON(const llvm::json::Value &value,
690 lldb_private::JSONSection &section, llvm::json::Path path) {
691 llvm::json::ObjectMapper o(value, path);
692 return o && o.map("name", section.name) && o.map("type", section.type) &&
693 o.map("address", section.address) && o.map("size", section.size) &&
694 o.map("read", section.read) && o.map("write", section.write) &&
695 o.map("execute", section.execute) &&
696 o.mapOptional("subsections", section.subsections) &&
697 o.map("user_id", section.user_id) &&
698 o.map("file_offset", section.file_offset) &&
699 o.map("file_size", section.file_size) &&
700 o.map("alignment", section.log2align) &&
701 o.map("flags", section.flags) && o.map("fake", section.fake) &&
702 o.map("encrypted", section.encrypted) &&
703 o.map("thread_specific", section.thread_specific);
704}
705
706bool fromJSON(const llvm::json::Value &value, lldb::SectionType &type,
707 llvm::json::Path path) {
708 if (auto str = value.getAsString()) {
709 type = llvm::StringSwitch<lldb::SectionType>(*str)
710 .Case("code", eSectionTypeCode)
711 .Case("container", eSectionTypeContainer)
712 .Case("data", eSectionTypeData)
713 .Case("debug", eSectionTypeDebug)
714 .Default(eSectionTypeInvalid);
715
716 if (type == eSectionTypeInvalid) {
717 path.report("invalid section type");
718 return false;
719 }
720
721 return true;
722 }
723 path.report("expected string");
724 return false;
725}
726} // namespace json
727} // 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:466
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
Definition Address.h:441
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.
An data extractor class.
A file utility class.
Definition FileSpec.h:57
const ConstString & GetFilename() const
Filename string const get accessor.
Definition FileSpec.h:251
Flags(ValueType flags=0)
Construct with initial flag bit values.
Definition Flags.h:34
ValueType Get() const
Get accessor for all flags.
Definition Flags.h:40
ModuleChild(const lldb::ModuleSP &module_sp)
Construct with owning module.
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
A plug-in interface definition class for object file parsers.
Definition ObjectFile.h:45
const_iterator begin() const
Definition Section.h:41
bool ContainsSection(lldb::user_id_t sect_id) const
Definition Section.cpp:640
const_iterator end() const
Definition Section.h:42
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
Definition Section.cpp:558
collection::iterator iterator
Definition Section.h:38
size_t GetNumSections(uint32_t depth) const
Definition Section.cpp:540
lldb::SectionSP FindSectionByID(lldb::user_id_t sect_id) const
Definition Section.cpp:580
SectionList()=default
Create an empty list.
size_t Slide(lldb::addr_t slide_amount, bool slide_children)
Definition Section.cpp:664
lldb::SectionSP FindSectionContainingFileAddress(lldb::addr_t addr, uint32_t depth=UINT32_MAX) const
Definition Section.cpp:617
uint64_t GetDebugInfoSize() const
Get the debug information size from all sections that contain debug information.
Definition Section.cpp:674
size_t GetSize() const
Definition Section.h:75
bool DeleteSection(size_t idx)
Definition Section.cpp:493
size_t AddSection(const lldb::SectionSP &section_sp)
Definition Section.cpp:482
bool ReplaceSection(lldb::user_id_t sect_id, const lldb::SectionSP &section_sp, uint32_t depth=UINT32_MAX)
Definition Section.cpp:522
SectionList & operator=(const SectionList &rhs)
Definition Section.cpp:476
size_t FindSectionIndex(const Section *sect)
Definition Section.cpp:501
lldb::SectionSP FindSectionByType(lldb::SectionType sect_type, bool check_children, size_t start_idx=0) const
Definition Section.cpp:598
size_t AddUniqueSection(const lldb::SectionSP &section_sp)
Definition Section.cpp:514
void Dump(llvm::raw_ostream &s, unsigned indent, Target *target, bool show_header, uint32_t depth) const
Definition Section.cpp:644
lldb::SectionSP GetSectionAtIndex(size_t idx) const
Definition Section.cpp:551
collection::const_iterator const_iterator
Definition Section.h:39
bool IsThreadSpecific() const
Definition Section.h:210
bool ContainsFileAddress(lldb::addr_t vm_addr) const
Definition Section.cpp:269
lldb::addr_t m_byte_size
Definition Section.h:285
lldb::addr_t GetOffset() const
Definition Section.cpp:223
lldb::addr_t m_file_addr
Definition Section.h:282
void SetPermissions(uint32_t permissions)
Set the permissions using bits OR'ed from lldb::Permissions.
Definition Section.cpp:375
ConstString GetName() const
Definition Section.h:200
bool IsFake() const
Definition Section.h:190
void DumpName(llvm::raw_ostream &s) const
Definition Section.cpp:316
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:381
bool IsDescendant(const Section *section)
Definition Section.cpp:338
ObjectFile * m_obj_file
Definition Section.h:277
lldb::SectionSP GetParent() const
Definition Section.h:208
uint32_t GetPermissions() const
Get the permissions as OR'ed bits from lldb::Permissions.
Definition Section.cpp:363
bool SetFileAddress(lldb::addr_t file_addr)
Definition Section.cpp:210
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:164
lldb::SectionWP m_parent_wp
Definition Section.h:280
ConstString m_name
Definition Section.h:281
lldb::addr_t GetFileAddress() const
Definition Section.cpp:198
SectionList & GetChildren()
Definition Section.h:156
lldb::SectionType m_type
Definition Section.h:279
bool ContainsOnlyDebugInfo() const
Returns true if this section contains debug information.
Definition Section.cpp:394
void Dump(llvm::raw_ostream &s, unsigned indent, Target *target, uint32_t depth) const
Definition Section.cpp:280
const char * GetTypeAsCString() const
Definition Section.cpp:28
lldb::addr_t GetLoadBaseAddress(Target *target) const
Definition Section.cpp:233
bool Slide(lldb::addr_t slide_amount, bool slide_children)
Definition Section.cpp:347
bool ResolveContainedAddress(lldb::addr_t offset, Address &so_addr, bool allow_section_end=false) const
Definition Section.cpp:248
lldb::offset_t m_file_offset
Definition Section.h:287
lldb::offset_t m_file_size
Definition Section.h:288
lldb::addr_t GetByteSize() const
Definition Section.h:186
SectionList m_children
Definition Section.h:292
uint32_t m_target_byte_size
Definition Section.h:304
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp)
Definition Target.cpp:5235
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
#define UINT32_MAX
A class that represents a running process on the host machine.
bool fromJSON(const llvm::json::Value &value, TraceSupportedResponse &info, llvm::json::Path path)
uint64_t offset_t
Definition lldb-types.h:85
uint64_t user_id_t
Definition lldb-types.h:82
std::shared_ptr< lldb_private::Section > SectionSP
uint64_t addr_t
Definition lldb-types.h:80
@ eSectionTypeDWARFDebugStrOffsets
@ eSectionTypeELFDynamicSymbols
Elf SHT_DYNSYM section.
@ eSectionTypeInvalid
@ eSectionTypeDWARFDebugPubNames
@ eSectionTypeDataObjCCFStrings
Objective-C const CFString/NSString objects.
@ 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
@ eSectionTypeLLDBFormatters
@ eSectionTypeDWARFDebugNames
DWARF v5 .debug_names.
@ eSectionTypeDWARFDebugRngLists
DWARF v5 .debug_rnglists.
@ eSectionTypeEHFrame
@ eSectionTypeDWARFDebugStrOffsetsDwo
@ eSectionTypeDWARFDebugMacro
@ eSectionTypeDWARFAppleTypes
@ eSectionTypeDWARFDebugInfo
@ eSectionTypeDWARFDebugTypesDwo
@ eSectionTypeDWARFDebugRanges
@ eSectionTypeDWARFDebugRngListsDwo
@ eSectionTypeLLDBTypeSummaries
@ eSectionTypeGoSymtab
@ eSectionTypeARMexidx
@ eSectionTypeDWARFDebugLine
@ eSectionTypeDWARFDebugPubTypes
@ eSectionTypeDataObjCMessageRefs
Pointer to function pointer + selector.
@ eSectionTypeDWARFDebugTuIndex
@ eSectionTypeDWARFDebugStr
@ eSectionTypeDWARFDebugLineStr
DWARF v5 .debug_line_str.
@ eSectionTypeDWARFDebugLoc
@ eSectionTypeDWARFAppleNames
@ eSectionTypeDataCStringPointers
Pointers to C string data.
@ eSectionTypeDWARFAppleObjC
@ eSectionTypeSwiftModules
@ eSectionTypeDWARFDebugCuIndex
@ eSectionTypeDWARFDebugAranges
@ eSectionTypeDWARFDebugAbbrevDwo
@ eSectionTypeDWARFGNUDebugAltLink
@ eSectionTypeDWARFDebugStrDwo
@ eSectionTypeDWARFDebugAbbrev
@ eSectionTypeDataPointers
@ eSectionTypeDWARFDebugLocListsDwo
@ eSectionTypeDWARFDebugInfoDwo
@ eSectionTypeDWARFDebugAddr
@ eSectionTypeWasmName
@ eSectionTypeDataCString
Inlined C string data.
@ eSectionTypeELFSymbolTable
Elf SHT_SYMTAB section.
std::shared_ptr< lldb_private::Module > ModuleSP
std::optional< lldb::user_id_t > user_id
Definition Section.h:104
std::optional< uint64_t > log2align
Definition Section.h:111
std::optional< uint64_t > size
Definition Section.h:108
std::optional< uint64_t > flags
Definition Section.h:112
std::optional< bool > encrypted
Definition Section.h:120
std::optional< bool > fake
Definition Section.h:119
std::optional< lldb::SectionType > type
Definition Section.h:106
std::optional< bool > write
Definition Section.h:116
std::optional< bool > execute
Definition Section.h:117
std::optional< uint64_t > file_offset
Definition Section.h:109
std::optional< uint64_t > address
Definition Section.h:107
std::optional< bool > thread_specific
Definition Section.h:121
std::optional< uint64_t > file_size
Definition Section.h:110
std::vector< JSONSection > subsections
Definition Section.h:123
std::optional< bool > read
Definition Section.h:115
UserID(lldb::user_id_t uid=LLDB_INVALID_UID)
Construct with optional user ID.
Definition UserID.h:33
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition UserID.h:47