LLDB  mainline
ObjectFile.cpp
Go to the documentation of this file.
1 //===-- ObjectFile.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 
10 #include "lldb/Core/Module.h"
11 #include "lldb/Core/ModuleSpec.h"
13 #include "lldb/Core/Section.h"
16 #include "lldb/Symbol/SymbolFile.h"
17 #include "lldb/Target/Process.h"
19 #include "lldb/Target/Target.h"
22 #include "lldb/Utility/LLDBLog.h"
23 #include "lldb/Utility/Log.h"
24 #include "lldb/Utility/Timer.h"
25 #include "lldb/lldb-private.h"
26 
27 #include "llvm/Support/DJB.h"
28 
29 using namespace lldb;
30 using namespace lldb_private;
31 
32 char ObjectFile::ID;
33 size_t ObjectFile::g_initial_bytes_to_read = 512;
34 
35 static ObjectFileSP
36 CreateObjectFromContainer(const lldb::ModuleSP &module_sp, const FileSpec *file,
37  lldb::offset_t file_offset, lldb::offset_t file_size,
38  DataBufferSP data_sp, lldb::offset_t &data_offset) {
40  for (uint32_t idx = 0;
41  (callback = PluginManager::GetObjectContainerCreateCallbackAtIndex(
42  idx)) != nullptr;
43  ++idx) {
44  std::unique_ptr<ObjectContainer> object_container_up(callback(
45  module_sp, data_sp, data_offset, file, file_offset, file_size));
46  if (object_container_up)
47  return object_container_up->GetObjectFile(file);
48  }
49  return {};
50 }
51 
52 ObjectFileSP
53 ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
54  lldb::offset_t file_offset, lldb::offset_t file_size,
55  DataBufferSP &data_sp, lldb::offset_t &data_offset) {
57  "ObjectFile::FindPlugin (module = %s, file = %p, file_offset = "
58  "0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
59  module_sp->GetFileSpec().GetPath().c_str(),
60  static_cast<const void *>(file), static_cast<uint64_t>(file_offset),
61  static_cast<uint64_t>(file_size));
62 
63  if (!module_sp)
64  return {};
65 
66  if (!file)
67  return {};
68 
69  if (!data_sp) {
70  const bool file_exists = FileSystem::Instance().Exists(*file);
71  // We have an object name which most likely means we have a .o file in
72  // a static archive (.a file). Try and see if we have a cached archive
73  // first without reading any data first
74  if (file_exists && module_sp->GetObjectName()) {
75  ObjectFileSP object_file_sp = CreateObjectFromContainer(
76  module_sp, file, file_offset, file_size, data_sp, data_offset);
77  if (object_file_sp)
78  return object_file_sp;
79  }
80  // Ok, we didn't find any containers that have a named object, now lets
81  // read the first 512 bytes from the file so the object file and object
82  // container plug-ins can use these bytes to see if they can parse this
83  // file.
84  if (file_size > 0) {
85  data_sp = FileSystem::Instance().CreateDataBuffer(
86  file->GetPath(), g_initial_bytes_to_read, file_offset);
87  data_offset = 0;
88  }
89  }
90 
91  if (!data_sp || data_sp->GetByteSize() == 0) {
92  // Check for archive file with format "/path/to/archive.a(object.o)"
93  llvm::SmallString<256> path_with_object;
94  module_sp->GetFileSpec().GetPath(path_with_object);
95 
96  FileSpec archive_file;
97  ConstString archive_object;
98  const bool must_exist = true;
99  if (ObjectFile::SplitArchivePathWithObject(path_with_object, archive_file,
100  archive_object, must_exist)) {
101  file_size = FileSystem::Instance().GetByteSize(archive_file);
102  if (file_size > 0) {
103  file = &archive_file;
104  module_sp->SetFileSpecAndObjectName(archive_file, archive_object);
105  // Check if this is a object container by iterating through all
106  // object container plugin instances and then trying to get an
107  // object file from the container plugins since we had a name.
108  // Also, don't read
109  // ANY data in case there is data cached in the container plug-ins
110  // (like BSD archives caching the contained objects within an
111  // file).
112  ObjectFileSP object_file_sp = CreateObjectFromContainer(
113  module_sp, file, file_offset, file_size, data_sp, data_offset);
114  if (object_file_sp)
115  return object_file_sp;
116  // We failed to find any cached object files in the container plug-
117  // ins, so lets read the first 512 bytes and try again below...
118  data_sp = FileSystem::Instance().CreateDataBuffer(
119  archive_file.GetPath(), g_initial_bytes_to_read, file_offset);
120  }
121  }
122  }
123 
124  if (data_sp && data_sp->GetByteSize() > 0) {
125  // Check if this is a normal object file by iterating through all
126  // object file plugin instances.
127  ObjectFileCreateInstance callback;
128  for (uint32_t idx = 0;
129  (callback = PluginManager::GetObjectFileCreateCallbackAtIndex(idx)) !=
130  nullptr;
131  ++idx) {
132  ObjectFileSP object_file_sp(callback(module_sp, data_sp, data_offset,
133  file, file_offset, file_size));
134  if (object_file_sp.get())
135  return object_file_sp;
136  }
137 
138  // Check if this is a object container by iterating through all object
139  // container plugin instances and then trying to get an object file
140  // from the container.
141  ObjectFileSP object_file_sp = CreateObjectFromContainer(
142  module_sp, file, file_offset, file_size, data_sp, data_offset);
143  if (object_file_sp)
144  return object_file_sp;
145  }
146 
147  // We didn't find it, so clear our shared pointer in case it contains
148  // anything and return an empty shared pointer
149  return {};
150 }
151 
152 ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
153  const ProcessSP &process_sp,
154  lldb::addr_t header_addr,
155  WritableDataBufferSP data_sp) {
156  ObjectFileSP object_file_sp;
157 
158  if (module_sp) {
159  LLDB_SCOPED_TIMERF("ObjectFile::FindPlugin (module = "
160  "%s, process = %p, header_addr = "
161  "0x%" PRIx64 ")",
162  module_sp->GetFileSpec().GetPath().c_str(),
163  static_cast<void *>(process_sp.get()), header_addr);
164  uint32_t idx;
165 
166  // Check if this is a normal object file by iterating through all object
167  // file plugin instances.
168  ObjectFileCreateMemoryInstance create_callback;
169  for (idx = 0;
170  (create_callback =
171  PluginManager::GetObjectFileCreateMemoryCallbackAtIndex(idx)) !=
172  nullptr;
173  ++idx) {
174  object_file_sp.reset(
175  create_callback(module_sp, data_sp, process_sp, header_addr));
176  if (object_file_sp.get())
177  return object_file_sp;
178  }
179  }
180 
181  // We didn't find it, so clear our shared pointer in case it contains
182  // anything and return an empty shared pointer
183  object_file_sp.reset();
184  return object_file_sp;
185 }
186 
187 size_t ObjectFile::GetModuleSpecifications(const FileSpec &file,
188  lldb::offset_t file_offset,
189  lldb::offset_t file_size,
190  ModuleSpecList &specs,
191  DataBufferSP data_sp) {
192  if (!data_sp)
193  data_sp = FileSystem::Instance().CreateDataBuffer(
194  file.GetPath(), g_initial_bytes_to_read, file_offset);
195  if (data_sp) {
196  if (file_size == 0) {
197  const lldb::offset_t actual_file_size =
198  FileSystem::Instance().GetByteSize(file);
199  if (actual_file_size > file_offset)
200  file_size = actual_file_size - file_offset;
201  }
202  return ObjectFile::GetModuleSpecifications(file, // file spec
203  data_sp, // data bytes
204  0, // data offset
205  file_offset, // file offset
206  file_size, // file length
207  specs);
208  }
209  return 0;
210 }
211 
212 size_t ObjectFile::GetModuleSpecifications(
213  const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp,
214  lldb::offset_t data_offset, lldb::offset_t file_offset,
215  lldb::offset_t file_size, lldb_private::ModuleSpecList &specs) {
216  const size_t initial_count = specs.GetSize();
217  ObjectFileGetModuleSpecifications callback;
218  uint32_t i;
219  // Try the ObjectFile plug-ins
220  for (i = 0;
221  (callback =
222  PluginManager::GetObjectFileGetModuleSpecificationsCallbackAtIndex(
223  i)) != nullptr;
224  ++i) {
225  if (callback(file, data_sp, data_offset, file_offset, file_size, specs) > 0)
226  return specs.GetSize() - initial_count;
227  }
228 
229  // Try the ObjectContainer plug-ins
230  for (i = 0;
231  (callback = PluginManager::
232  GetObjectContainerGetModuleSpecificationsCallbackAtIndex(i)) !=
233  nullptr;
234  ++i) {
235  if (callback(file, data_sp, data_offset, file_offset, file_size, specs) > 0)
236  return specs.GetSize() - initial_count;
237  }
238  return 0;
239 }
240 
241 ObjectFile::ObjectFile(const lldb::ModuleSP &module_sp,
242  const FileSpec *file_spec_ptr,
243  lldb::offset_t file_offset, lldb::offset_t length,
244  lldb::DataBufferSP data_sp, lldb::offset_t data_offset)
245  : ModuleChild(module_sp),
246  m_file(), // This file could be different from the original module's file
247  m_type(eTypeInvalid), m_strata(eStrataInvalid),
248  m_file_offset(file_offset), m_length(length), m_data(), m_process_wp(),
249  m_memory_addr(LLDB_INVALID_ADDRESS), m_sections_up(), m_symtab_up(),
250  m_symtab_once_up(new llvm::once_flag()) {
251  if (file_spec_ptr)
252  m_file = *file_spec_ptr;
253  if (data_sp)
254  m_data.SetData(data_sp, data_offset, length);
255  Log *log = GetLog(LLDBLog::Object);
256  LLDB_LOGF(log,
257  "%p ObjectFile::ObjectFile() module = %p (%s), file = %s, "
258  "file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64,
259  static_cast<void *>(this), static_cast<void *>(module_sp.get()),
260  module_sp->GetSpecificationDescription().c_str(),
261  m_file ? m_file.GetPath().c_str() : "<NULL>", m_file_offset,
262  m_length);
263 }
264 
265 ObjectFile::ObjectFile(const lldb::ModuleSP &module_sp,
266  const ProcessSP &process_sp, lldb::addr_t header_addr,
267  DataBufferSP header_data_sp)
268  : ModuleChild(module_sp), m_file(), m_type(eTypeInvalid),
269  m_strata(eStrataInvalid), m_file_offset(0), m_length(0), m_data(),
270  m_process_wp(process_sp), m_memory_addr(header_addr), m_sections_up(),
271  m_symtab_up(), m_symtab_once_up(new llvm::once_flag()) {
272  if (header_data_sp)
273  m_data.SetData(header_data_sp, 0, header_data_sp->GetByteSize());
274  Log *log = GetLog(LLDBLog::Object);
275  LLDB_LOGF(log,
276  "%p ObjectFile::ObjectFile() module = %p (%s), process = %p, "
277  "header_addr = 0x%" PRIx64,
278  static_cast<void *>(this), static_cast<void *>(module_sp.get()),
279  module_sp->GetSpecificationDescription().c_str(),
280  static_cast<void *>(process_sp.get()), m_memory_addr);
281 }
282 
284  Log *log = GetLog(LLDBLog::Object);
285  LLDB_LOGF(log, "%p ObjectFile::~ObjectFile ()\n", static_cast<void *>(this));
286 }
287 
289  ModuleSP module_sp(GetModule());
290  if (module_sp)
291  return module_sp->SetArchitecture(new_arch);
292  return false;
293 }
294 
296  Symtab *symtab = GetSymtab();
297  if (symtab) {
298  Symbol *symbol = symtab->FindSymbolContainingFileAddress(file_addr);
299  if (symbol) {
300  if (symbol->ValueIsAddress()) {
301  const SectionSP section_sp(symbol->GetAddressRef().GetSection());
302  if (section_sp) {
303  const SectionType section_type = section_sp->GetType();
304  switch (section_type) {
305  case eSectionTypeInvalid:
306  return AddressClass::eUnknown;
307  case eSectionTypeCode:
308  return AddressClass::eCode;
310  return AddressClass::eUnknown;
311  case eSectionTypeData:
315  case eSectionTypeData4:
316  case eSectionTypeData8:
317  case eSectionTypeData16:
323  return AddressClass::eData;
324  case eSectionTypeDebug:
359  return AddressClass::eDebug;
360  case eSectionTypeEHFrame:
364  return AddressClass::eRuntime;
369  case eSectionTypeOther:
370  return AddressClass::eUnknown;
372  // In case of absolute sections decide the address class based on
373  // the symbol type because the section type isn't specify if it is
374  // a code or a data section.
375  break;
376  }
377  }
378  }
379 
380  const SymbolType symbol_type = symbol->GetType();
381  switch (symbol_type) {
382  case eSymbolTypeAny:
383  return AddressClass::eUnknown;
384  case eSymbolTypeAbsolute:
385  return AddressClass::eUnknown;
386  case eSymbolTypeCode:
387  return AddressClass::eCode;
389  return AddressClass::eCode;
390  case eSymbolTypeResolver:
391  return AddressClass::eCode;
392  case eSymbolTypeData:
393  return AddressClass::eData;
394  case eSymbolTypeRuntime:
395  return AddressClass::eRuntime;
397  return AddressClass::eRuntime;
399  return AddressClass::eDebug;
401  return AddressClass::eDebug;
403  return AddressClass::eDebug;
405  return AddressClass::eDebug;
406  case eSymbolTypeBlock:
407  return AddressClass::eDebug;
408  case eSymbolTypeLocal:
409  return AddressClass::eData;
410  case eSymbolTypeParam:
411  return AddressClass::eData;
412  case eSymbolTypeVariable:
413  return AddressClass::eData;
415  return AddressClass::eDebug;
417  return AddressClass::eDebug;
419  return AddressClass::eDebug;
421  return AddressClass::eDebug;
422  case eSymbolTypeScopeEnd:
423  return AddressClass::eDebug;
425  return AddressClass::eUnknown;
426  case eSymbolTypeCompiler:
427  return AddressClass::eDebug;
429  return AddressClass::eDebug;
431  return AddressClass::eUnknown;
433  return AddressClass::eRuntime;
435  return AddressClass::eRuntime;
436  case eSymbolTypeObjCIVar:
437  return AddressClass::eRuntime;
439  return AddressClass::eRuntime;
440  }
441  }
442  }
443  return AddressClass::eUnknown;
444 }
445 
446 DataBufferSP ObjectFile::ReadMemory(const ProcessSP &process_sp,
447  lldb::addr_t addr, size_t byte_size) {
448  DataBufferSP data_sp;
449  if (process_sp) {
450  std::unique_ptr<DataBufferHeap> data_up(new DataBufferHeap(byte_size, 0));
451  Status error;
452  const size_t bytes_read = process_sp->ReadMemory(
453  addr, data_up->GetBytes(), data_up->GetByteSize(), error);
454  if (bytes_read == byte_size)
455  data_sp.reset(data_up.release());
456  }
457  return data_sp;
458 }
459 
460 size_t ObjectFile::GetData(lldb::offset_t offset, size_t length,
461  DataExtractor &data) const {
462  // The entire file has already been mmap'ed into m_data, so just copy from
463  // there as the back mmap buffer will be shared with shared pointers.
464  return data.SetData(m_data, offset, length);
465 }
466 
467 size_t ObjectFile::CopyData(lldb::offset_t offset, size_t length,
468  void *dst) const {
469  // The entire file has already been mmap'ed into m_data, so just copy from
470  // there Note that the data remains in target byte order.
471  return m_data.CopyData(offset, length, dst);
472 }
473 
475  lldb::offset_t section_offset, void *dst,
476  size_t dst_len) {
477  assert(section);
478  section_offset *= section->GetTargetByteSize();
479 
480  // If some other objectfile owns this data, pass this to them.
481  if (section->GetObjectFile() != this)
482  return section->GetObjectFile()->ReadSectionData(section, section_offset,
483  dst, dst_len);
484 
485  if (!section->IsRelocated())
486  RelocateSection(section);
487 
488  if (IsInMemory()) {
489  ProcessSP process_sp(m_process_wp.lock());
490  if (process_sp) {
491  Status error;
492  const addr_t base_load_addr =
493  section->GetLoadBaseAddress(&process_sp->GetTarget());
494  if (base_load_addr != LLDB_INVALID_ADDRESS)
495  return process_sp->ReadMemory(base_load_addr + section_offset, dst,
496  dst_len, error);
497  }
498  } else {
499  const lldb::offset_t section_file_size = section->GetFileSize();
500  if (section_offset < section_file_size) {
501  const size_t section_bytes_left = section_file_size - section_offset;
502  size_t section_dst_len = dst_len;
503  if (section_dst_len > section_bytes_left)
504  section_dst_len = section_bytes_left;
505  return CopyData(section->GetFileOffset() + section_offset,
506  section_dst_len, dst);
507  } else {
508  if (section->GetType() == eSectionTypeZeroFill) {
509  const uint64_t section_size = section->GetByteSize();
510  const uint64_t section_bytes_left = section_size - section_offset;
511  uint64_t section_dst_len = dst_len;
512  if (section_dst_len > section_bytes_left)
513  section_dst_len = section_bytes_left;
514  memset(dst, 0, section_dst_len);
515  return section_dst_len;
516  }
517  }
518  }
519  return 0;
520 }
521 
522 // Get the section data the file on disk
524  DataExtractor &section_data) {
525  // If some other objectfile owns this data, pass this to them.
526  if (section->GetObjectFile() != this)
527  return section->GetObjectFile()->ReadSectionData(section, section_data);
528 
529  if (!section->IsRelocated())
530  RelocateSection(section);
531 
532  if (IsInMemory()) {
533  ProcessSP process_sp(m_process_wp.lock());
534  if (process_sp) {
535  const addr_t base_load_addr =
536  section->GetLoadBaseAddress(&process_sp->GetTarget());
537  if (base_load_addr != LLDB_INVALID_ADDRESS) {
538  DataBufferSP data_sp(
539  ReadMemory(process_sp, base_load_addr, section->GetByteSize()));
540  if (data_sp) {
541  section_data.SetData(data_sp, 0, data_sp->GetByteSize());
542  section_data.SetByteOrder(process_sp->GetByteOrder());
543  section_data.SetAddressByteSize(process_sp->GetAddressByteSize());
544  return section_data.GetByteSize();
545  }
546  }
547  }
548  }
549 
550  // The object file now contains a full mmap'ed copy of the object file
551  // data, so just use this
552  return GetData(section->GetFileOffset(), section->GetFileSize(),
553  section_data);
554 }
555 
556 bool ObjectFile::SplitArchivePathWithObject(llvm::StringRef path_with_object,
557  FileSpec &archive_file,
558  ConstString &archive_object,
559  bool must_exist) {
560  size_t len = path_with_object.size();
561  if (len < 2 || path_with_object.back() != ')')
562  return false;
563  llvm::StringRef archive = path_with_object.substr(0, path_with_object.rfind('('));
564  if (archive.empty())
565  return false;
566  llvm::StringRef object = path_with_object.substr(archive.size() + 1).drop_back();
567  archive_file.SetFile(archive, FileSpec::Style::native);
568  if (must_exist && !FileSystem::Instance().Exists(archive_file))
569  return false;
570  archive_object.SetString(object);
571  return true;
572 }
573 
575  ModuleSP module_sp(GetModule());
576  if (module_sp) {
577  Log *log = GetLog(LLDBLog::Object);
578  LLDB_LOGF(log, "%p ObjectFile::ClearSymtab () symtab = %p",
579  static_cast<void *>(this),
580  static_cast<void *>(m_symtab_up.get()));
581  // Since we need to clear the symbol table, we need a new llvm::once_flag
582  // instance so we can safely create another symbol table
583  m_symtab_once_up.reset(new llvm::once_flag());
584  m_symtab_up.reset();
585  }
586 }
587 
588 SectionList *ObjectFile::GetSectionList(bool update_module_section_list) {
589  if (m_sections_up == nullptr) {
590  if (update_module_section_list) {
591  ModuleSP module_sp(GetModule());
592  if (module_sp) {
593  std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
594  CreateSections(*module_sp->GetUnifiedSectionList());
595  }
596  } else {
597  SectionList unified_section_list;
598  CreateSections(unified_section_list);
599  }
600  }
601  return m_sections_up.get();
602 }
603 
606  lldb::SymbolType symbol_type_hint) {
607  if (!name.empty()) {
608  if (name.startswith("_OBJC_")) {
609  // ObjC
610  if (name.startswith("_OBJC_CLASS_$_"))
612  if (name.startswith("_OBJC_METACLASS_$_"))
614  if (name.startswith("_OBJC_IVAR_$_"))
616  } else if (name.startswith(".objc_class_name_")) {
617  // ObjC v1
619  }
620  }
621  return symbol_type_hint;
622 }
623 
624 std::vector<ObjectFile::LoadableData>
626  std::vector<LoadableData> loadables;
627  SectionList *section_list = GetSectionList();
628  if (!section_list)
629  return loadables;
630  // Create a list of loadable data from loadable sections
631  size_t section_count = section_list->GetNumSections(0);
632  for (size_t i = 0; i < section_count; ++i) {
633  LoadableData loadable;
634  SectionSP section_sp = section_list->GetSectionAtIndex(i);
635  loadable.Dest =
636  target.GetSectionLoadList().GetSectionLoadAddress(section_sp);
637  if (loadable.Dest == LLDB_INVALID_ADDRESS)
638  continue;
639  // We can skip sections like bss
640  if (section_sp->GetFileSize() == 0)
641  continue;
642  DataExtractor section_data;
643  section_sp->GetSectionData(section_data);
644  loadable.Contents = llvm::ArrayRef<uint8_t>(section_data.GetDataStart(),
645  section_data.GetByteSize());
646  loadables.push_back(loadable);
647  }
648  return loadables;
649 }
650 
651 std::unique_ptr<CallFrameInfo> ObjectFile::CreateCallFrameInfo() {
652  return {};
653 }
654 
656 {
657 }
658 
659 DataBufferSP ObjectFile::MapFileData(const FileSpec &file, uint64_t Size,
660  uint64_t Offset) {
661  return FileSystem::Instance().CreateDataBuffer(file.GetPath(), Size, Offset);
662 }
663 
664 void llvm::format_provider<ObjectFile::Type>::format(
665  const ObjectFile::Type &type, raw_ostream &OS, StringRef Style) {
666  switch (type) {
668  OS << "invalid";
669  break;
671  OS << "core file";
672  break;
674  OS << "executable";
675  break;
677  OS << "debug info";
678  break;
680  OS << "dynamic linker";
681  break;
683  OS << "object file";
684  break;
686  OS << "shared library";
687  break;
689  OS << "stub library";
690  break;
692  OS << "jit";
693  break;
695  OS << "unknown";
696  break;
697  }
698 }
699 
700 void llvm::format_provider<ObjectFile::Strata>::format(
701  const ObjectFile::Strata &strata, raw_ostream &OS, StringRef Style) {
702  switch (strata) {
704  OS << "invalid";
705  break;
707  OS << "unknown";
708  break;
710  OS << "user";
711  break;
713  OS << "kernel";
714  break;
716  OS << "raw image";
717  break;
719  OS << "jit";
720  break;
721  }
722 }
723 
724 
726  ModuleSP module_sp(GetModule());
727  if (module_sp) {
728  // We can't take the module lock in ObjectFile::GetSymtab() or we can
729  // deadlock in DWARF indexing when any file asks for the symbol table from
730  // an object file. This currently happens in the preloading of symbols in
731  // SymbolFileDWARF::PreloadSymbols() because the main thread will take the
732  // module lock, and then threads will be spun up to index the DWARF and
733  // any of those threads might end up trying to relocate items in the DWARF
734  // sections which causes ObjectFile::GetSectionData(...) to relocate section
735  // data which requires the symbol table.
736  //
737  // So to work around this, we create the symbol table one time using
738  // llvm::once_flag, lock it, and then set the unique pointer. Any other
739  // thread that gets ahold of the symbol table before parsing is done, will
740  // not be able to access the symbol table contents since all APIs in Symtab
741  // are protected by a mutex in the Symtab object itself.
742  llvm::call_once(*m_symtab_once_up, [&]() {
743  Symtab *symtab = new Symtab(this);
744  std::lock_guard<std::recursive_mutex> symtab_guard(symtab->GetMutex());
745  m_symtab_up.reset(symtab);
746  if (!m_symtab_up->LoadFromCache()) {
747  ElapsedTime elapsed(module_sp->GetSymtabParseTime());
749  m_symtab_up->Finalize();
750  }
751  });
752  }
753  return m_symtab_up.get();
754 }
755 
757  if (m_cache_hash)
758  return *m_cache_hash;
759  StreamString strm;
760  strm.Format("{0}-{1}-{2}", m_file, GetType(), GetStrata());
761  m_cache_hash = llvm::djbHash(strm.GetString());
762  return *m_cache_hash;
763 }
lldb_private::ObjectFile::GetSymbolTypeFromName
static lldb::SymbolType GetSymbolTypeFromName(llvm::StringRef name, lldb::SymbolType symbol_type_hint=lldb::eSymbolTypeUndefined)
Definition: ObjectFile.cpp:605
lldb_private::ObjectFile::MapFileData
static lldb::DataBufferSP MapFileData(const FileSpec &file, uint64_t Size, uint64_t Offset)
Definition: ObjectFile.cpp:659
lldb_private::AddressClass::eData
@ eData
lldb_private::Stream::Format
void Format(const char *format, Args &&... args)
Definition: Stream.h:309
lldb::eSymbolTypeCompiler
@ eSymbolTypeCompiler
Definition: lldb-enumerations.h:643
lldb::eSectionTypeDWARFDebugLoc
@ eSectionTypeDWARFDebugLoc
Definition: lldb-enumerations.h:676
lldb::eSectionTypeData8
@ eSectionTypeData8
Definition: lldb-enumerations.h:661
lldb::eSectionTypeDWARFDebugRngListsDwo
@ eSectionTypeDWARFDebugRngListsDwo
Definition: lldb-enumerations.h:712
lldb::eSymbolTypeParam
@ eSymbolTypeParam
Definition: lldb-enumerations.h:634
lldb::eSymbolTypeObjCIVar
@ eSymbolTypeObjCIVar
Definition: lldb-enumerations.h:648
llvm
Definition: Debugger.h:50
lldb_private::FileSystem::CreateDataBuffer
std::shared_ptr< DataBuffer > CreateDataBuffer(const llvm::Twine &path, uint64_t size=0, uint64_t offset=0)
Create memory buffer from path.
Definition: common/FileSystem.cpp:308
lldb::eSectionTypeDWARFAppleNamespaces
@ eSectionTypeDWARFAppleNamespaces
Definition: lldb-enumerations.h:686
LLDB_SCOPED_TIMERF
#define LLDB_SCOPED_TIMERF(...)
Definition: Timer.h:86
lldb::eSectionTypeDWARFAppleObjC
@ eSectionTypeDWARFAppleObjC
Definition: lldb-enumerations.h:687
lldb_private::ObjectFile::CreateSections
virtual void CreateSections(SectionList &unified_section_list)=0
lldb_private::ArchSpec
Definition: ArchSpec.h:32
lldb::eSectionTypeDebug
@ eSectionTypeDebug
Definition: lldb-enumerations.h:664
lldb_private::ModuleChild
Definition: ModuleChild.h:19
lldb::eSymbolTypeHeaderFile
@ eSymbolTypeHeaderFile
Definition: lldb-enumerations.h:629
lldb::eSymbolTypeCode
@ eSymbolTypeCode
Definition: lldb-enumerations.h:622
lldb_private::ObjectFile::m_memory_addr
const lldb::addr_t m_memory_addr
Set if the object file only exists in memory.
Definition: ObjectFile.h:743
lldb::eSymbolTypeInstrumentation
@ eSymbolTypeInstrumentation
Definition: lldb-enumerations.h:644
ModuleSpec.h
lldb_private::AddressClass
AddressClass
Definition: lldb-private-enumerations.h:48
lldb_private::Symbol
Definition: Symbol.h:20
lldb_private::Symbol::ValueIsAddress
bool ValueIsAddress() const
Definition: Symbol.cpp:117
lldb::eSectionTypeData16
@ eSectionTypeData16
Definition: lldb-enumerations.h:662
lldb::eSectionTypeDataCStringPointers
@ eSectionTypeDataCStringPointers
Pointers to C string data.
Definition: lldb-enumerations.h:658
lldb::eSymbolTypeLineEntry
@ eSymbolTypeLineEntry
Definition: lldb-enumerations.h:637
lldb_private::ObjectFile::eTypeExecutable
@ eTypeExecutable
A normal executable.
Definition: ObjectFile.h:71
lldb_private::Section::GetType
lldb::SectionType GetType() const
Definition: Section.h:180
lldb::eSectionTypeDataPointers
@ eSectionTypeDataPointers
Definition: lldb-enumerations.h:663
lldb_private::Section::IsRelocated
bool IsRelocated() const
Definition: Section.h:241
lldb::eSectionTypeDWARFDebugAranges
@ eSectionTypeDWARFDebugAranges
Definition: lldb-enumerations.h:671
lldb_private::ObjectFile::m_process_wp
lldb::ProcessWP m_process_wp
Definition: ObjectFile.h:741
lldb_private::ObjectFile::eStrataKernel
@ eStrataKernel
Definition: ObjectFile.h:91
lldb::eSymbolTypeCommonBlock
@ eSymbolTypeCommonBlock
Definition: lldb-enumerations.h:631
lldb::eSymbolTypeTrampoline
@ eSymbolTypeTrampoline
Definition: lldb-enumerations.h:625
lldb::eSectionTypeELFSymbolTable
@ eSectionTypeELFSymbolTable
Elf SHT_SYMTAB section.
Definition: lldb-enumerations.h:688
lldb_private::ModuleSpecList
Definition: ModuleSpec.h:275
lldb::eSectionTypeDWARFDebugStrOffsetsDwo
@ eSectionTypeDWARFDebugStrOffsetsDwo
Definition: lldb-enumerations.h:710
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:344
lldb::eSectionTypeDWARFDebugRanges
@ eSectionTypeDWARFDebugRanges
Definition: lldb-enumerations.h:681
lldb_private::ElapsedTime
A class that measures elapsed time in an exception safe way.
Definition: Statistics.h:66
lldb_private::ObjectFile::m_cache_hash
llvm::Optional< uint32_t > m_cache_hash
Definition: ObjectFile.h:752
lldb::eSectionTypeDWARFDebugMacro
@ eSectionTypeDWARFDebugMacro
Definition: lldb-enumerations.h:678
lldb::eSectionTypeDWARFDebugInfoDwo
@ eSectionTypeDWARFDebugInfoDwo
Definition: lldb-enumerations.h:708
lldb_private::ObjectFile::RelocateSection
virtual void RelocateSection(lldb_private::Section *section)
Perform relocations on the section if necessary.
Definition: ObjectFile.cpp:655
lldb::eSectionTypeDWARFDebugFrame
@ eSectionTypeDWARFDebugFrame
Definition: lldb-enumerations.h:673
Module.h
lldb_private::ObjectFile::eStrataInvalid
@ eStrataInvalid
Definition: ObjectFile.h:88
lldb::eSectionTypeDWARFDebugLine
@ eSectionTypeDWARFDebugLine
Definition: lldb-enumerations.h:675
lldb_private::ObjectFile::m_symtab_up
std::unique_ptr< lldb_private::Symtab > m_symtab_up
Definition: ObjectFile.h:745
lldb::eSectionTypeDWARFDebugAbbrevDwo
@ eSectionTypeDWARFDebugAbbrevDwo
Definition: lldb-enumerations.h:707
lldb_private::ObjectFile::m_file
FileSpec m_file
Definition: ObjectFile.h:731
lldb_private::ObjectFile::GetAddressClass
virtual AddressClass GetAddressClass(lldb::addr_t file_addr)
Get the address type given a file address in an object file.
Definition: ObjectFile.cpp:295
lldb::eSymbolTypeScopeBegin
@ eSymbolTypeScopeBegin
Definition: lldb-enumerations.h:639
lldb::eSymbolTypeData
@ eSymbolTypeData
Definition: lldb-enumerations.h:624
lldb_private::ObjectFile::ReadSectionData
virtual size_t ReadSectionData(Section *section, lldb::offset_t section_offset, void *dst, size_t dst_len)
Definition: ObjectFile.cpp:474
lldb::eSectionTypeDWARFDebugAddr
@ eSectionTypeDWARFDebugAddr
Definition: lldb-enumerations.h:670
SectionLoadList.h
lldb_private::SectionList
Definition: Section.h:34
lldb_private::Section::GetFileSize
lldb::offset_t GetFileSize() const
Definition: Section.h:152
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
lldb::eSymbolTypeRuntime
@ eSymbolTypeRuntime
Definition: lldb-enumerations.h:626
lldb_private::Section::GetTargetByteSize
uint32_t GetTargetByteSize() const
Definition: Section.h:239
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::ObjectFile::Type
Type
Definition: ObjectFile.h:66
lldb::eSectionTypeDWARFDebugStrOffsets
@ eSectionTypeDWARFDebugStrOffsets
Definition: lldb-enumerations.h:683
lldb_private::SectionList::GetNumSections
size_t GetNumSections(uint32_t depth) const
Definition: Section.cpp:527
lldb_private::Target
Definition: Target.h:469
Section.h
lldb_private::ObjectFile::ReadMemory
static lldb::DataBufferSP ReadMemory(const lldb::ProcessSP &process_sp, lldb::addr_t addr, size_t byte_size)
Definition: ObjectFile.cpp:446
lldb_private::DataExtractor::SetData
lldb::offset_t SetData(const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order)
Set data with a buffer that is caller owned.
Definition: DataExtractor.cpp:223
lldb_private::Symtab::GetMutex
std::recursive_mutex & GetMutex()
Definition: Symtab.h:51
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
lldb_private::AddressClass::eUnknown
@ eUnknown
lldb_private::ObjectFile::eTypeObjectFile
@ eTypeObjectFile
An intermediate object file.
Definition: ObjectFile.h:77
Process.h
Target.h
lldb_private::DataExtractor::SetByteOrder
void SetByteOrder(lldb::ByteOrder byte_order)
Set the byte_order value.
Definition: DataExtractor.h:931
lldb_private::ObjectFile::GetSymtab
Symtab * GetSymtab()
Gets the symbol table for the currently selected architecture (and object for archives).
Definition: ObjectFile.cpp:725
lldb::eSectionTypeELFRelocationEntries
@ eSectionTypeELFRelocationEntries
Elf SHT_REL or SHT_REL section.
Definition: lldb-enumerations.h:690
lldb::eSectionTypeDWARFDebugLocDwo
@ eSectionTypeDWARFDebugLocDwo
Definition: lldb-enumerations.h:713
lldb_private::FileSpec
Definition: FileSpec.h:55
elapsed
static double elapsed(const StatsTimepoint &start, const StatsTimepoint &end)
Definition: Statistics.cpp:36
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb::eSymbolTypeAny
@ eSymbolTypeAny
Definition: lldb-enumerations.h:619
lldb::eSymbolTypeBlock
@ eSymbolTypeBlock
Definition: lldb-enumerations.h:632
lldb_private::ObjectFile::GetSectionList
virtual SectionList * GetSectionList(bool update_module_section_list=true)
Gets the section list for the currently selected architecture (and object for archives).
Definition: ObjectFile.cpp:588
lldb::eSectionTypeDataObjCMessageRefs
@ eSectionTypeDataObjCMessageRefs
Pointer to function pointer + selector.
Definition: lldb-enumerations.h:666
lldb_private::SectionLoadList::GetSectionLoadAddress
lldb::addr_t GetSectionLoadAddress(const lldb::SectionSP &section_sp) const
Definition: SectionLoadList.cpp:50
lldb::eSectionTypeDWARFDebugLocListsDwo
@ eSectionTypeDWARFDebugLocListsDwo
Definition: lldb-enumerations.h:714
lldb_private::ObjectFile::LoadableData
Definition: ObjectFile.h:107
ID
static char ID
Definition: IRDynamicChecks.cpp:33
lldb_private::ObjectFile::ObjectFile
ObjectFile(const lldb::ModuleSP &module_sp, const FileSpec *file_spec_ptr, lldb::offset_t file_offset, lldb::offset_t length, lldb::DataBufferSP data_sp, lldb::offset_t data_offset)
Construct with a parent module, offset, and header data.
Definition: ObjectFile.cpp:241
lldb_private::ConstString::SetString
void SetString(const llvm::StringRef &s)
Definition: ConstString.cpp:305
lldb::eSectionTypeDWARFDebugAbbrev
@ eSectionTypeDWARFDebugAbbrev
Definition: lldb-enumerations.h:669
lldb_private::AddressClass::eRuntime
@ eRuntime
lldb::eSectionTypeCompactUnwind
@ eSectionTypeCompactUnwind
compact unwind section in Mach-O, __TEXT,__unwind_info
Definition: lldb-enumerations.h:695
lldb::eSymbolTypeSourceFile
@ eSymbolTypeSourceFile
Definition: lldb-enumerations.h:628
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb::eSectionTypeDataSymbolAddress
@ eSectionTypeDataSymbolAddress
Address of a symbol in the symbol table.
Definition: lldb-enumerations.h:659
lldb::eSectionTypeDataObjCCFStrings
@ eSectionTypeDataObjCCFStrings
Objective-C const CFString/NSString objects.
Definition: lldb-enumerations.h:667
Log.h
lldb::eSymbolTypeUndefined
@ eSymbolTypeUndefined
Definition: lldb-enumerations.h:645
lldb_private::ObjectFile::m_length
lldb::addr_t m_length
The length of this object file if it is known (can be zero if length is unknown or can't be determine...
Definition: ObjectFile.h:736
lldb::eSymbolTypeObjectFile
@ eSymbolTypeObjectFile
Definition: lldb-enumerations.h:630
lldb_private::ObjectFile::LoadableData::Dest
lldb::addr_t Dest
Definition: ObjectFile.h:108
lldb_private::ObjectFile::eStrataUser
@ eStrataUser
Definition: ObjectFile.h:90
lldb::eSectionTypeDWARFDebugStr
@ eSectionTypeDWARFDebugStr
Definition: lldb-enumerations.h:682
lldb_private::ObjectFile::LoadableData::Contents
llvm::ArrayRef< uint8_t > Contents
Definition: ObjectFile.h:109
lldb_private::ObjectFile::eStrataRawImage
@ eStrataRawImage
Definition: ObjectFile.h:92
lldb_private::DataExtractor::SetAddressByteSize
void SetAddressByteSize(uint32_t addr_size)
Set the address byte size.
Definition: DataExtractor.h:845
lldb_private::Symbol::GetAddressRef
Address & GetAddressRef()
Definition: Symbol.h:57
lldb_private::ObjectFile::eTypeCoreFile
@ eTypeCoreFile
A core file that has a checkpoint of a program's execution state.
Definition: ObjectFile.h:69
lldb_private::DataExtractor::GetDataStart
const uint8_t * GetDataStart() const
Get the data start pointer.
Definition: DataExtractor.h:422
lldb_private::ConstString
Definition: ConstString.h:39
lldb_private::StreamString
Definition: StreamString.h:23
lldb::eSectionTypeDWARFDebugInfo
@ eSectionTypeDWARFDebugInfo
Definition: lldb-enumerations.h:674
lldb_private::Symtab::FindSymbolContainingFileAddress
Symbol * FindSymbolContainingFileAddress(lldb::addr_t file_addr)
Definition: Symtab.cpp:1035
Timer.h
lldb::eSectionTypeDWARFDebugTypes
@ eSectionTypeDWARFDebugTypes
DWARF .debug_types section.
Definition: lldb-enumerations.h:701
ObjectContainerCreateInstance
lldb_private::SectionList::GetSectionAtIndex
lldb::SectionSP GetSectionAtIndex(size_t idx) const
Definition: Section.cpp:538
lldb::eSectionTypeZeroFill
@ eSectionTypeZeroFill
Definition: lldb-enumerations.h:665
lldb::eSectionTypeDWARFAppleTypes
@ eSectionTypeDWARFAppleTypes
Definition: lldb-enumerations.h:685
lldb::eSectionTypeDWARFAppleNames
@ eSectionTypeDWARFAppleNames
Definition: lldb-enumerations.h:684
lldb::eSymbolTypeObjCClass
@ eSymbolTypeObjCClass
Definition: lldb-enumerations.h:646
lldb::eSectionTypeDWARFGNUDebugAltLink
@ eSectionTypeDWARFGNUDebugAltLink
Definition: lldb-enumerations.h:700
lldb::eSymbolTypeAdditional
@ eSymbolTypeAdditional
When symbols take more than one entry, the extra entries get this type.
Definition: lldb-enumerations.h:641
lldb::eSectionTypeELFDynamicSymbols
@ eSectionTypeELFDynamicSymbols
Elf SHT_DYNSYM section.
Definition: lldb-enumerations.h:689
lldb_private::ObjectFile::eTypeSharedLibrary
@ eTypeSharedLibrary
A shared library that can be used during execution.
Definition: ObjectFile.h:79
lldb_private::Section::GetLoadBaseAddress
lldb::addr_t GetLoadBaseAddress(Target *target) const
Definition: Section.cpp:224
lldb_private::Address::GetSection
lldb::SectionSP GetSection() const
Get const accessor for the section.
Definition: Address.h:429
lldb::eSectionTypeAbsoluteAddress
@ eSectionTypeAbsoluteAddress
Dummy section for symbols with absolute address.
Definition: lldb-enumerations.h:698
lldb::SymbolType
SymbolType
Symbol types.
Definition: lldb-enumerations.h:618
lldb::eSymbolTypeVariable
@ eSymbolTypeVariable
Definition: lldb-enumerations.h:635
lldb::eSymbolTypeScopeEnd
@ eSymbolTypeScopeEnd
Definition: lldb-enumerations.h:640
lldb::eSectionTypeDWARFDebugCuIndex
@ eSectionTypeDWARFDebugCuIndex
Definition: lldb-enumerations.h:672
lldb_private::ObjectFile::~ObjectFile
~ObjectFile() override
Destructor.
Definition: ObjectFile.cpp:283
lldb_private::ObjectFile::eTypeJIT
@ eTypeJIT
JIT code that has symbols, sections and possibly debug info.
Definition: ObjectFile.h:83
lldb::eSectionTypeData
@ eSectionTypeData
Definition: lldb-enumerations.h:656
ObjectFile.h
lldb-private.h
lldb_private::Section
Definition: Section.h:102
lldb::eSectionTypeDWARFDebugTuIndex
@ eSectionTypeDWARFDebugTuIndex
Definition: lldb-enumerations.h:715
lldb::eSectionTypeData4
@ eSectionTypeData4
Definition: lldb-enumerations.h:660
lldb_private::ObjectFile::eStrataUnknown
@ eStrataUnknown
Definition: ObjectFile.h:89
lldb::eSectionTypeOther
@ eSectionTypeOther
Definition: lldb-enumerations.h:703
lldb_private::ObjectFile::m_symtab_once_up
std::unique_ptr< llvm::once_flag > m_symtab_once_up
We need a llvm::once_flag that we can use to avoid locking the module lock and deadlocking LLDB.
Definition: ObjectFile.h:751
lldb::eSectionTypeCode
@ eSectionTypeCode
Definition: lldb-enumerations.h:654
lldb_private::Section::GetByteSize
lldb::addr_t GetByteSize() const
Definition: Section.h:162
lldb_private::ObjectFile::GetData
size_t GetData(lldb::offset_t offset, size_t length, DataExtractor &data) const
Definition: ObjectFile.cpp:460
lldb_private::Status
Definition: Status.h:44
lldb::eSectionTypeContainer
@ eSectionTypeContainer
The section contains child sections.
Definition: lldb-enumerations.h:655
lldb::eSectionTypeEHFrame
@ eSectionTypeEHFrame
Definition: lldb-enumerations.h:692
lldb_private::ObjectFile::SplitArchivePathWithObject
static bool SplitArchivePathWithObject(llvm::StringRef path_with_object, lldb_private::FileSpec &archive_file, lldb_private::ConstString &archive_object, bool must_exist)
Split a path into a file path with object name.
Definition: ObjectFile.cpp:556
lldb::eSectionTypeELFDynamicLinkInfo
@ eSectionTypeELFDynamicLinkInfo
Elf SHT_DYNAMIC section.
Definition: lldb-enumerations.h:691
lldb_private::Symtab
Definition: Symtab.h:22
lldb_private::ObjectFile::eTypeInvalid
@ eTypeInvalid
Definition: ObjectFile.h:67
uint32_t
lldb_private::ObjectFile::eTypeDebugInfo
@ eTypeDebugInfo
An object file that contains only debug information.
Definition: ObjectFile.h:73
lldb::SectionType
SectionType
Definition: lldb-enumerations.h:652
lldb::eSectionTypeDWARFDebugStrDwo
@ eSectionTypeDWARFDebugStrDwo
Definition: lldb-enumerations.h:709
lldb::eSectionTypeDWARFDebugPubTypes
@ eSectionTypeDWARFDebugPubTypes
Definition: lldb-enumerations.h:680
lldb::eSectionTypeDWARFDebugNames
@ eSectionTypeDWARFDebugNames
DWARF v5 .debug_names.
Definition: lldb-enumerations.h:702
lldb_private::ObjectFile::GetLoadableData
virtual std::vector< LoadableData > GetLoadableData(Target &target)
Loads this objfile to memory.
Definition: ObjectFile.cpp:625
lldb_private::ObjectFile::GetStrata
Strata GetStrata()
Definition: ObjectFile.h:643
lldb_private::LLDBLog::Object
@ Object
lldb::eSectionTypeARMextab
@ eSectionTypeARMextab
Definition: lldb-enumerations.h:694
lldb_private::ObjectFile::eTypeStubLibrary
@ eTypeStubLibrary
A library that can be linked against but not used for execution.
Definition: ObjectFile.h:81
lldb::eSectionTypeDWARFDebugPubNames
@ eSectionTypeDWARFDebugPubNames
Definition: lldb-enumerations.h:679
lldb_private::ObjectFile::ParseSymtab
virtual void ParseSymtab(Symtab &symtab)=0
Parse the symbol table into the provides symbol table object.
CallFrameInfo.h
CreateObjectFromContainer
static ObjectFileSP CreateObjectFromContainer(const lldb::ModuleSP &module_sp, const FileSpec *file, lldb::offset_t file_offset, lldb::offset_t file_size, DataBufferSP data_sp, lldb::offset_t &data_offset)
Definition: ObjectFile.cpp:36
lldb::eSectionTypeInvalid
@ eSectionTypeInvalid
Definition: lldb-enumerations.h:653
lldb_private::ObjectFile::ClearSymtab
virtual void ClearSymtab()
Frees the symbol table.
Definition: ObjectFile.cpp:574
lldb_private::AddressClass::eCode
@ eCode
lldb::eSectionTypeDataCString
@ eSectionTypeDataCString
Inlined C string data.
Definition: lldb-enumerations.h:657
lldb_private::ObjectFile::m_data
DataExtractor m_data
The data for this object file so things can be parsed lazily.
Definition: ObjectFile.h:740
lldb::eSymbolTypeObjCMetaClass
@ eSymbolTypeObjCMetaClass
Definition: lldb-enumerations.h:647
lldb::eSymbolTypeVariableType
@ eSymbolTypeVariableType
Definition: lldb-enumerations.h:636
lldb_private::ModuleChild::GetModule
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
Definition: ModuleChild.cpp:24
lldb_private::ObjectFile::m_file_offset
lldb::addr_t m_file_offset
The offset in bytes into the file, or the address in memory.
Definition: ObjectFile.h:734
lldb::eSectionTypeDWARFDebugLineStr
@ eSectionTypeDWARFDebugLineStr
DWARF v5 .debug_line_str.
Definition: lldb-enumerations.h:704
PluginManager.h
lldb_private::ObjectFile::GetCacheHash
uint32_t GetCacheHash()
Get a hash that can be used for caching object file releated information.
Definition: ObjectFile.cpp:756
lldb_private::Target::GetSectionLoadList
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1102
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
lldb_private::ObjectFile::eStrataJIT
@ eStrataJIT
Definition: ObjectFile.h:93
lldb_private::AddressClass::eDebug
@ eDebug
lldb_private::FileSystem::Instance
static FileSystem & Instance()
Definition: common/FileSystem.cpp:46
lldb::eSymbolTypeReExported
@ eSymbolTypeReExported
Definition: lldb-enumerations.h:649
lldb_private::DataExtractor::CopyData
lldb::offset_t CopyData(lldb::offset_t offset, lldb::offset_t length, void *dst) const
Copy length bytes from *offset, without swapping bytes.
Definition: DataExtractor.cpp:678
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ObjectFile::IsInMemory
bool IsInMemory() const
Returns true if the object file exists only in memory.
Definition: ObjectFile.h:677
ObjectFileCreateInstance
lldb_private::Section::GetFileOffset
lldb::offset_t GetFileOffset() const
Definition: Section.h:146
lldb::eSymbolTypeLineHeader
@ eSymbolTypeLineHeader
Definition: lldb-enumerations.h:638
ObjectContainer.h
lldb::eSymbolTypeException
@ eSymbolTypeException
Definition: lldb-enumerations.h:627
lldb_private::ObjectFile::eTypeUnknown
@ eTypeUnknown
Definition: ObjectFile.h:84
lldb_private::ModuleSpecList::GetSize
size_t GetSize() const
Definition: ModuleSpec.h:298
lldb_private::Log
Definition: Log.h:115
lldb_private::Section::GetObjectFile
ObjectFile * GetObjectFile()
Definition: Section.h:196
lldb_private::FileSpec::SetFile
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
Definition: FileSpec.cpp:172
lldb_private::ObjectFile::eTypeDynamicLinker
@ eTypeDynamicLinker
The platform's dynamic linker executable.
Definition: ObjectFile.h:75
lldb::eSymbolTypeResolver
@ eSymbolTypeResolver
Definition: lldb-enumerations.h:623
lldb_private::ObjectFile::CopyData
size_t CopyData(lldb::offset_t offset, size_t length, void *dst) const
Definition: ObjectFile.cpp:467
lldb_private::ObjectFile::SetModulesArchitecture
bool SetModulesArchitecture(const ArchSpec &new_arch)
Sets the architecture for a module.
Definition: ObjectFile.cpp:288
lldb::eSectionTypeDWARFDebugMacInfo
@ eSectionTypeDWARFDebugMacInfo
Definition: lldb-enumerations.h:677
lldb::eSectionTypeARMexidx
@ eSectionTypeARMexidx
Definition: lldb-enumerations.h:693
lldb::eSymbolTypeAbsolute
@ eSymbolTypeAbsolute
Definition: lldb-enumerations.h:621
lldb_private::GetLog
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:309
lldb_private::FileSpec::GetPath
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:364
DataBuffer.h
lldb_private::DataExtractor::GetByteSize
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
Definition: DataExtractor.h:270
lldb_private::DataBufferHeap
Definition: DataBufferHeap.h:30
lldb_private::Symbol::GetType
lldb::SymbolType GetType() const
Definition: Symbol.h:153
lldb::eSectionTypeDWARFDebugTypesDwo
@ eSectionTypeDWARFDebugTypesDwo
Definition: lldb-enumerations.h:711
lldb_private::ObjectFile::CreateCallFrameInfo
virtual std::unique_ptr< CallFrameInfo > CreateCallFrameInfo()
Creates a plugin-specific call frame info.
Definition: ObjectFile.cpp:651
lldb::eSymbolTypeLocal
@ eSymbolTypeLocal
Definition: lldb-enumerations.h:633
lldb_private::ObjectFile::Strata
Strata
Definition: ObjectFile.h:87
lldb
Definition: SBAddress.h:15
lldb::eSectionTypeDWARFDebugLocLists
@ eSectionTypeDWARFDebugLocLists
DWARF v5 .debug_loclists.
Definition: lldb-enumerations.h:706
LLDBLog.h
SymbolFile.h
lldb::eSectionTypeGoSymtab
@ eSectionTypeGoSymtab
Definition: lldb-enumerations.h:697
DataBufferHeap.h
lldb_private::ObjectFile::m_sections_up
std::unique_ptr< lldb_private::SectionList > m_sections_up
Definition: ObjectFile.h:744
lldb_private::LLDBLog::OS
@ OS
lldb_private::ObjectFile::GetType
Type GetType()
Definition: ObjectFile.h:637
lldb::eSectionTypeDWARFDebugRngLists
@ eSectionTypeDWARFDebugRngLists
DWARF v5 .debug_rnglists.
Definition: lldb-enumerations.h:705