LLDB  mainline
SymbolFileDWARFDebugMap.cpp
Go to the documentation of this file.
1 //===-- SymbolFileDWARFDebugMap.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 "DWARFDebugAranges.h"
11 
12 #include "lldb/Core/Module.h"
13 #include "lldb/Core/ModuleList.h"
15 #include "lldb/Core/Section.h"
16 #include "lldb/Host/FileSystem.h"
17 #include "lldb/Utility/RangeMap.h"
19 #include "lldb/Utility/Timer.h"
20 
21 //#define DEBUG_OSO_DMAP // DO NOT CHECKIN WITH THIS NOT COMMENTED OUT
22 #if defined(DEBUG_OSO_DMAP)
23 #include "lldb/Core/StreamFile.h"
24 #endif
25 
27 #include "lldb/Symbol/LineTable.h"
28 #include "lldb/Symbol/ObjectFile.h"
30 #include "lldb/Symbol/TypeMap.h"
32 #include "llvm/Support/ScopedPrinter.h"
33 
34 #include "LogChannelDWARF.h"
35 #include "SymbolFileDWARF.h"
36 
37 #include <memory>
38 
39 using namespace lldb;
40 using namespace lldb_private;
41 
43 
44 // Subclass lldb_private::Module so we can intercept the
45 // "Module::GetObjectFile()" (so we can fixup the object file sections) and
46 // also for "Module::GetSymbolFile()" (so we can fixup the symbol file id.
47 
50  SymbolFileDWARFDebugMap *exe_symfile) {
51  if (file_range_map_valid)
52  return file_range_map;
53 
54  file_range_map_valid = true;
55 
56  Module *oso_module = exe_symfile->GetModuleByCompUnitInfo(this);
57  if (!oso_module)
58  return file_range_map;
59 
60  ObjectFile *oso_objfile = oso_module->GetObjectFile();
61  if (!oso_objfile)
62  return file_range_map;
63 
64  Log *log = GetLog(DWARFLog::DebugMap);
65  LLDB_LOGF(
66  log,
67  "%p: SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap ('%s')",
68  static_cast<void *>(this),
69  oso_module->GetSpecificationDescription().c_str());
70 
71  std::vector<SymbolFileDWARFDebugMap::CompileUnitInfo *> cu_infos;
72  if (exe_symfile->GetCompUnitInfosForModule(oso_module, cu_infos)) {
73  for (auto comp_unit_info : cu_infos) {
74  Symtab *exe_symtab = exe_symfile->GetObjectFile()->GetSymtab();
75  ModuleSP oso_module_sp(oso_objfile->GetModule());
76  Symtab *oso_symtab = oso_objfile->GetSymtab();
77 
78  /// const uint32_t fun_resolve_flags = SymbolContext::Module |
79  /// eSymbolContextCompUnit | eSymbolContextFunction;
80  // SectionList *oso_sections = oso_objfile->Sections();
81  // Now we need to make sections that map from zero based object file
82  // addresses to where things ended up in the main executable.
83 
84  assert(comp_unit_info->first_symbol_index != UINT32_MAX);
85  // End index is one past the last valid symbol index
86  const uint32_t oso_end_idx = comp_unit_info->last_symbol_index + 1;
87  for (uint32_t idx = comp_unit_info->first_symbol_index +
88  2; // Skip the N_SO and N_OSO
89  idx < oso_end_idx; ++idx) {
90  Symbol *exe_symbol = exe_symtab->SymbolAtIndex(idx);
91  if (exe_symbol) {
92  if (!exe_symbol->IsDebug())
93  continue;
94 
95  switch (exe_symbol->GetType()) {
96  default:
97  break;
98 
99  case eSymbolTypeCode: {
100  // For each N_FUN, or function that we run into in the debug map we
101  // make a new section that we add to the sections found in the .o
102  // file. This new section has the file address set to what the
103  // addresses are in the .o file, and the load address is adjusted
104  // to match where it ended up in the final executable! We do this
105  // before we parse any dwarf info so that when it goes get parsed
106  // all section/offset addresses that get registered will resolve
107  // correctly to the new addresses in the main executable.
108 
109  // First we find the original symbol in the .o file's symbol table
110  Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType(
111  exe_symbol->GetMangled().GetName(Mangled::ePreferMangled),
112  eSymbolTypeCode, Symtab::eDebugNo, Symtab::eVisibilityAny);
113  if (oso_fun_symbol) {
114  // Add the inverse OSO file address to debug map entry mapping
115  exe_symfile->AddOSOFileRange(
116  this, exe_symbol->GetAddressRef().GetFileAddress(),
117  exe_symbol->GetByteSize(),
118  oso_fun_symbol->GetAddressRef().GetFileAddress(),
119  oso_fun_symbol->GetByteSize());
120  }
121  } break;
122 
123  case eSymbolTypeData: {
124  // For each N_GSYM we remap the address for the global by making a
125  // new section that we add to the sections found in the .o file.
126  // This new section has the file address set to what the addresses
127  // are in the .o file, and the load address is adjusted to match
128  // where it ended up in the final executable! We do this before we
129  // parse any dwarf info so that when it goes get parsed all
130  // section/offset addresses that get registered will resolve
131  // correctly to the new addresses in the main executable. We
132  // initially set the section size to be 1 byte, but will need to
133  // fix up these addresses further after all globals have been
134  // parsed to span the gaps, or we can find the global variable
135  // sizes from the DWARF info as we are parsing.
136 
137  // Next we find the non-stab entry that corresponds to the N_GSYM
138  // in the .o file
139  Symbol *oso_gsym_symbol =
140  oso_symtab->FindFirstSymbolWithNameAndType(
141  exe_symbol->GetMangled().GetName(Mangled::ePreferMangled),
142  eSymbolTypeData, Symtab::eDebugNo, Symtab::eVisibilityAny);
143  if (exe_symbol && oso_gsym_symbol && exe_symbol->ValueIsAddress() &&
144  oso_gsym_symbol->ValueIsAddress()) {
145  // Add the inverse OSO file address to debug map entry mapping
146  exe_symfile->AddOSOFileRange(
147  this, exe_symbol->GetAddressRef().GetFileAddress(),
148  exe_symbol->GetByteSize(),
149  oso_gsym_symbol->GetAddressRef().GetFileAddress(),
150  oso_gsym_symbol->GetByteSize());
151  }
152  } break;
153  }
154  }
155  }
156 
157  exe_symfile->FinalizeOSOFileRanges(this);
158  // We don't need the symbols anymore for the .o files
159  oso_objfile->ClearSymtab();
160  }
161  }
162  return file_range_map;
163 }
164 
165 class DebugMapModule : public Module {
166 public:
167  DebugMapModule(const ModuleSP &exe_module_sp, uint32_t cu_idx,
168  const FileSpec &file_spec, const ArchSpec &arch,
169  const ConstString *object_name, off_t object_offset,
170  const llvm::sys::TimePoint<> object_mod_time)
171  : Module(file_spec, arch, object_name, object_offset, object_mod_time),
172  m_exe_module_wp(exe_module_sp), m_cu_idx(cu_idx) {}
173 
174  ~DebugMapModule() override = default;
175 
176  SymbolFile *
177  GetSymbolFile(bool can_create = true,
178  lldb_private::Stream *feedback_strm = nullptr) override {
179  // Scope for locker
180  if (m_symfile_up.get() || !can_create)
181  return m_symfile_up ? m_symfile_up->GetSymbolFile() : nullptr;
182 
183  ModuleSP exe_module_sp(m_exe_module_wp.lock());
184  if (exe_module_sp) {
185  // Now get the object file outside of a locking scope
186  ObjectFile *oso_objfile = GetObjectFile();
187  if (oso_objfile) {
188  std::lock_guard<std::recursive_mutex> guard(m_mutex);
189  if (SymbolFile *symfile =
190  Module::GetSymbolFile(can_create, feedback_strm)) {
191  // Set a pointer to this class to set our OSO DWARF file know that
192  // the DWARF is being used along with a debug map and that it will
193  // have the remapped sections that we do below.
194  SymbolFileDWARF *oso_symfile =
196 
197  if (!oso_symfile)
198  return nullptr;
199 
200  ObjectFile *exe_objfile = exe_module_sp->GetObjectFile();
201  SymbolFile *exe_symfile = exe_module_sp->GetSymbolFile();
202 
203  if (exe_objfile && exe_symfile) {
204  oso_symfile->SetDebugMapModule(exe_module_sp);
205  // Set the ID of the symbol file DWARF to the index of the OSO
206  // shifted left by 32 bits to provide a unique prefix for any
207  // UserID's that get created in the symbol file.
208  oso_symfile->SetID(((uint64_t)m_cu_idx + 1ull) << 32ull);
209  }
210  return symfile;
211  }
212  }
213  }
214  return nullptr;
215  }
216 
217 protected:
218  ModuleWP m_exe_module_wp;
220 };
221 
223  PluginManager::RegisterPlugin(GetPluginNameStatic(),
224  GetPluginDescriptionStatic(), CreateInstance);
225 }
226 
228  PluginManager::UnregisterPlugin(CreateInstance);
229 }
230 
232  return "DWARF and DWARF3 debug symbol file reader (debug map).";
233 }
234 
236  return new SymbolFileDWARFDebugMap(std::move(objfile_sp));
237 }
238 
240  : SymbolFileCommon(std::move(objfile_sp)), m_flags(), m_compile_unit_infos(),
241  m_func_indexes(), m_glob_indexes(),
242  m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate) {}
243 
245 
247 
249  if (m_flags.test(kHaveInitializedOSOs))
250  return;
251 
253 
254  // If the object file has been stripped, there is no sense in looking further
255  // as all of the debug symbols for the debug map will not be available
256  if (m_objfile_sp->IsStripped())
257  return;
258 
259  // Also make sure the file type is some sort of executable. Core files, debug
260  // info files (dSYM), object files (.o files), and stub libraries all can
261  switch (m_objfile_sp->GetType()) {
262  case ObjectFile::eTypeInvalid:
263  case ObjectFile::eTypeCoreFile:
264  case ObjectFile::eTypeDebugInfo:
265  case ObjectFile::eTypeObjectFile:
266  case ObjectFile::eTypeStubLibrary:
267  case ObjectFile::eTypeUnknown:
268  case ObjectFile::eTypeJIT:
269  return;
270 
271  case ObjectFile::eTypeExecutable:
272  case ObjectFile::eTypeDynamicLinker:
273  case ObjectFile::eTypeSharedLibrary:
274  break;
275  }
276 
277  // In order to get the abilities of this plug-in, we look at the list of
278  // N_OSO entries (object files) from the symbol table and make sure that
279  // these files exist and also contain valid DWARF. If we get any of that then
280  // we return the abilities of the first N_OSO's DWARF.
281 
282  Symtab *symtab = m_objfile_sp->GetSymtab();
283  if (symtab) {
284  Log *log = GetLog(DWARFLog::DebugMap);
285 
286  std::vector<uint32_t> oso_indexes;
287  // When a mach-o symbol is encoded, the n_type field is encoded in bits
288  // 23:16, and the n_desc field is encoded in bits 15:0.
289  //
290  // To find all N_OSO entries that are part of the DWARF + debug map we find
291  // only object file symbols with the flags value as follows: bits 23:16 ==
292  // 0x66 (N_OSO) bits 15: 0 == 0x0001 (specifies this is a debug map object
293  // file)
294  const uint32_t k_oso_symbol_flags_value = 0x660001u;
295 
296  const uint32_t oso_index_count =
298  eSymbolTypeObjectFile, k_oso_symbol_flags_value, oso_indexes);
299 
300  if (oso_index_count > 0) {
301  symtab->AppendSymbolIndexesWithType(eSymbolTypeCode, Symtab::eDebugYes,
302  Symtab::eVisibilityAny,
304  symtab->AppendSymbolIndexesWithType(eSymbolTypeData, Symtab::eDebugYes,
305  Symtab::eVisibilityAny,
307 
310 
311  for (uint32_t sym_idx : m_func_indexes) {
312  const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);
313  lldb::addr_t file_addr = symbol->GetAddressRef().GetFileAddress();
314  lldb::addr_t byte_size = symbol->GetByteSize();
315  DebugMap::Entry debug_map_entry(
316  file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));
317  m_debug_map.Append(debug_map_entry);
318  }
319  for (uint32_t sym_idx : m_glob_indexes) {
320  const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);
321  lldb::addr_t file_addr = symbol->GetAddressRef().GetFileAddress();
322  lldb::addr_t byte_size = symbol->GetByteSize();
323  DebugMap::Entry debug_map_entry(
324  file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));
325  m_debug_map.Append(debug_map_entry);
326  }
327  m_debug_map.Sort();
328 
329  m_compile_unit_infos.resize(oso_index_count);
330 
331  for (uint32_t i = 0; i < oso_index_count; ++i) {
332  const uint32_t so_idx = oso_indexes[i] - 1;
333  const uint32_t oso_idx = oso_indexes[i];
334  const Symbol *so_symbol = symtab->SymbolAtIndex(so_idx);
335  const Symbol *oso_symbol = symtab->SymbolAtIndex(oso_idx);
336  if (so_symbol && oso_symbol &&
337  so_symbol->GetType() == eSymbolTypeSourceFile &&
338  oso_symbol->GetType() == eSymbolTypeObjectFile) {
339  m_compile_unit_infos[i].so_file.SetFile(
340  so_symbol->GetName().AsCString(), FileSpec::Style::native);
341  m_compile_unit_infos[i].oso_path = oso_symbol->GetName();
342  m_compile_unit_infos[i].oso_mod_time =
343  llvm::sys::toTimePoint(oso_symbol->GetIntegerValue(0));
344  uint32_t sibling_idx = so_symbol->GetSiblingIndex();
345  // The sibling index can't be less that or equal to the current index
346  // "i"
347  if (sibling_idx == UINT32_MAX) {
348  m_objfile_sp->GetModule()->ReportError(
349  "N_SO in symbol with UID %u has invalid sibling in debug map, "
350  "please file a bug and attach the binary listed in this error",
351  so_symbol->GetID());
352  } else {
353  const Symbol *last_symbol = symtab->SymbolAtIndex(sibling_idx - 1);
354  m_compile_unit_infos[i].first_symbol_index = so_idx;
355  m_compile_unit_infos[i].last_symbol_index = sibling_idx - 1;
356  m_compile_unit_infos[i].first_symbol_id = so_symbol->GetID();
357  m_compile_unit_infos[i].last_symbol_id = last_symbol->GetID();
358 
359  LLDB_LOGF(log, "Initialized OSO 0x%8.8x: file=%s", i,
360  oso_symbol->GetName().GetCString());
361  }
362  } else {
363  if (oso_symbol == nullptr)
364  m_objfile_sp->GetModule()->ReportError(
365  "N_OSO symbol[%u] can't be found, please file a bug and attach "
366  "the binary listed in this error",
367  oso_idx);
368  else if (so_symbol == nullptr)
369  m_objfile_sp->GetModule()->ReportError(
370  "N_SO not found for N_OSO symbol[%u], please file a bug and "
371  "attach the binary listed in this error",
372  oso_idx);
373  else if (so_symbol->GetType() != eSymbolTypeSourceFile)
374  m_objfile_sp->GetModule()->ReportError(
375  "N_SO has incorrect symbol type (%u) for N_OSO symbol[%u], "
376  "please file a bug and attach the binary listed in this error",
377  so_symbol->GetType(), oso_idx);
378  else if (oso_symbol->GetType() != eSymbolTypeSourceFile)
379  m_objfile_sp->GetModule()->ReportError(
380  "N_OSO has incorrect symbol type (%u) for N_OSO symbol[%u], "
381  "please file a bug and attach the binary listed in this error",
382  oso_symbol->GetType(), oso_idx);
383  }
384  }
385  }
386  }
387 }
388 
390  const uint32_t cu_count = GetNumCompileUnits();
391  if (oso_idx < cu_count)
393  return nullptr;
394 }
395 
397  CompileUnitInfo *comp_unit_info) {
398  if (!comp_unit_info->oso_sp) {
399  auto pos = m_oso_map.find(
400  {comp_unit_info->oso_path, comp_unit_info->oso_mod_time});
401  if (pos != m_oso_map.end()) {
402  comp_unit_info->oso_sp = pos->second;
403  } else {
404  ObjectFile *obj_file = GetObjectFile();
405  comp_unit_info->oso_sp = std::make_shared<OSOInfo>();
406  m_oso_map[{comp_unit_info->oso_path, comp_unit_info->oso_mod_time}] =
407  comp_unit_info->oso_sp;
408  const char *oso_path = comp_unit_info->oso_path.GetCString();
409  FileSpec oso_file(oso_path);
410  ConstString oso_object;
411  if (FileSystem::Instance().Exists(oso_file)) {
412  // The modification time returned by the FS can have a higher precision
413  // than the one from the CU.
414  auto oso_mod_time = std::chrono::time_point_cast<std::chrono::seconds>(
415  FileSystem::Instance().GetModificationTime(oso_file));
416  // A timestamp of 0 means that the linker was in deterministic mode. In
417  // that case, we should skip the check against the filesystem last
418  // modification timestamp, since it will never match.
419  if (comp_unit_info->oso_mod_time != llvm::sys::TimePoint<>() &&
420  oso_mod_time != comp_unit_info->oso_mod_time) {
421  obj_file->GetModule()->ReportError(
422  "debug map object file '%s' has changed (actual time is "
423  "%s, debug map time is %s"
424  ") since this executable was linked, file will be ignored",
425  oso_file.GetPath().c_str(), llvm::to_string(oso_mod_time).c_str(),
426  llvm::to_string(comp_unit_info->oso_mod_time).c_str());
427  return nullptr;
428  }
429 
430  } else {
431  const bool must_exist = true;
432 
433  if (!ObjectFile::SplitArchivePathWithObject(oso_path, oso_file,
434  oso_object, must_exist)) {
435  return nullptr;
436  }
437  }
438  // Always create a new module for .o files. Why? Because we use the debug
439  // map, to add new sections to each .o file and even though a .o file
440  // might not have changed, the sections that get added to the .o file can
441  // change.
442  ArchSpec oso_arch;
443  // Only adopt the architecture from the module (not the vendor or OS)
444  // since .o files for "i386-apple-ios" will historically show up as "i386
445  // -apple-macosx" due to the lack of a LC_VERSION_MIN_MACOSX or
446  // LC_VERSION_MIN_IPHONEOS load command...
447  oso_arch.SetTriple(m_objfile_sp->GetModule()
448  ->GetArchitecture()
449  .GetTriple()
450  .getArchName()
451  .str()
452  .c_str());
453  comp_unit_info->oso_sp->module_sp = std::make_shared<DebugMapModule>(
454  obj_file->GetModule(), GetCompUnitInfoIndex(comp_unit_info), oso_file,
455  oso_arch, oso_object ? &oso_object : nullptr, 0,
456  oso_object ? comp_unit_info->oso_mod_time : llvm::sys::TimePoint<>());
457  }
458  }
459  if (comp_unit_info->oso_sp)
460  return comp_unit_info->oso_sp->module_sp.get();
461  return nullptr;
462 }
463 
465  FileSpec &file_spec) {
466  if (oso_idx < m_compile_unit_infos.size()) {
467  if (m_compile_unit_infos[oso_idx].so_file) {
468  file_spec = m_compile_unit_infos[oso_idx].so_file;
469  return true;
470  }
471  }
472  return false;
473 }
474 
476  Module *oso_module = GetModuleByOSOIndex(oso_idx);
477  if (oso_module)
478  return oso_module->GetObjectFile();
479  return nullptr;
480 }
481 
484  return GetSymbolFile(*sc.comp_unit);
485 }
486 
489  CompileUnitInfo *comp_unit_info = GetCompUnitInfo(comp_unit);
490  if (comp_unit_info)
491  return GetSymbolFileByCompUnitInfo(comp_unit_info);
492  return nullptr;
493 }
494 
496  CompileUnitInfo *comp_unit_info) {
497  Module *oso_module = GetModuleByCompUnitInfo(comp_unit_info);
498  if (oso_module)
499  return oso_module->GetObjectFile();
500  return nullptr;
501 }
502 
504  const CompileUnitInfo *comp_unit_info) {
505  if (!m_compile_unit_infos.empty()) {
506  const CompileUnitInfo *first_comp_unit_info = &m_compile_unit_infos.front();
507  const CompileUnitInfo *last_comp_unit_info = &m_compile_unit_infos.back();
508  if (first_comp_unit_info <= comp_unit_info &&
509  comp_unit_info <= last_comp_unit_info)
510  return comp_unit_info - first_comp_unit_info;
511  }
512  return UINT32_MAX;
513 }
514 
517  unsigned size = m_compile_unit_infos.size();
518  if (oso_idx < size)
520  return nullptr;
521 }
522 
525  if (sym_file &&
527  return static_cast<SymbolFileDWARF *>(sym_file);
528  return nullptr;
529 }
530 
532  CompileUnitInfo *comp_unit_info) {
533  if (Module *oso_module = GetModuleByCompUnitInfo(comp_unit_info))
534  return GetSymbolFileAsSymbolFileDWARF(oso_module->GetSymbolFile());
535  return nullptr;
536 }
537 
539  // In order to get the abilities of this plug-in, we look at the list of
540  // N_OSO entries (object files) from the symbol table and make sure that
541  // these files exist and also contain valid DWARF. If we get any of that then
542  // we return the abilities of the first N_OSO's DWARF.
543 
544  const uint32_t oso_index_count = GetNumCompileUnits();
545  if (oso_index_count > 0) {
546  InitOSO();
547  if (!m_compile_unit_infos.empty()) {
548  return SymbolFile::CompileUnits | SymbolFile::Functions |
549  SymbolFile::Blocks | SymbolFile::GlobalVariables |
550  SymbolFile::LocalVariables | SymbolFile::VariableTypes |
551  SymbolFile::LineTables;
552  }
553  }
554  return 0;
555 }
556 
558  InitOSO();
559  return m_compile_unit_infos.size();
560 }
561 
563  CompUnitSP comp_unit_sp;
564  const uint32_t cu_count = GetNumCompileUnits();
565 
566  if (cu_idx < cu_count) {
567  Module *oso_module = GetModuleByCompUnitInfo(&m_compile_unit_infos[cu_idx]);
568  if (oso_module) {
569  FileSpec so_file_spec;
570  if (GetFileSpecForSO(cu_idx, so_file_spec)) {
571  // User zero as the ID to match the compile unit at offset zero in each
572  // .o file since each .o file can only have one compile unit for now.
573  lldb::user_id_t cu_id = 0;
574  m_compile_unit_infos[cu_idx].compile_unit_sp =
575  std::make_shared<CompileUnit>(
576  m_objfile_sp->GetModule(), nullptr, so_file_spec, cu_id,
578 
579  if (m_compile_unit_infos[cu_idx].compile_unit_sp) {
580  SetCompileUnitAtIndex(cu_idx,
581  m_compile_unit_infos[cu_idx].compile_unit_sp);
582  }
583  }
584  }
585  comp_unit_sp = m_compile_unit_infos[cu_idx].compile_unit_sp;
586  }
587 
588  return comp_unit_sp;
589 }
590 
593  return GetCompUnitInfo(*sc.comp_unit);
594 }
595 
598  const uint32_t cu_count = GetNumCompileUnits();
599  for (uint32_t i = 0; i < cu_count; ++i) {
600  if (&comp_unit == m_compile_unit_infos[i].compile_unit_sp.get())
601  return &m_compile_unit_infos[i];
602  }
603  return nullptr;
604 }
605 
607  const lldb_private::Module *module,
608  std::vector<CompileUnitInfo *> &cu_infos) {
609  const uint32_t cu_count = GetNumCompileUnits();
610  for (uint32_t i = 0; i < cu_count; ++i) {
612  cu_infos.push_back(&m_compile_unit_infos[i]);
613  }
614  return cu_infos.size();
615 }
616 
619  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
620  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
621  if (oso_dwarf)
622  return oso_dwarf->ParseLanguage(comp_unit);
623  return eLanguageTypeUnknown;
624 }
625 
627  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
628  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
629  if (oso_dwarf)
630  return oso_dwarf->ParseXcodeSDK(comp_unit);
631  return {};
632 }
633 
635  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
636  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
637  if (oso_dwarf)
638  return oso_dwarf->ParseFunctions(comp_unit);
639  return 0;
640 }
641 
643  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
644  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
645  if (oso_dwarf)
646  return oso_dwarf->ParseLineTable(comp_unit);
647  return false;
648 }
649 
651  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
652  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
653  if (oso_dwarf)
654  return oso_dwarf->ParseDebugMacros(comp_unit);
655  return false;
656 }
657 
659  CompileUnit &comp_unit,
660  llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
661  llvm::function_ref<bool(Module &)> f) {
662  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
663  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
664  if (oso_dwarf)
665  return oso_dwarf->ForEachExternalModule(comp_unit, visited_symbol_files, f);
666  return false;
667 }
668 
670  FileSpecList &support_files) {
671  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
672  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
673  if (oso_dwarf)
674  return oso_dwarf->ParseSupportFiles(comp_unit, support_files);
675  return false;
676 }
677 
679  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
680  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
681  if (oso_dwarf)
682  return oso_dwarf->ParseIsOptimized(comp_unit);
683  return false;
684 }
685 
687  const SymbolContext &sc, std::vector<SourceModule> &imported_modules) {
688  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
689  SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
690  if (oso_dwarf)
691  return oso_dwarf->ParseImportedModules(sc, imported_modules);
692  return false;
693 }
694 
696  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
697  CompileUnit *comp_unit = func.GetCompileUnit();
698  if (!comp_unit)
699  return 0;
700 
701  SymbolFileDWARF *oso_dwarf = GetSymbolFile(*comp_unit);
702  if (oso_dwarf)
703  return oso_dwarf->ParseBlocksRecursive(func);
704  return 0;
705 }
706 
708  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
709  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
710  if (oso_dwarf)
711  return oso_dwarf->ParseTypes(comp_unit);
712  return 0;
713 }
714 
715 size_t
717  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
718  SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
719  if (oso_dwarf)
720  return oso_dwarf->ParseVariablesForContext(sc);
721  return 0;
722 }
723 
725  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
726  const uint64_t oso_idx = GetOSOIndexFromUserID(type_uid);
727  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
728  if (oso_dwarf)
729  return oso_dwarf->ResolveTypeUID(type_uid);
730  return nullptr;
731 }
732 
733 llvm::Optional<SymbolFile::ArrayInfo>
735  lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx) {
736  const uint64_t oso_idx = GetOSOIndexFromUserID(type_uid);
737  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
738  if (oso_dwarf)
739  return oso_dwarf->GetDynamicArrayInfoForUID(type_uid, exe_ctx);
740  return llvm::None;
741 }
742 
744  bool success = false;
745  if (compiler_type) {
746  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
747  if (oso_dwarf->HasForwardDeclForClangType(compiler_type)) {
748  oso_dwarf->CompleteType(compiler_type);
749  success = true;
750  return true;
751  }
752  return false;
753  });
754  }
755  return success;
756 }
757 
758 uint32_t
760  SymbolContextItem resolve_scope,
761  SymbolContext &sc) {
762  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
763  uint32_t resolved_flags = 0;
764  Symtab *symtab = m_objfile_sp->GetSymtab();
765  if (symtab) {
766  const addr_t exe_file_addr = exe_so_addr.GetFileAddress();
767 
768  const DebugMap::Entry *debug_map_entry =
769  m_debug_map.FindEntryThatContains(exe_file_addr);
770  if (debug_map_entry) {
771 
772  sc.symbol =
773  symtab->SymbolAtIndex(debug_map_entry->data.GetExeSymbolIndex());
774 
775  if (sc.symbol != nullptr) {
776  resolved_flags |= eSymbolContextSymbol;
777 
778  uint32_t oso_idx = 0;
779  CompileUnitInfo *comp_unit_info =
781  if (comp_unit_info) {
782  comp_unit_info->GetFileRangeMap(this);
783  Module *oso_module = GetModuleByCompUnitInfo(comp_unit_info);
784  if (oso_module) {
785  lldb::addr_t oso_file_addr =
786  exe_file_addr - debug_map_entry->GetRangeBase() +
787  debug_map_entry->data.GetOSOFileAddress();
788  Address oso_so_addr;
789  if (oso_module->ResolveFileAddress(oso_file_addr, oso_so_addr)) {
790  resolved_flags |=
791  oso_module->GetSymbolFile()->ResolveSymbolContext(
792  oso_so_addr, resolve_scope, sc);
793  }
794  }
795  }
796  }
797  }
798  }
799  return resolved_flags;
800 }
801 
803  const SourceLocationSpec &src_location_spec,
804  SymbolContextItem resolve_scope, SymbolContextList &sc_list) {
805  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
806  const uint32_t initial = sc_list.GetSize();
807  const uint32_t cu_count = GetNumCompileUnits();
808 
809  for (uint32_t i = 0; i < cu_count; ++i) {
810  // If we are checking for inlines, then we need to look through all compile
811  // units no matter if "file_spec" matches.
812  bool resolve = src_location_spec.GetCheckInlines();
813 
814  if (!resolve) {
815  FileSpec so_file_spec;
816  if (GetFileSpecForSO(i, so_file_spec))
817  resolve =
818  FileSpec::Match(src_location_spec.GetFileSpec(), so_file_spec);
819  }
820  if (resolve) {
822  if (oso_dwarf)
823  oso_dwarf->ResolveSymbolContext(src_location_spec, resolve_scope,
824  sc_list);
825  }
826  }
827  return sc_list.GetSize() - initial;
828 }
829 
831  ConstString name, const CompilerDeclContext &parent_decl_ctx,
832  const std::vector<uint32_t>
833  &indexes, // Indexes into the symbol table that match "name"
834  uint32_t max_matches, VariableList &variables) {
835  const size_t match_count = indexes.size();
836  for (size_t i = 0; i < match_count; ++i) {
837  uint32_t oso_idx;
838  CompileUnitInfo *comp_unit_info =
839  GetCompileUnitInfoForSymbolWithIndex(indexes[i], &oso_idx);
840  if (comp_unit_info) {
841  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
842  if (oso_dwarf) {
843  oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches,
844  variables);
845  if (variables.GetSize() > max_matches)
846  break;
847  }
848  }
849  }
850 }
851 
853  ConstString name, const CompilerDeclContext &parent_decl_ctx,
854  uint32_t max_matches, VariableList &variables) {
855  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
856  uint32_t total_matches = 0;
857 
858  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
859  const uint32_t old_size = variables.GetSize();
860  oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches,
861  variables);
862  const uint32_t oso_matches = variables.GetSize() - old_size;
863  if (oso_matches > 0) {
864  total_matches += oso_matches;
865 
866  // Are we getting all matches?
867  if (max_matches == UINT32_MAX)
868  return false; // Yep, continue getting everything
869 
870  // If we have found enough matches, lets get out
871  if (max_matches >= total_matches)
872  return true;
873 
874  // Update the max matches for any subsequent calls to find globals in any
875  // other object files with DWARF
876  max_matches -= oso_matches;
877  }
878 
879  return false;
880  });
881 }
882 
884  const RegularExpression &regex, uint32_t max_matches,
885  VariableList &variables) {
886  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
887  uint32_t total_matches = 0;
888  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
889  const uint32_t old_size = variables.GetSize();
890  oso_dwarf->FindGlobalVariables(regex, max_matches, variables);
891 
892  const uint32_t oso_matches = variables.GetSize() - old_size;
893  if (oso_matches > 0) {
894  total_matches += oso_matches;
895 
896  // Are we getting all matches?
897  if (max_matches == UINT32_MAX)
898  return false; // Yep, continue getting everything
899 
900  // If we have found enough matches, lets get out
901  if (max_matches >= total_matches)
902  return true;
903 
904  // Update the max matches for any subsequent calls to find globals in any
905  // other object files with DWARF
906  max_matches -= oso_matches;
907  }
908 
909  return false;
910  });
911 }
912 
914  uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info) {
915  const uint32_t symbol_idx = *symbol_idx_ptr;
916 
917  if (symbol_idx < comp_unit_info->first_symbol_index)
918  return -1;
919 
920  if (symbol_idx <= comp_unit_info->last_symbol_index)
921  return 0;
922 
923  return 1;
924 }
925 
927  user_id_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info) {
928  const user_id_t symbol_id = *symbol_idx_ptr;
929 
930  if (symbol_id < comp_unit_info->first_symbol_id)
931  return -1;
932 
933  if (symbol_id <= comp_unit_info->last_symbol_id)
934  return 0;
935 
936  return 1;
937 }
938 
941  uint32_t symbol_idx, uint32_t *oso_idx_ptr) {
942  const uint32_t oso_index_count = m_compile_unit_infos.size();
943  CompileUnitInfo *comp_unit_info = nullptr;
944  if (oso_index_count) {
945  comp_unit_info = (CompileUnitInfo *)bsearch(
946  &symbol_idx, &m_compile_unit_infos[0], m_compile_unit_infos.size(),
947  sizeof(CompileUnitInfo),
948  (ComparisonFunction)SymbolContainsSymbolWithIndex);
949  }
950 
951  if (oso_idx_ptr) {
952  if (comp_unit_info != nullptr)
953  *oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
954  else
955  *oso_idx_ptr = UINT32_MAX;
956  }
957  return comp_unit_info;
958 }
959 
962  user_id_t symbol_id, uint32_t *oso_idx_ptr) {
963  const uint32_t oso_index_count = m_compile_unit_infos.size();
964  CompileUnitInfo *comp_unit_info = nullptr;
965  if (oso_index_count) {
966  comp_unit_info = (CompileUnitInfo *)::bsearch(
967  &symbol_id, &m_compile_unit_infos[0], m_compile_unit_infos.size(),
968  sizeof(CompileUnitInfo),
969  (ComparisonFunction)SymbolContainsSymbolWithID);
970  }
971 
972  if (oso_idx_ptr) {
973  if (comp_unit_info != nullptr)
974  *oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
975  else
976  *oso_idx_ptr = UINT32_MAX;
977  }
978  return comp_unit_info;
979 }
980 
981 static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp,
982  SymbolContextList &sc_list,
983  uint32_t start_idx) {
984  // We found functions in .o files. Not all functions in the .o files will
985  // have made it into the final output file. The ones that did make it into
986  // the final output file will have a section whose module matches the module
987  // from the ObjectFile for this SymbolFile. When the modules don't match,
988  // then we have something that was in a .o file, but doesn't map to anything
989  // in the final executable.
990  uint32_t i = start_idx;
991  while (i < sc_list.GetSize()) {
992  SymbolContext sc;
993  sc_list.GetContextAtIndex(i, sc);
994  if (sc.function) {
995  const SectionSP section_sp(
997  if (section_sp->GetModule() != module_sp) {
998  sc_list.RemoveContextAtIndex(i);
999  continue;
1000  }
1001  }
1002  ++i;
1003  }
1004 }
1005 
1007  ConstString name, const CompilerDeclContext &parent_decl_ctx,
1008  FunctionNameType name_type_mask, bool include_inlines,
1009  SymbolContextList &sc_list) {
1010  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1011  LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::FindFunctions (name = %s)",
1012  name.GetCString());
1013 
1014  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1015  uint32_t sc_idx = sc_list.GetSize();
1016  oso_dwarf->FindFunctions(name, parent_decl_ctx, name_type_mask,
1017  include_inlines, sc_list);
1018  if (!sc_list.IsEmpty()) {
1019  RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
1020  sc_idx);
1021  }
1022  return false;
1023  });
1024 }
1025 
1027  bool include_inlines,
1028  SymbolContextList &sc_list) {
1029  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1030  LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::FindFunctions (regex = '%s')",
1031  regex.GetText().str().c_str());
1032 
1033  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1034  uint32_t sc_idx = sc_list.GetSize();
1035 
1036  oso_dwarf->FindFunctions(regex, include_inlines, sc_list);
1037  if (!sc_list.IsEmpty()) {
1038  RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
1039  sc_idx);
1040  }
1041  return false;
1042  });
1043 }
1044 
1046  lldb::TypeClass type_mask,
1047  TypeList &type_list) {
1048  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1049  LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::GetTypes (type_mask = 0x%8.8x)",
1050  type_mask);
1051 
1052  SymbolFileDWARF *oso_dwarf = nullptr;
1053  if (sc_scope) {
1054  SymbolContext sc;
1055  sc_scope->CalculateSymbolContext(&sc);
1056 
1057  CompileUnitInfo *cu_info = GetCompUnitInfo(sc);
1058  if (cu_info) {
1059  oso_dwarf = GetSymbolFileByCompUnitInfo(cu_info);
1060  if (oso_dwarf)
1061  oso_dwarf->GetTypes(sc_scope, type_mask, type_list);
1062  }
1063  } else {
1064  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1065  oso_dwarf->GetTypes(sc_scope, type_mask, type_list);
1066  return false;
1067  });
1068  }
1069 }
1070 
1071 std::vector<std::unique_ptr<lldb_private::CallEdge>>
1073  uint32_t oso_idx = GetOSOIndexFromUserID(func_id.GetID());
1074  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
1075  if (oso_dwarf)
1076  return oso_dwarf->ParseCallEdgesInFunction(func_id);
1077  return {};
1078 }
1079 
1081  const DWARFDeclContext &die_decl_ctx) {
1082  TypeSP type_sp;
1083  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1084  type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die_decl_ctx);
1085  return ((bool)type_sp);
1086  });
1087  return type_sp;
1088 }
1089 
1091  SymbolFileDWARF *skip_dwarf_oso) {
1094  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1095  if (skip_dwarf_oso != oso_dwarf &&
1096  oso_dwarf->Supports_DW_AT_APPLE_objc_complete_type(nullptr)) {
1097  m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
1098  return true;
1099  }
1100  return false;
1101  });
1102  }
1104 }
1105 
1107  const DWARFDIE &die, ConstString type_name,
1108  bool must_be_implementation) {
1109  // If we have a debug map, we will have an Objective-C symbol whose name is
1110  // the type name and whose type is eSymbolTypeObjCClass. If we can find that
1111  // symbol and find its containing parent, we can locate the .o file that will
1112  // contain the implementation definition since it will be scoped inside the
1113  // N_SO and we can then locate the SymbolFileDWARF that corresponds to that
1114  // N_SO.
1115  SymbolFileDWARF *oso_dwarf = nullptr;
1116  TypeSP type_sp;
1117  ObjectFile *module_objfile = m_objfile_sp->GetModule()->GetObjectFile();
1118  if (module_objfile) {
1119  Symtab *symtab = module_objfile->GetSymtab();
1120  if (symtab) {
1121  Symbol *objc_class_symbol = symtab->FindFirstSymbolWithNameAndType(
1122  type_name, eSymbolTypeObjCClass, Symtab::eDebugAny,
1123  Symtab::eVisibilityAny);
1124  if (objc_class_symbol) {
1125  // Get the N_SO symbol that contains the objective C class symbol as
1126  // this should be the .o file that contains the real definition...
1127  const Symbol *source_file_symbol = symtab->GetParent(objc_class_symbol);
1128 
1129  if (source_file_symbol &&
1130  source_file_symbol->GetType() == eSymbolTypeSourceFile) {
1131  const uint32_t source_file_symbol_idx =
1132  symtab->GetIndexForSymbol(source_file_symbol);
1133  if (source_file_symbol_idx != UINT32_MAX) {
1134  CompileUnitInfo *compile_unit_info =
1135  GetCompileUnitInfoForSymbolWithIndex(source_file_symbol_idx,
1136  nullptr);
1137  if (compile_unit_info) {
1138  oso_dwarf = GetSymbolFileByCompUnitInfo(compile_unit_info);
1139  if (oso_dwarf) {
1140  TypeSP type_sp(oso_dwarf->FindCompleteObjCDefinitionTypeForDIE(
1141  die, type_name, must_be_implementation));
1142  if (type_sp) {
1143  return type_sp;
1144  }
1145  }
1146  }
1147  }
1148  }
1149  }
1150  }
1151  }
1152 
1153  // Only search all .o files for the definition if we don't need the
1154  // implementation because otherwise, with a valid debug map we should have
1155  // the ObjC class symbol and the code above should have found it.
1156  if (!must_be_implementation) {
1157  TypeSP type_sp;
1158 
1159  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1160  type_sp = oso_dwarf->FindCompleteObjCDefinitionTypeForDIE(
1161  die, type_name, must_be_implementation);
1162  return (bool)type_sp;
1163  });
1164 
1165  return type_sp;
1166  }
1167  return TypeSP();
1168 }
1169 
1171  ConstString name, const CompilerDeclContext &parent_decl_ctx,
1172  uint32_t max_matches,
1173  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
1174  TypeMap &types) {
1175  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1176  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1177  oso_dwarf->FindTypes(name, parent_decl_ctx, max_matches,
1178  searched_symbol_files, types);
1179  return types.GetSize() >= max_matches;
1180  });
1181 }
1182 
1184  llvm::ArrayRef<CompilerContext> context, LanguageSet languages,
1185  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
1186  TypeMap &types) {
1188  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1189  oso_dwarf->FindTypes(context, languages, searched_symbol_files, types);
1190  return false;
1191  });
1192 }
1193 
1196  const CompilerDeclContext &parent_decl_ctx) {
1197  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1198  CompilerDeclContext matching_namespace;
1199 
1200  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1201  matching_namespace = oso_dwarf->FindNamespace(name, parent_decl_ctx);
1202 
1203  return (bool)matching_namespace;
1204  });
1205 
1206  return matching_namespace;
1207 }
1208 
1210  ForEachSymbolFile([&s](SymbolFileDWARF *oso_dwarf) -> bool {
1211  oso_dwarf->DumpClangAST(s);
1212  // The underlying assumption is that DumpClangAST(...) will obtain the
1213  // AST from the underlying TypeSystem and therefore we only need to do
1214  // this once and can stop after the first iteration hence we return true.
1215  return true;
1216  });
1217 }
1218 
1219 lldb::CompUnitSP
1221  if (oso_dwarf) {
1222  const uint32_t cu_count = GetNumCompileUnits();
1223  for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1224  SymbolFileDWARF *oso_symfile =
1226  if (oso_symfile == oso_dwarf) {
1227  if (!m_compile_unit_infos[cu_idx].compile_unit_sp)
1228  m_compile_unit_infos[cu_idx].compile_unit_sp =
1229  ParseCompileUnitAtIndex(cu_idx);
1230 
1231  return m_compile_unit_infos[cu_idx].compile_unit_sp;
1232  }
1233  }
1234  }
1235  llvm_unreachable("this shouldn't happen");
1236 }
1237 
1240  if (oso_dwarf) {
1241  const uint32_t cu_count = GetNumCompileUnits();
1242  for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1243  SymbolFileDWARF *oso_symfile =
1245  if (oso_symfile == oso_dwarf) {
1246  return &m_compile_unit_infos[cu_idx];
1247  }
1248  }
1249  }
1250  return nullptr;
1251 }
1252 
1254  const CompUnitSP &cu_sp) {
1255  if (oso_dwarf) {
1256  const uint32_t cu_count = GetNumCompileUnits();
1257  for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1258  SymbolFileDWARF *oso_symfile =
1260  if (oso_symfile == oso_dwarf) {
1261  if (m_compile_unit_infos[cu_idx].compile_unit_sp) {
1262  assert(m_compile_unit_infos[cu_idx].compile_unit_sp.get() ==
1263  cu_sp.get());
1264  } else {
1265  m_compile_unit_infos[cu_idx].compile_unit_sp = cu_sp;
1266  SetCompileUnitAtIndex(cu_idx, cu_sp);
1267  }
1268  }
1269  }
1270  }
1271 }
1272 
1275  const uint64_t oso_idx = GetOSOIndexFromUserID(type_uid);
1276  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
1277  if (oso_dwarf)
1278  return oso_dwarf->GetDeclContextForUID(type_uid);
1279  return CompilerDeclContext();
1280 }
1281 
1284  const uint64_t oso_idx = GetOSOIndexFromUserID(type_uid);
1285  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
1286  if (oso_dwarf)
1287  return oso_dwarf->GetDeclContextContainingUID(type_uid);
1288  return CompilerDeclContext();
1289 }
1290 
1293  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1294  oso_dwarf->ParseDeclsForContext(decl_ctx);
1295  return true; // Keep iterating
1296  });
1297 }
1298 
1300  lldb::addr_t exe_file_addr,
1301  lldb::addr_t exe_byte_size,
1302  lldb::addr_t oso_file_addr,
1303  lldb::addr_t oso_byte_size) {
1304  const uint32_t debug_map_idx =
1305  m_debug_map.FindEntryIndexThatContains(exe_file_addr);
1306  if (debug_map_idx != UINT32_MAX) {
1307  DebugMap::Entry *debug_map_entry =
1308  m_debug_map.FindEntryThatContains(exe_file_addr);
1309  debug_map_entry->data.SetOSOFileAddress(oso_file_addr);
1310  addr_t range_size = std::min<addr_t>(exe_byte_size, oso_byte_size);
1311  if (range_size == 0) {
1312  range_size = std::max<addr_t>(exe_byte_size, oso_byte_size);
1313  if (range_size == 0)
1314  range_size = 1;
1315  }
1316  cu_info->file_range_map.Append(
1317  FileRangeMap::Entry(oso_file_addr, range_size, exe_file_addr));
1318  return true;
1319  }
1320  return false;
1321 }
1322 
1324  cu_info->file_range_map.Sort();
1325 #if defined(DEBUG_OSO_DMAP)
1326  const FileRangeMap &oso_file_range_map = cu_info->GetFileRangeMap(this);
1327  const size_t n = oso_file_range_map.GetSize();
1328  printf("SymbolFileDWARFDebugMap::FinalizeOSOFileRanges (cu_info = %p) %s\n",
1329  cu_info, cu_info->oso_sp->module_sp->GetFileSpec().GetPath().c_str());
1330  for (size_t i = 0; i < n; ++i) {
1331  const FileRangeMap::Entry &entry = oso_file_range_map.GetEntryRef(i);
1332  printf("oso [0x%16.16" PRIx64 " - 0x%16.16" PRIx64
1333  ") ==> exe [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")\n",
1334  entry.GetRangeBase(), entry.GetRangeEnd(), entry.data,
1335  entry.data + entry.GetByteSize());
1336  }
1337 #endif
1338 }
1339 
1342  lldb::addr_t oso_file_addr) {
1343  CompileUnitInfo *cu_info = GetCompileUnitInfo(oso_symfile);
1344  if (cu_info) {
1345  const FileRangeMap::Entry *oso_range_entry =
1346  cu_info->GetFileRangeMap(this).FindEntryThatContains(oso_file_addr);
1347  if (oso_range_entry) {
1348  const DebugMap::Entry *debug_map_entry =
1349  m_debug_map.FindEntryThatContains(oso_range_entry->data);
1350  if (debug_map_entry) {
1351  const lldb::addr_t offset =
1352  oso_file_addr - oso_range_entry->GetRangeBase();
1353  const lldb::addr_t exe_file_addr =
1354  debug_map_entry->GetRangeBase() + offset;
1355  return exe_file_addr;
1356  }
1357  }
1358  }
1359  return LLDB_INVALID_ADDRESS;
1360 }
1361 
1363  // Make sure this address hasn't been fixed already
1364  Module *exe_module = GetObjectFile()->GetModule().get();
1365  Module *addr_module = addr.GetModule().get();
1366  if (addr_module == exe_module)
1367  return true; // Address is already in terms of the main executable module
1368 
1371  if (cu_info) {
1372  const lldb::addr_t oso_file_addr = addr.GetFileAddress();
1373  const FileRangeMap::Entry *oso_range_entry =
1374  cu_info->GetFileRangeMap(this).FindEntryThatContains(oso_file_addr);
1375  if (oso_range_entry) {
1376  const DebugMap::Entry *debug_map_entry =
1377  m_debug_map.FindEntryThatContains(oso_range_entry->data);
1378  if (debug_map_entry) {
1379  const lldb::addr_t offset =
1380  oso_file_addr - oso_range_entry->GetRangeBase();
1381  const lldb::addr_t exe_file_addr =
1382  debug_map_entry->GetRangeBase() + offset;
1383  return exe_module->ResolveFileAddress(exe_file_addr, addr);
1384  }
1385  }
1386  }
1387  return true;
1388 }
1389 
1391  LineTable *line_table) {
1392  CompileUnitInfo *cu_info = GetCompileUnitInfo(oso_dwarf);
1393  if (cu_info)
1394  return line_table->LinkLineTable(cu_info->GetFileRangeMap(this));
1395  return nullptr;
1396 }
1397 
1398 size_t
1400  DWARFDebugAranges *debug_aranges) {
1401  size_t num_line_entries_added = 0;
1402  if (debug_aranges && dwarf2Data) {
1403  CompileUnitInfo *compile_unit_info = GetCompileUnitInfo(dwarf2Data);
1404  if (compile_unit_info) {
1405  const FileRangeMap &file_range_map =
1406  compile_unit_info->GetFileRangeMap(this);
1407  for (size_t idx = 0; idx < file_range_map.GetSize(); idx++) {
1408  const FileRangeMap::Entry *entry = file_range_map.GetEntryAtIndex(idx);
1409  if (entry) {
1410  debug_aranges->AppendRange(dwarf2Data->GetID(), entry->GetRangeBase(),
1411  entry->GetRangeEnd());
1412  num_line_entries_added++;
1413  }
1414  }
1415  }
1416  }
1417  return num_line_entries_added;
1418 }
1419 
1421  ModuleList oso_modules;
1422  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1423  ObjectFile *oso_objfile = oso_dwarf->GetObjectFile();
1424  if (oso_objfile) {
1425  ModuleSP module_sp = oso_objfile->GetModule();
1426  if (module_sp)
1427  oso_modules.Append(module_sp);
1428  }
1429  return false; // Keep iterating
1430  });
1431  return oso_modules;
1432 }
SymbolFileDWARFDebugMap::ParseCompileUnitAtIndex
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
Definition: SymbolFileDWARFDebugMap.cpp:562
lldb_private::SourceLocationSpec::GetFileSpec
FileSpec GetFileSpec() const
Definition: SourceLocationSpec.h:166
RegularExpression.h
SymbolFileDWARFDebugMap::GetObjectFileByOSOIndex
lldb_private::ObjectFile * GetObjectFileByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:475
SymbolFileDWARFDebugMap::GetSymbolFile
SymbolFileDWARF * GetSymbolFile(const lldb_private::SymbolContext &sc)
Definition: SymbolFileDWARFDebugMap.cpp:483
lldb_private::AddressRange::GetBaseAddress
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:209
SymbolFileDWARFDebugMap::CompileUnitInfo::file_range_map
FileRangeMap file_range_map
Definition: SymbolFileDWARFDebugMap.h:178
SymbolFileDWARFDebugMap::m_glob_indexes
std::vector< uint32_t > m_glob_indexes
Definition: SymbolFileDWARFDebugMap.h:311
SymbolFileDWARFDebugMap.h
lldb_private::Module::GetObjectFile
virtual ObjectFile * GetObjectFile()
Get the object file representation for the current architecture.
Definition: Module.cpp:1260
lldb_private::SymbolFile
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:45
SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo
lldb_private::ObjectFile * GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:495
lldb_private::Range::GetRangeBase
BaseType GetRangeBase() const
Definition: RangeMap.h:46
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
SymbolFileDWARFDebugMap::GetCompUnitInfo
CompileUnitInfo * GetCompUnitInfo(const lldb_private::SymbolContext &sc)
Definition: SymbolFileDWARFDebugMap.cpp:592
lldb_private::SymbolContext::comp_unit
CompileUnit * comp_unit
The CompileUnit for a given query.
Definition: SymbolContext.h:319
SymbolFileDWARFDebugMap::ParseXcodeSDK
lldb_private::XcodeSDK ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
Definition: SymbolFileDWARFDebugMap.cpp:626
SymbolFileDWARFDebugMap::SetCompileUnit
void SetCompileUnit(SymbolFileDWARF *oso_dwarf, const lldb::CompUnitSP &cu_sp)
Definition: SymbolFileDWARFDebugMap.cpp:1253
LLDB_SCOPED_TIMERF
#define LLDB_SCOPED_TIMERF(...)
Definition: Timer.h:86
lldb_private::ArchSpec
Definition: ArchSpec.h:33
SymbolFileDWARFDebugMap::m_flags
std::bitset< kNumFlags > m_flags
Definition: SymbolFileDWARFDebugMap.h:308
lldb_private::RegularExpression
Definition: RegularExpression.h:18
FileSystem.h
SymbolFileDWARFDebugMap::FindNamespace
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx) override
Definition: SymbolFileDWARFDebugMap.cpp:1194
lldb::eSymbolTypeCode
@ eSymbolTypeCode
Definition: lldb-enumerations.h:622
lldb_private::Symtab::AppendSymbolIndexesWithTypeAndFlagsValue
uint32_t AppendSymbolIndexesWithTypeAndFlagsValue(lldb::SymbolType symbol_type, uint32_t flags_value, std::vector< uint32_t > &indexes, uint32_t start_idx=0, uint32_t end_index=UINT32_MAX) const
Definition: Symtab.cpp:505
lldb_private::RangeDataVector::GetEntryRef
Entry & GetEntryRef(size_t i)
Definition: RangeMap.h:526
CompileUnit.h
SymbolFileDWARF::ParseLineTable
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:1113
lldb_private::Function::GetAddressRange
const AddressRange & GetAddressRange()
Definition: Function.h:457
SymbolFileDWARF::ResolveTypeUID
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
Definition: SymbolFileDWARF.cpp:1463
TypeMap.h
SymbolFileDWARF::ParseFunctions
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:916
lldb_private::Symbol
Definition: Symbol.h:20
lldb_private::Symbol::ValueIsAddress
bool ValueIsAddress() const
Definition: Symbol.cpp:117
SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF
static SymbolFileDWARF * GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file)
Definition: SymbolFileDWARFDebugMap.cpp:524
DWARFDebugAranges
Definition: DWARFDebugAranges.h:16
lldb_private::SourceLocationSpec
Definition: SourceLocationSpec.h:27
lldb_private::Symtab::GetParent
const Symbol * GetParent(Symbol *symbol) const
Get the parent symbol for the given symbol.
Definition: Symtab.cpp:1148
SymbolFileDWARF::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: SymbolFileDWARF.h:87
SymbolFileDWARFDebugMap::GetTypes
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
Definition: SymbolFileDWARFDebugMap.cpp:1045
SymbolFileDWARFDebugMap::CompleteType
bool CompleteType(lldb_private::CompilerType &compiler_type) override
Definition: SymbolFileDWARFDebugMap.cpp:743
SymbolFileDWARF::ParseLanguage
lldb::LanguageType ParseLanguage(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:879
lldb_private::UserID
Definition: UserID.h:31
SymbolFileDWARFDebugMap::SymbolContainsSymbolWithID
static int SymbolContainsSymbolWithID(lldb::user_id_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:926
SymbolFileDWARFDebugMap::ParseBlocksRecursive
size_t ParseBlocksRecursive(lldb_private::Function &func) override
Definition: SymbolFileDWARFDebugMap.cpp:695
lldb_private::eLazyBoolYes
@ eLazyBoolYes
Definition: lldb-private-enumerations.h:115
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:343
lldb_private::SymbolFile::GetModuleMutex
virtual std::recursive_mutex & GetModuleMutex() const
Symbols file subclasses should override this to return the Module that owns the TypeSystem that this ...
Definition: SymbolFile.cpp:35
Module.h
SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
Definition: SymbolFileDWARFDebugMap.cpp:1106
SymbolFileDWARFDebugMap::GetOSOIndexFromUserID
static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid)
Definition: SymbolFileDWARFDebugMap.h:195
lldb_private::XcodeSDK
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition: XcodeSDK.h:24
SymbolFileDWARF::ParseImportedModules
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
Definition: SymbolFileDWARF.cpp:1058
SymbolFileDWARF
Definition: SymbolFileDWARF.h:59
lldb_private::RangeDataVector::Sort
void Sort()
Definition: RangeMap.h:448
lldb_private::VariableList::GetSize
size_t GetSize() const
Definition: VariableList.cpp:165
SymbolFileDWARFDebugMap::ParseLineTable
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:642
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
SymbolFileDWARF.h
lldb::eSymbolTypeData
@ eSymbolTypeData
Definition: lldb-enumerations.h:624
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
SymbolFileDWARFDebugMap::InitializeObject
void InitializeObject() override
Initialize the SymbolFile object.
Definition: SymbolFileDWARFDebugMap.cpp:246
lldb_private::Module::GetSymbolFile
virtual SymbolFile * GetSymbolFile(bool can_create=true, Stream *feedback_strm=nullptr)
Get the module's symbol file.
Definition: Module.cpp:1045
lldb_private::SymbolContextList::GetContextAtIndex
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
Definition: SymbolContext.cpp:1260
lldb_private::Module
Definition: Module.h:85
SymbolFileDWARFDebugMap::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso)
Definition: SymbolFileDWARFDebugMap.cpp:1090
lldb_private::ConstString::AsCString
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:193
SymbolFileDWARFDebugMap::m_oso_map
std::map< std::pair< lldb_private::ConstString, llvm::sys::TimePoint<> >, OSOInfoSP > m_oso_map
Definition: SymbolFileDWARFDebugMap.h:314
SymbolFileDWARFDebugMap::GetDynamicArrayInfoForUID
llvm::Optional< ArrayInfo > GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx) override
If type_uid points to an array type, return its characteristics.
Definition: SymbolFileDWARFDebugMap.cpp:734
SymbolFileDWARFDebugMap::CreateInstance
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileDWARFDebugMap.cpp:235
SymbolFileDWARFDebugMap::CompileUnitInfo
Definition: SymbolFileDWARFDebugMap.h:168
lldb_private::RangeDataVector::GetEntryAtIndex
const Entry * GetEntryAtIndex(size_t i) const
Definition: RangeMap.h:516
SymbolFileDWARF::SetDebugMapModule
void SetDebugMapModule(const lldb::ModuleSP &module_sp)
Definition: SymbolFileDWARF.h:441
lldb_private::UserID::SetID
void SetID(lldb::user_id_t uid)
Set accessor for the user ID.
Definition: UserID.h:53
lldb_private::Stream
Definition: Stream.h:28
lldb_private::RangeData
Definition: RangeMap.h:410
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::Symtab::SymbolAtIndex
Symbol * SymbolAtIndex(size_t idx)
Definition: Symtab.cpp:217
SymbolFileDWARF::FindNamespace
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx) override
Definition: SymbolFileDWARF.cpp:2533
SymbolFileDWARFDebugMap::ParseCallEdgesInFunction
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(lldb_private::UserID func_id) override
Definition: SymbolFileDWARFDebugMap.cpp:1072
RangeMap.h
SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu)
Definition: SymbolFileDWARF.cpp:2680
SymbolFileDWARFDebugMap::ParseImportedModules
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
Definition: SymbolFileDWARFDebugMap.cpp:686
lldb_private::SymbolFileCommon
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:374
SymbolFileDWARFDebugMap::ForEachExternalModule
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
Definition: SymbolFileDWARFDebugMap.cpp:658
lldb_private::SymbolContext
Definition: SymbolContext.h:33
Section.h
lldb_private::TypeMap::GetSize
uint32_t GetSize() const
Definition: TypeMap.cpp:75
SymbolFileDWARFDebugMap::AddOSOARanges
size_t AddOSOARanges(SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges)
Definition: SymbolFileDWARFDebugMap.cpp:1399
lldb_private::PluginInterface::GetPluginName
virtual llvm::StringRef GetPluginName()=0
SymbolFileDWARF::GetDynamicArrayInfoForUID
llvm::Optional< ArrayInfo > GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx) override
If type_uid points to an array type, return its characteristics.
Definition: SymbolFileDWARF.cpp:1475
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex
CompileUnitInfo * GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx, uint32_t *oso_idx_ptr)
Definition: SymbolFileDWARFDebugMap.cpp:940
lldb_private::VariableList
Definition: VariableList.h:18
DebugMapModule::m_cu_idx
const uint32_t m_cu_idx
Definition: SymbolFileDWARFDebugMap.cpp:219
SymbolFileDWARF::FindGlobalVariables
void FindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) override
Definition: SymbolFileDWARF.cpp:2125
RemoveFunctionsWithModuleNotEqualTo
static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp, SymbolContextList &sc_list, uint32_t start_idx)
Definition: SymbolFileDWARFDebugMap.cpp:981
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, OSOEntry >::Entry
RangeData< lldb::addr_t, lldb::addr_t, OSOEntry > Entry
Definition: RangeMap.h:438
SymbolFileDWARFDebugMap::GetDeclContextForUID
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARFDebugMap.cpp:1274
lldb_private::CompileUnit
Definition: CompileUnit.h:38
DWARFDIE
Definition: DWARFDIE.h:16
SymbolFileDWARFDebugMap::ParseDeclsForContext
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
Definition: SymbolFileDWARFDebugMap.cpp:1291
SymbolFileDWARFDebugMap::ParseIsOptimized
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:678
SymbolFileDWARFDebugMap::GetCompUnitInfoIndex
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:503
lldb_private::ObjectFile::GetSymtab
Symtab * GetSymtab()
Gets the symbol table for the currently selected architecture (and object for archives).
Definition: ObjectFile.cpp:725
lldb_private::Symtab::FindFirstSymbolWithNameAndType
Symbol * FindFirstSymbolWithNameAndType(ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility)
Definition: Symtab.cpp:857
lldb_private::RangeDataVector::FindEntryThatContains
Entry * FindEntryThatContains(B addr)
Definition: RangeMap.h:551
lldb_private::FileSpec
Definition: FileSpec.h:56
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_sp
OSOInfoSP oso_sp
Definition: SymbolFileDWARFDebugMap.h:172
SymbolFileDWARF::ResolveSymbolContext
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
lldb_private::SymbolContext::symbol
Symbol * symbol
The Symbol for a given query.
Definition: SymbolContext.h:323
SymbolFileDWARFDebugMap::Terminate
static void Terminate()
Definition: SymbolFileDWARFDebugMap.cpp:227
lldb_private::SymbolFileCommon::m_objfile_sp
lldb::ObjectFileSP m_objfile_sp
Definition: SymbolFile.h:444
lldb_private::LineTable
Definition: LineTable.h:40
SymbolFileDWARFDebugMap::FindGlobalVariables
void FindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) override
Definition: SymbolFileDWARFDebugMap.cpp:852
lldb_private::Function
Definition: Function.h:409
lldb_private::RangeDataVector::Append
void Append(const Entry &entry)
Definition: RangeMap.h:446
SymbolFileDWARF::ForEachExternalModule
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
Definition: SymbolFileDWARF.cpp:939
ModuleList.h
lldb_private::Function::GetCompileUnit
CompileUnit * GetCompileUnit()
Get accessor for the compile unit that owns this function.
Definition: Function.cpp:361
lldb::eSymbolTypeSourceFile
@ eSymbolTypeSourceFile
Definition: lldb-enumerations.h:628
lldb_private::ModuleList
Definition: ModuleList.h:81
SymbolFileDWARFDebugMap::kHaveInitializedOSOs
@ kHaveInitializedOSOs
Definition: SymbolFileDWARFDebugMap.h:149
SymbolFileDWARFDebugMap::FindDefinitionTypeForDWARFDeclContext
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx)
Definition: SymbolFileDWARFDebugMap.cpp:1080
lldb::eSymbolTypeObjectFile
@ eSymbolTypeObjectFile
Definition: lldb-enumerations.h:630
SymbolFileDWARFDebugMap::ResolveSymbolContext
uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
SymbolFileDWARFDebugMap::GetCompileUnitInfo
CompileUnitInfo * GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf)
Definition: SymbolFileDWARFDebugMap.cpp:1239
DebugMapModule::GetSymbolFile
SymbolFile * GetSymbolFile(bool can_create=true, lldb_private::Stream *feedback_strm=nullptr) override
Get the module's symbol file.
Definition: SymbolFileDWARFDebugMap.cpp:177
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_path
lldb_private::ConstString oso_path
Definition: SymbolFileDWARFDebugMap.h:170
SymbolFileDWARFDebugMap::CalculateAbilities
uint32_t CalculateAbilities() override
Definition: SymbolFileDWARFDebugMap.cpp:538
lldb_private::ArchSpec::SetTriple
bool SetTriple(const llvm::Triple &triple)
Architecture triple setter.
Definition: ArchSpec.cpp:740
DebugMapModule
Definition: SymbolFileDWARFDebugMap.cpp:165
SymbolFileDWARFDebugMap::GetPluginDescriptionStatic
static llvm::StringRef GetPluginDescriptionStatic()
Definition: SymbolFileDWARFDebugMap.cpp:231
SymbolFileDWARFDebugMap::m_func_indexes
std::vector< uint32_t > m_func_indexes
Definition: SymbolFileDWARFDebugMap.h:310
lldb_private::SymbolContextScope::CalculateSymbolContext
virtual void CalculateSymbolContext(SymbolContext *sc)=0
Reconstruct the object's symbol context into sc.
lldb_private::SymbolContext::function
Function * function
The Function for a given query.
Definition: SymbolContext.h:320
lldb_private::Address::GetFileAddress
lldb::addr_t GetFileAddress() const
Get the file address.
Definition: Address.cpp:291
SymbolFileDWARFDebugMap::GetCompileUnit
lldb::CompUnitSP GetCompileUnit(SymbolFileDWARF *oso_dwarf)
Definition: SymbolFileDWARFDebugMap.cpp:1220
SymbolFileDWARFDebugMap::GetDeclContextContainingUID
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARFDebugMap.cpp:1283
lldb_private::Symbol::GetAddressRef
Address & GetAddressRef()
Definition: Symbol.h:57
SymbolFileDWARFDebugMap::ParseTypes
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:707
lldb_private::Module::ResolveFileAddress
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr)
Definition: Module.cpp:439
lldb_private::SymbolContextList::GetSize
uint32_t GetSize() const
Get accessor for a symbol context list size.
Definition: SymbolContext.cpp:1276
DWARFDebugAranges::AppendRange
void AppendRange(dw_offset_t cu_offset, dw_addr_t low_pc, dw_addr_t high_pc)
Definition: DWARFDebugAranges.cpp:84
lldb_private::ConstString
Definition: ConstString.h:40
SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext
virtual lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx)
Definition: SymbolFileDWARF.cpp:2848
SymbolFileDWARFDebugMap
Definition: SymbolFileDWARFDebugMap.h:25
Timer.h
DWARFDebugAranges.h
SymbolFileDWARFDebugMap::GetFileSpecForSO
bool GetFileSpecForSO(uint32_t oso_idx, lldb_private::FileSpec &file_spec)
Definition: SymbolFileDWARFDebugMap.cpp:464
SymbolFileDWARFDebugMap::GetDebugInfoModules
lldb_private::ModuleList GetDebugInfoModules() override
Get the additional modules that this symbol file uses to parse debug info.
Definition: SymbolFileDWARFDebugMap.cpp:1420
SymbolFileDWARF::ParseTypes
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:3060
LLDB_SCOPED_TIMER
#define LLDB_SCOPED_TIMER()
Definition: Timer.h:83
SymbolFileDWARFDebugMap::GetSymbolFileByOSOIndex
SymbolFileDWARF * GetSymbolFileByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:516
SymbolFileDWARFDebugMap::m_debug_map
DebugMap m_debug_map
Definition: SymbolFileDWARFDebugMap.h:317
LogChannelDWARF.h
lldb::eSymbolTypeObjCClass
@ eSymbolTypeObjCClass
Definition: lldb-enumerations.h:646
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID
CompileUnitInfo * GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id, uint32_t *oso_idx_ptr)
Definition: SymbolFileDWARFDebugMap.cpp:961
lldb_private::Symtab::GetIndexForSymbol
uint32_t GetIndexForSymbol(const Symbol *symbol) const
Definition: Symtab.cpp:548
SymbolFileDWARF::GetDeclContextForUID
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARF.cpp:1440
lldb_private::SymbolFileCommon::GetNumCompileUnits
uint32_t GetNumCompileUnits() override
Definition: SymbolFile.cpp:194
lldb_private::LineTable::LinkLineTable
LineTable * LinkLineTable(const FileRangeMap &file_range_map)
Definition: LineTable.cpp:406
SymbolFileDWARFDebugMap::AddOSOFileRange
bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr, lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr, lldb::addr_t oso_byte_size)
Definition: SymbolFileDWARFDebugMap.cpp:1299
lldb_private::Address::GetSection
lldb::SectionSP GetSection() const
Get const accessor for the section.
Definition: Address.h:429
SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo
lldb_private::Module * GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:396
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_mod_time
llvm::sys::TimePoint oso_mod_time
Definition: SymbolFileDWARFDebugMap.h:171
SymbolFileDWARFDebugMap::Initialize
static void Initialize()
Definition: SymbolFileDWARFDebugMap.cpp:222
SymbolFileDWARFDebugMap::ParseFunctions
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:634
lldb_private::Symbol::GetMangled
Mangled & GetMangled()
Definition: Symbol.h:121
SymbolFileDWARF::ParseXcodeSDK
lldb_private::XcodeSDK ParseXcodeSDK(lldb_private::CompileUnit &comp_unit) override
Return the Xcode SDK comp_unit was compiled against.
Definition: SymbolFileDWARF.cpp:888
VariableList.h
lldb_private::TypeMap
Definition: TypeMap.h:20
lldb_private::RangeDataVector::FindEntryIndexThatContains
uint32_t FindEntryIndexThatContains(B addr) const
Definition: RangeMap.h:533
lldb_private::Symbol::GetIntegerValue
uint64_t GetIntegerValue(uint64_t fail_value=0) const
Definition: Symbol.h:92
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
ObjectFile.h
SymbolFileDWARF::ParseVariablesForContext
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
Definition: SymbolFileDWARF.cpp:3076
lldb_private::UserID::GetID
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47
SymbolFileDWARFDebugMap::GetCompUnitInfosForModule
size_t GetCompUnitInfosForModule(const lldb_private::Module *oso_module, std::vector< CompileUnitInfo * > &cu_infos)
Definition: SymbolFileDWARFDebugMap.cpp:606
SymbolFileDWARF::ParseIsOptimized
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:1050
lldb_private::Symbol::GetName
ConstString GetName() const
Definition: Symbol.cpp:501
StreamFile.h
lldb_private::Symbol::IsDebug
bool IsDebug() const
Definition: Symbol.h:166
lldb_private::Module::GetSpecificationDescription
std::string GetSpecificationDescription() const
Get the module path and object name.
Definition: Module.cpp:1078
SymbolFileDWARFDebugMap::FinalizeOSOFileRanges
void FinalizeOSOFileRanges(CompileUnitInfo *cu_info)
Definition: SymbolFileDWARFDebugMap.cpp:1323
lldb_private::Symtab::AppendSymbolIndexesWithType
uint32_t AppendSymbolIndexesWithType(lldb::SymbolType symbol_type, std::vector< uint32_t > &indexes, uint32_t start_idx=0, uint32_t end_index=UINT32_MAX) const
Definition: Symtab.cpp:487
SymbolFileDWARFDebugMap::SymbolContainsSymbolWithIndex
static int SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:913
SymbolFileDWARF::ParseDebugMacros
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:1198
SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo
SymbolFileDWARF * GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:531
lldb::eLanguageTypeUnknown
@ eLanguageTypeUnknown
Unknown or invalid language value.
Definition: lldb-enumerations.h:437
lldb_private::Symtab
Definition: Symtab.h:22
uint32_t
SymbolFileDWARFDebugMap::LinkOSOAddress
bool LinkOSOAddress(lldb_private::Address &addr)
Convert addr from a .o file address, to an executable address.
Definition: SymbolFileDWARFDebugMap.cpp:1362
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
lldb_private::RangeDataVector::GetSize
size_t GetSize() const
Definition: RangeMap.h:514
lldb_private::Address
Definition: Address.h:59
SymbolFileDWARFDebugMap::FindFunctions
void FindFunctions(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, lldb::FunctionNameType name_type_mask, bool include_inlines, lldb_private::SymbolContextList &sc_list) override
SymbolFileDWARFDebugMap::ID
static char ID
LLVM RTTI support.
Definition: SymbolFileDWARFDebugMap.h:27
DebugMapModule::m_exe_module_wp
ModuleWP m_exe_module_wp
Definition: SymbolFileDWARFDebugMap.cpp:218
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, lldb::addr_t >
SymbolFileDWARFDebugMap::DumpClangAST
void DumpClangAST(lldb_private::Stream &s) override
Definition: SymbolFileDWARFDebugMap.cpp:1209
SymbolFileDWARFDebugMap::SymbolFileDWARFDebugMap
SymbolFileDWARFDebugMap(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileDWARFDebugMap.cpp:239
SymbolFileDWARFDebugMap::m_supports_DW_AT_APPLE_objc_complete_type
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type
Definition: SymbolFileDWARFDebugMap.h:316
lldb_private::Type
Definition: Type.h:66
LineTable.h
lldb_private::ObjectFile::ClearSymtab
virtual void ClearSymtab()
Frees the symbol table.
Definition: ObjectFile.cpp:574
DebugMapModule::DebugMapModule
DebugMapModule(const ModuleSP &exe_module_sp, uint32_t cu_idx, const FileSpec &file_spec, const ArchSpec &arch, const ConstString *object_name, off_t object_offset, const llvm::sys::TimePoint<> object_mod_time)
Definition: SymbolFileDWARFDebugMap.cpp:167
lldb_private::Symbol::GetByteSize
lldb::addr_t GetByteSize() const
Definition: Symbol.cpp:415
lldb_private::Range::GetByteSize
SizeType GetByteSize() const
Definition: RangeMap.h:82
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
lldb_private::ModuleChild::GetModule
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
Definition: ModuleChild.cpp:24
SymbolFileDWARFDebugMap::ResolveTypeUID
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
Definition: SymbolFileDWARFDebugMap.cpp:724
SymbolFileDWARF::ParseDeclsForContext
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
Definition: SymbolFileDWARF.cpp:1363
PluginManager.h
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
SymbolFileDWARFDebugMap::ForEachSymbolFile
void ForEachSymbolFile(std::function< bool(SymbolFileDWARF *)> closure)
Definition: SymbolFileDWARFDebugMap.h:230
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
SymbolFileDWARFDebugMap::InitOSO
void InitOSO()
Definition: SymbolFileDWARFDebugMap.cpp:248
SymbolFileDWARFDebugMap::ParseSupportFiles
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
Definition: SymbolFileDWARFDebugMap.cpp:669
lldb_private::SymbolContextList::IsEmpty
bool IsEmpty() const
Definition: SymbolContext.cpp:1278
lldb_private::SymbolFileCommon::GetObjectFile
ObjectFile * GetObjectFile() override
Definition: SymbolFile.h:403
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
SymbolFileDWARF::FindTypes
void FindTypes(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, llvm::DenseSet< lldb_private::SymbolFile * > &searched_symbol_files, lldb_private::TypeMap &types) override
SymbolFileDWARFDebugMap::ParseLanguage
lldb::LanguageType ParseLanguage(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:618
SymbolFileDWARF::FindFunctions
void FindFunctions(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, lldb::FunctionNameType name_type_mask, bool include_inlines, lldb_private::SymbolContextList &sc_list) override
SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE
virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
Definition: SymbolFileDWARF.cpp:2706
SymbolFileDWARFDebugMap::GetModuleByOSOIndex
lldb_private::Module * GetModuleByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:389
SymbolFileDWARF::ParseBlocksRecursive
size_t ParseBlocksRecursive(lldb_private::Function &func) override
Definition: SymbolFileDWARF.cpp:3039
DWARFDeclContext
Definition: DWARFDeclContext.h:23
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::SymbolFile::ResolveSymbolContext
virtual uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc)=0
lldb_private::eLazyBoolCalculate
@ eLazyBoolCalculate
Definition: lldb-private-enumerations.h:115
SymbolFileDWARFDebugMap::CalculateNumCompileUnits
uint32_t CalculateNumCompileUnits() override
Definition: SymbolFileDWARFDebugMap.cpp:557
lldb_private::TypeList
Definition: TypeList.h:20
SymbolFileDWARFDebugMap::LinkOSOLineTable
lldb_private::LineTable * LinkOSOLineTable(SymbolFileDWARF *oso_symfile, lldb_private::LineTable *line_table)
Given a line table full of lines with "file addresses" that are for a .o file represented by oso_symf...
Definition: SymbolFileDWARFDebugMap.cpp:1390
lldb_private::Symtab::SortSymbolIndexesByValue
void SortSymbolIndexesByValue(std::vector< uint32_t > &indexes, bool remove_duplicates) const
Definition: Symtab.cpp:613
SymbolFileDWARFDebugMap::LinkOSOFileAddress
lldb::addr_t LinkOSOFileAddress(SymbolFileDWARF *oso_symfile, lldb::addr_t oso_file_addr)
Convert a .o file "file address" to an executable "file address".
Definition: SymbolFileDWARFDebugMap.cpp:1341
SymbolFileDWARFDebugMap::OSOEntry
Definition: SymbolFileDWARFDebugMap.h:280
SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap
const FileRangeMap & GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile)
Definition: SymbolFileDWARFDebugMap.cpp:49
lldb_private::LanguageSet
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:40
lldb_private::Address::GetModule
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
Definition: Address.cpp:283
SymbolFileDWARF::GetDeclContextContainingUID
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARF.cpp:1453
SymbolFileDWARF::ParseSupportFiles
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
lldb_private::Log
Definition: Log.h:115
lldb_private::SourceLocationSpec::GetCheckInlines
bool GetCheckInlines() const
Definition: SourceLocationSpec.h:172
SymbolFileDWARFDebugMap::ParseDebugMacros
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:650
lldb_private::RegularExpression::GetText
llvm::StringRef GetText() const
Access the regular expression text.
Definition: RegularExpression.cpp:33
lldb_private::RangeData::data
DataType data
Definition: RangeMap.h:413
SymbolVendor.h
lldb_private::GetLog
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition: Log.h:308
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:347
lldb_private::Symbol::GetType
lldb::SymbolType GetType() const
Definition: Symbol.h:143
SymbolFileDWARFDebugMap::ParseVariablesForContext
size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override
Definition: SymbolFileDWARFDebugMap.cpp:716
lldb
Definition: SBAddress.h:15
SymbolFileDWARFDebugMap::m_compile_unit_infos
std::vector< CompileUnitInfo > m_compile_unit_infos
Definition: SymbolFileDWARFDebugMap.h:309
SymbolFileDWARFDebugMap::FindTypes
void FindTypes(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, llvm::DenseSet< lldb_private::SymbolFile * > &searched_symbol_files, lldb_private::TypeMap &types) override
SymbolFileDWARF::HasForwardDeclForClangType
bool HasForwardDeclForClangType(const lldb_private::CompilerType &compiler_type)
Definition: SymbolFileDWARF.cpp:1530
SymbolFileDWARF::ParseCallEdgesInFunction
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(UserID func_id) override
Definition: SymbolFileDWARF.cpp:3958
SymbolFileDWARF::GetTypes
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
lldb_private::ObjectFile
Definition: ObjectFile.h:60
lldb_private::SymbolFileCommon::SetCompileUnitAtIndex
void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp)
Definition: SymbolFile.cpp:215
lldb_private::ModuleList::Append
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
SymbolFileDWARF::DumpClangAST
void DumpClangAST(lldb_private::Stream &s) override
Definition: SymbolFileDWARF.cpp:3975
SymbolFileDWARFDebugMap::~SymbolFileDWARFDebugMap
~SymbolFileDWARFDebugMap() override
SymbolFileDWARFDebugMap::PrivateFindGlobalVariables
void PrivateFindGlobalVariables(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, const std::vector< uint32_t > &name_symbol_indexes, uint32_t max_matches, lldb_private::VariableList &variables)
Definition: SymbolFileDWARFDebugMap.cpp:830
lldb_private::SymbolContextList::RemoveContextAtIndex
bool RemoveContextAtIndex(size_t idx)
Definition: SymbolContext.cpp:1268
lldb_private::Symbol::GetSiblingIndex
uint32_t GetSiblingIndex() const
Definition: Symbol.cpp:170
lldb_private::Symbol::GetID
uint32_t GetID() const
Definition: Symbol.h:111
lldb_private::Range::GetRangeEnd
BaseType GetRangeEnd() const
Definition: RangeMap.h:73