LLDB  mainline
Section.cpp
Go to the documentation of this file.
1 //===-- Section.cpp ---------------------------------------------*- C++ -*-===//
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"
12 #include "lldb/Symbol/ObjectFile.h"
14 #include "lldb/Target/Target.h"
15 #include "lldb/Utility/FileSpec.h"
16 #include "lldb/Utility/Stream.h"
17 #include "lldb/Utility/VMRange.h"
18 
19 #include <inttypes.h>
20 #include <limits>
21 #include <utility>
22 
23 namespace lldb_private {
24 class DataExtractor;
25 }
26 using namespace lldb;
27 using namespace lldb_private;
28 
29 const char *Section::GetTypeAsCString() const {
30  switch (m_type) {
32  return "invalid";
33  case eSectionTypeCode:
34  return "code";
36  return "container";
37  case eSectionTypeData:
38  return "data";
40  return "data-cstr";
42  return "data-cstr-ptr";
44  return "data-symbol-addr";
45  case eSectionTypeData4:
46  return "data-4-byte";
47  case eSectionTypeData8:
48  return "data-8-byte";
49  case eSectionTypeData16:
50  return "data-16-byte";
52  return "data-ptrs";
53  case eSectionTypeDebug:
54  return "debug";
56  return "zero-fill";
58  return "objc-message-refs";
60  return "objc-cfstrings";
62  return "dwarf-abbrev";
64  return "dwarf-abbrev-dwo";
66  return "dwarf-addr";
68  return "dwarf-aranges";
70  return "dwarf-cu-index";
72  return "dwarf-frame";
74  return "dwarf-info";
76  return "dwarf-info-dwo";
78  return "dwarf-line";
80  return "dwarf-line-str";
82  return "dwarf-loc";
84  return "dwarf-loclists";
86  return "dwarf-macinfo";
88  return "dwarf-macro";
90  return "dwarf-pubnames";
92  return "dwarf-pubtypes";
94  return "dwarf-ranges";
96  return "dwarf-rnglists";
98  return "dwarf-str";
100  return "dwarf-str-dwo";
102  return "dwarf-str-offsets";
104  return "dwarf-str-offsets-dwo";
106  return "dwarf-types";
108  return "dwarf-names";
110  return "elf-symbol-table";
112  return "elf-dynamic-symbols";
114  return "elf-relocation-entries";
116  return "elf-dynamic-link-info";
118  return "apple-names";
120  return "apple-types";
122  return "apple-namespaces";
124  return "apple-objc";
125  case eSectionTypeEHFrame:
126  return "eh-frame";
128  return "ARM.exidx";
130  return "ARM.extab";
132  return "compact-unwind";
134  return "go-symtab";
136  return "absolute";
138  return "dwarf-gnu-debugaltlink";
139  case eSectionTypeOther:
140  return "regular";
141  }
142  return "unknown";
143 }
144 
145 Section::Section(const ModuleSP &module_sp, ObjectFile *obj_file,
146  user_id_t sect_id, ConstString name,
147  SectionType sect_type, addr_t file_addr, addr_t byte_size,
148  lldb::offset_t file_offset, lldb::offset_t file_size,
149  uint32_t log2align, uint32_t flags,
150  uint32_t target_byte_size /*=1*/)
151  : ModuleChild(module_sp), UserID(sect_id), Flags(flags),
152  m_obj_file(obj_file), m_type(sect_type), m_parent_wp(), m_name(name),
153  m_file_addr(file_addr), m_byte_size(byte_size),
154  m_file_offset(file_offset), m_file_size(file_size),
155  m_log2align(log2align), m_children(), m_fake(false), m_encrypted(false),
156  m_thread_specific(false), m_readable(false), m_writable(false),
157  m_executable(false), m_relocated(false), m_target_byte_size(target_byte_size) {
158  // printf ("Section::Section(%p): module=%p, sect_id = 0x%16.16" PRIx64 ",
159  // addr=[0x%16.16" PRIx64 " - 0x%16.16" PRIx64 "), file [0x%16.16" PRIx64 "
160  // - 0x%16.16" PRIx64 "), flags = 0x%8.8x, name = %s\n",
161  // this, module_sp.get(), sect_id, file_addr, file_addr +
162  // byte_size, file_offset, file_offset + file_size, flags,
163  // name.GetCString());
164 }
165 
166 Section::Section(const lldb::SectionSP &parent_section_sp,
167  const ModuleSP &module_sp, ObjectFile *obj_file,
168  user_id_t sect_id, ConstString name,
169  SectionType sect_type, addr_t file_addr, addr_t byte_size,
170  lldb::offset_t file_offset, lldb::offset_t file_size,
171  uint32_t log2align, uint32_t flags,
172  uint32_t target_byte_size /*=1*/)
173  : ModuleChild(module_sp), UserID(sect_id), Flags(flags),
174  m_obj_file(obj_file), m_type(sect_type), m_parent_wp(), m_name(name),
175  m_file_addr(file_addr), m_byte_size(byte_size),
176  m_file_offset(file_offset), m_file_size(file_size),
177  m_log2align(log2align), m_children(), m_fake(false), m_encrypted(false),
178  m_thread_specific(false), m_readable(false), m_writable(false),
179  m_executable(false), m_relocated(false), m_target_byte_size(target_byte_size) {
180  // printf ("Section::Section(%p): module=%p, sect_id = 0x%16.16" PRIx64 ",
181  // addr=[0x%16.16" PRIx64 " - 0x%16.16" PRIx64 "), file [0x%16.16" PRIx64 "
182  // - 0x%16.16" PRIx64 "), flags = 0x%8.8x, name = %s.%s\n",
183  // this, module_sp.get(), sect_id, file_addr, file_addr +
184  // byte_size, file_offset, file_offset + file_size, flags,
185  // parent_section_sp->GetName().GetCString(), name.GetCString());
186  if (parent_section_sp)
187  m_parent_wp = parent_section_sp;
188 }
189 
191  // printf ("Section::~Section(%p)\n", this);
192 }
193 
195  SectionSP parent_sp(GetParent());
196  if (parent_sp) {
197  // This section has a parent which means m_file_addr is an offset into the
198  // parent section, so the file address for this section is the file address
199  // of the parent plus the offset
200  return parent_sp->GetFileAddress() + m_file_addr;
201  }
202  // This section has no parent, so m_file_addr is the file base address
203  return m_file_addr;
204 }
205 
207  SectionSP parent_sp(GetParent());
208  if (parent_sp) {
209  if (m_file_addr >= file_addr)
210  return parent_sp->SetFileAddress(m_file_addr - file_addr);
211  return false;
212  } else {
213  // This section has no parent, so m_file_addr is the file base address
214  m_file_addr = file_addr;
215  return true;
216  }
217 }
218 
220  // This section has a parent which means m_file_addr is an offset.
221  SectionSP parent_sp(GetParent());
222  if (parent_sp)
223  return m_file_addr;
224 
225  // This section has no parent, so there is no offset to be had
226  return 0;
227 }
228 
230  addr_t load_base_addr = LLDB_INVALID_ADDRESS;
231  SectionSP parent_sp(GetParent());
232  if (parent_sp) {
233  load_base_addr = parent_sp->GetLoadBaseAddress(target);
234  if (load_base_addr != LLDB_INVALID_ADDRESS)
235  load_base_addr += GetOffset();
236  }
237  if (load_base_addr == LLDB_INVALID_ADDRESS) {
238  load_base_addr = target->GetSectionLoadList().GetSectionLoadAddress(
239  const_cast<Section *>(this)->shared_from_this());
240  }
241  return load_base_addr;
242 }
243 
245  bool allow_section_end) const {
246  const size_t num_children = m_children.GetSize();
247  for (size_t i = 0; i < num_children; i++) {
248  Section *child_section = m_children.GetSectionAtIndex(i).get();
249 
250  addr_t child_offset = child_section->GetOffset();
251  if (child_offset <= offset &&
252  offset - child_offset <
253  child_section->GetByteSize() + (allow_section_end ? 1 : 0))
254  return child_section->ResolveContainedAddress(offset - child_offset,
255  so_addr, allow_section_end);
256  }
257  so_addr.SetOffset(offset);
258  so_addr.SetSection(const_cast<Section *>(this)->shared_from_this());
259 
260 #ifdef LLDB_CONFIGURATION_DEBUG
261  // For debug builds, ensure that there are no orphaned (i.e., moduleless)
262  // sections.
263  assert(GetModule().get());
264 #endif
265  return true;
266 }
267 
269  const addr_t file_addr = GetFileAddress();
270  if (file_addr != LLDB_INVALID_ADDRESS) {
271  if (file_addr <= vm_addr) {
272  const addr_t offset = (vm_addr - file_addr) * m_target_byte_size;
273  return offset < GetByteSize();
274  }
275  }
276  return false;
277 }
278 
279 int Section::Compare(const Section &a, const Section &b) {
280  if (&a == &b)
281  return 0;
282 
283  const ModuleSP a_module_sp = a.GetModule();
284  const ModuleSP b_module_sp = b.GetModule();
285  if (a_module_sp == b_module_sp) {
286  user_id_t a_sect_uid = a.GetID();
287  user_id_t b_sect_uid = b.GetID();
288  if (a_sect_uid < b_sect_uid)
289  return -1;
290  if (a_sect_uid > b_sect_uid)
291  return 1;
292  return 0;
293  } else {
294  // The modules are different, just compare the module pointers
295  if (a_module_sp.get() < b_module_sp.get())
296  return -1;
297  else
298  return 1; // We already know the modules aren't equal
299  }
300 }
301 
302 void Section::Dump(Stream *s, Target *target, uint32_t depth) const {
303  // s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
304  s->Indent();
305  s->Printf("0x%8.8" PRIx64 " %-16s ", GetID(), GetTypeAsCString());
306  bool resolved = true;
308 
309  if (GetByteSize() == 0)
310  s->Printf("%39s", "");
311  else {
312  if (target)
313  addr = GetLoadBaseAddress(target);
314 
315  if (addr == LLDB_INVALID_ADDRESS) {
316  if (target)
317  resolved = false;
318  addr = GetFileAddress();
319  }
320 
321  VMRange range(addr, addr + m_byte_size);
322  range.Dump(s, 0);
323  }
324 
325  s->Printf("%c %c%c%c 0x%8.8" PRIx64 " 0x%8.8" PRIx64 " 0x%8.8x ",
326  resolved ? ' ' : '*', m_readable ? 'r' : '-',
327  m_writable ? 'w' : '-', m_executable ? 'x' : '-', m_file_offset,
328  m_file_size, Get());
329 
330  DumpName(s);
331 
332  s->EOL();
333 
334  if (depth > 0)
335  m_children.Dump(s, target, false, depth - 1);
336 }
337 
338 void Section::DumpName(Stream *s) const {
339  SectionSP parent_sp(GetParent());
340  if (parent_sp) {
341  parent_sp->DumpName(s);
342  s->PutChar('.');
343  } else {
344  // The top most section prints the module basename
345  const char *name = NULL;
346  ModuleSP module_sp(GetModule());
347 
348  if (m_obj_file) {
349  const FileSpec &file_spec = m_obj_file->GetFileSpec();
350  name = file_spec.GetFilename().AsCString();
351  }
352  if ((!name || !name[0]) && module_sp)
353  name = module_sp->GetFileSpec().GetFilename().AsCString();
354  if (name && name[0])
355  s->Printf("%s.", name);
356  }
357  m_name.Dump(s);
358 }
359 
360 bool Section::IsDescendant(const Section *section) {
361  if (this == section)
362  return true;
363  SectionSP parent_sp(GetParent());
364  if (parent_sp)
365  return parent_sp->IsDescendant(section);
366  return false;
367 }
368 
369 bool Section::Slide(addr_t slide_amount, bool slide_children) {
370  if (m_file_addr != LLDB_INVALID_ADDRESS) {
371  if (slide_amount == 0)
372  return true;
373 
374  m_file_addr += slide_amount;
375 
376  if (slide_children)
377  m_children.Slide(slide_amount, slide_children);
378 
379  return true;
380  }
381  return false;
382 }
383 
384 /// Get the permissions as OR'ed bits from lldb::Permissions
386  uint32_t permissions = 0;
387  if (m_readable)
388  permissions |= ePermissionsReadable;
389  if (m_writable)
390  permissions |= ePermissionsWritable;
391  if (m_executable)
392  permissions |= ePermissionsExecutable;
393  return permissions;
394 }
395 
396 /// Set the permissions using bits OR'ed from lldb::Permissions
398  m_readable = (permissions & ePermissionsReadable) != 0;
399  m_writable = (permissions & ePermissionsWritable) != 0;
400  m_executable = (permissions & ePermissionsExecutable) != 0;
401 }
402 
404  lldb::offset_t offset) {
405  if (m_obj_file)
406  return m_obj_file->ReadSectionData(this, offset, dst, dst_len);
407  return 0;
408 }
409 
411  if (m_obj_file)
412  return m_obj_file->ReadSectionData(this, section_data);
413  return 0;
414 }
415 
416 #pragma mark SectionList
417 
418 SectionList::SectionList() : m_sections() {}
419 
421 
423  if (this != &rhs)
424  m_sections = rhs.m_sections;
425  return *this;
426 }
427 
428 size_t SectionList::AddSection(const lldb::SectionSP &section_sp) {
429  if (section_sp) {
430  size_t section_index = m_sections.size();
431  m_sections.push_back(section_sp);
432  return section_index;
433  }
434 
435  return std::numeric_limits<size_t>::max();
436 }
437 
438 // Warning, this can be slow as it's removing items from a std::vector.
439 bool SectionList::DeleteSection(size_t idx) {
440  if (idx < m_sections.size()) {
441  m_sections.erase(m_sections.begin() + idx);
442  return true;
443  }
444  return false;
445 }
446 
448  iterator sect_iter;
449  iterator begin = m_sections.begin();
450  iterator end = m_sections.end();
451  for (sect_iter = begin; sect_iter != end; ++sect_iter) {
452  if (sect_iter->get() == sect) {
453  // The secton was already in this section list
454  return std::distance(begin, sect_iter);
455  }
456  }
457  return UINT32_MAX;
458 }
459 
460 size_t SectionList::AddUniqueSection(const lldb::SectionSP &sect_sp) {
461  size_t sect_idx = FindSectionIndex(sect_sp.get());
462  if (sect_idx == UINT32_MAX) {
463  sect_idx = AddSection(sect_sp);
464  }
465  return sect_idx;
466 }
467 
469  const lldb::SectionSP &sect_sp,
470  uint32_t depth) {
471  iterator sect_iter, end = m_sections.end();
472  for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
473  if ((*sect_iter)->GetID() == sect_id) {
474  *sect_iter = sect_sp;
475  return true;
476  } else if (depth > 0) {
477  if ((*sect_iter)
478  ->GetChildren()
479  .ReplaceSection(sect_id, sect_sp, depth - 1))
480  return true;
481  }
482  }
483  return false;
484 }
485 
487  size_t count = m_sections.size();
488  if (depth > 0) {
489  const_iterator sect_iter, end = m_sections.end();
490  for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
491  count += (*sect_iter)->GetChildren().GetNumSections(depth - 1);
492  }
493  }
494  return count;
495 }
496 
497 SectionSP SectionList::GetSectionAtIndex(size_t idx) const {
498  SectionSP sect_sp;
499  if (idx < m_sections.size())
500  sect_sp = m_sections[idx];
501  return sect_sp;
502 }
503 
504 SectionSP
506  SectionSP sect_sp;
507  // Check if we have a valid section string
508  if (section_dstr && !m_sections.empty()) {
509  const_iterator sect_iter;
510  const_iterator end = m_sections.end();
511  for (sect_iter = m_sections.begin();
512  sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
513  Section *child_section = sect_iter->get();
514  if (child_section) {
515  if (child_section->GetName() == section_dstr) {
516  sect_sp = *sect_iter;
517  } else {
518  sect_sp =
519  child_section->GetChildren().FindSectionByName(section_dstr);
520  }
521  }
522  }
523  }
524  return sect_sp;
525 }
526 
527 SectionSP SectionList::FindSectionByID(user_id_t sect_id) const {
528  SectionSP sect_sp;
529  if (sect_id) {
530  const_iterator sect_iter;
531  const_iterator end = m_sections.end();
532  for (sect_iter = m_sections.begin();
533  sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
534  if ((*sect_iter)->GetID() == sect_id) {
535  sect_sp = *sect_iter;
536  break;
537  } else {
538  sect_sp = (*sect_iter)->GetChildren().FindSectionByID(sect_id);
539  }
540  }
541  }
542  return sect_sp;
543 }
544 
546  bool check_children,
547  size_t start_idx) const {
548  SectionSP sect_sp;
549  size_t num_sections = m_sections.size();
550  for (size_t idx = start_idx; idx < num_sections; ++idx) {
551  if (m_sections[idx]->GetType() == sect_type) {
552  sect_sp = m_sections[idx];
553  break;
554  } else if (check_children) {
555  sect_sp = m_sections[idx]->GetChildren().FindSectionByType(
556  sect_type, check_children, 0);
557  if (sect_sp)
558  break;
559  }
560  }
561  return sect_sp;
562 }
563 
565  uint32_t depth) const {
566  SectionSP sect_sp;
567  const_iterator sect_iter;
568  const_iterator end = m_sections.end();
569  for (sect_iter = m_sections.begin();
570  sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
571  Section *sect = sect_iter->get();
572  if (sect->ContainsFileAddress(vm_addr)) {
573  // The file address is in this section. We need to make sure one of our
574  // child sections doesn't contain this address as well as obeying the
575  // depth limit that was passed in.
576  if (depth > 0)
578  vm_addr, depth - 1);
579 
580  if (sect_sp.get() == NULL && !sect->IsFake())
581  sect_sp = *sect_iter;
582  }
583  }
584  return sect_sp;
585 }
586 
588  return FindSectionByID(sect_id).get() != NULL;
589 }
590 
591 void SectionList::Dump(Stream *s, Target *target, bool show_header,
592  uint32_t depth) const {
593  bool target_has_loaded_sections =
594  target && !target->GetSectionLoadList().IsEmpty();
595  if (show_header && !m_sections.empty()) {
596  s->Indent();
597  s->Printf("SectID Type %s Address "
598  " Perm File Off. File Size Flags "
599  " Section Name\n",
600  target_has_loaded_sections ? "Load" : "File");
601  s->Indent();
602  s->PutCString("---------- ---------------- "
603  "--------------------------------------- ---- ---------- "
604  "---------- "
605  "---------- ----------------------------\n");
606  }
607 
608  const_iterator sect_iter;
609  const_iterator end = m_sections.end();
610  for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
611  (*sect_iter)->Dump(s, target_has_loaded_sections ? target : NULL, depth);
612  }
613 
614  if (show_header && !m_sections.empty())
615  s->IndentLess();
616 }
617 
618 size_t SectionList::Slide(addr_t slide_amount, bool slide_children) {
619  size_t count = 0;
620  const_iterator pos, end = m_sections.end();
621  for (pos = m_sections.begin(); pos != end; ++pos) {
622  if ((*pos)->Slide(slide_amount, slide_children))
623  ++count;
624  }
625  return count;
626 }
bool ReplaceSection(lldb::user_id_t sect_id, const lldb::SectionSP &section_sp, uint32_t depth=UINT32_MAX)
Definition: Section.cpp:468
ConstString & GetFilename()
Filename string get accessor.
Definition: FileSpec.cpp:369
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:61
An data extractor class.
Definition: DataExtractor.h:47
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:224
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
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:403
bool ContainsFileAddress(lldb::addr_t vm_addr) const
Definition: Section.cpp:268
void SetSection(const lldb::SectionSP &section_sp)
Set accessor for the section.
Definition: Address.h:444
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:49
lldb::addr_t GetLoadBaseAddress(Target *target) const
Definition: Section.cpp:229
A mix in class that contains a generic user ID.
Definition: UserID.h:33
A file utility class.
Definition: FileSpec.h:55
bool ContainsSection(lldb::user_id_t sect_id) const
Definition: Section.cpp:587
A plug-in interface definition class for object file parsers.
Definition: ObjectFile.h:58
bool SetFileAddress(lldb::addr_t file_addr)
Definition: Section.cpp:206
collection::const_iterator const_iterator
Definition: Section.h:52
bool IsFake() const
Definition: Section.h:168
void Dump(Stream *s, Target *target, uint32_t depth) const
Definition: Section.cpp:302
lldb::SectionSP FindSectionByType(lldb::SectionType sect_type, bool check_children, size_t start_idx=0) const
Definition: Section.cpp:545
lldb::SectionSP FindSectionContainingFileAddress(lldb::addr_t addr, uint32_t depth=UINT32_MAX) const
Definition: Section.cpp:564
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
Definition: Address.h:419
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
Definition: ModuleChild.cpp:27
lldb::addr_t GetFileAddress() const
Definition: Section.cpp:194
static int Compare(const Section &a, const Section &b)
Definition: Section.cpp:279
#define UINT32_MAX
Definition: lldb-defines.h:31
collection::iterator iterator
Definition: Section.h:51
#define LLDB_INVALID_ADDRESS
Invalid value definitions.
Definition: lldb-defines.h:85
uint64_t user_id_t
Definition: lldb-types.h:84
bool IsDescendant(const Section *section)
Definition: Section.cpp:360
uint64_t offset_t
Definition: lldb-types.h:87
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:127
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1012
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
Definition: Section.cpp:505
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp) const
lldb::SectionSP FindSectionByID(lldb::user_id_t sect_id) const
Definition: Section.cpp:527
lldb::addr_t GetByteSize() const
Definition: Section.h:164
lldb::SectionSP GetSectionAtIndex(size_t idx) const
Definition: Section.cpp:497
void IndentLess(int amount=2)
Decrement the current indentation level.
Definition: Stream.cpp:221
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:106
size_t AddUniqueSection(const lldb::SectionSP &section_sp)
Definition: Section.cpp:460
A section + offset based address class.
Definition: Address.h:80
uint32_t GetPermissions() const
Get the permissions as OR&#39;ed bits from lldb::Permissions.
Definition: Section.cpp:385
size_t PutChar(char ch)
Definition: Stream.cpp:103
A class to manage flags.
Definition: Flags.h:22
ConstString GetName() const
Definition: Section.h:178
uint64_t addr_t
Definition: lldb-types.h:83
size_t GetNumSections(uint32_t depth) const
Definition: Section.cpp:486
A uniqued constant string class.
Definition: ConstString.h:38
void DumpName(Stream *s) const
Definition: Section.cpp:338
const char * GetTypeAsCString() const
Definition: Section.cpp:29
Definition: SBAddress.h:15
size_t Indent(const char *s=nullptr)
Indent the current line in the stream.
Definition: Stream.cpp:131
size_t AddSection(const lldb::SectionSP &section_sp)
Definition: Section.cpp:428
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)
void SetPermissions(uint32_t permissions)
Set the permissions using bits OR&#39;ed from lldb::Permissions.
Definition: Section.cpp:397
SectionList & GetChildren()
Definition: Section.h:135
bool Slide(lldb::addr_t slide_amount, bool slide_children)
Definition: Section.cpp:369
A mix in class that contains a pointer back to the module that owns the object which inherits from it...
Definition: ModuleChild.h:19
size_t FindSectionIndex(const Section *sect)
Definition: Section.cpp:447
SectionList & operator=(const SectionList &rhs)
Definition: Section.cpp:422
bool DeleteSection(size_t idx)
Definition: Section.cpp:439
size_t Slide(lldb::addr_t slide_amount, bool slide_children)
Definition: Section.cpp:618
bool ResolveContainedAddress(lldb::addr_t offset, Address &so_addr, bool allow_section_end=false) const
Definition: Section.cpp:244
void Dump(Stream *s, lldb::addr_t base_addr=0, uint32_t addr_width=8) const
Definition: VMRange.cpp:38
void Dump(Stream *s, Target *target, bool show_header, uint32_t depth) const
Definition: Section.cpp:591
lldb::addr_t GetOffset() const
Definition: Section.cpp:219