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(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_MAP));
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  static ConstString g_name("dwarf-debugmap");
233  return g_name;
234 }
235 
237  return "DWARF and DWARF3 debug symbol file reader (debug map).";
238 }
239 
241  return new SymbolFileDWARFDebugMap(std::move(objfile_sp));
242 }
243 
245  : SymbolFile(std::move(objfile_sp)), m_flags(), m_compile_unit_infos(),
246  m_func_indexes(), m_glob_indexes(),
247  m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate) {}
248 
250 
252 
254  if (m_flags.test(kHaveInitializedOSOs))
255  return;
256 
258 
259  // If the object file has been stripped, there is no sense in looking further
260  // as all of the debug symbols for the debug map will not be available
261  if (m_objfile_sp->IsStripped())
262  return;
263 
264  // Also make sure the file type is some sort of executable. Core files, debug
265  // info files (dSYM), object files (.o files), and stub libraries all can
266  switch (m_objfile_sp->GetType()) {
267  case ObjectFile::eTypeInvalid:
268  case ObjectFile::eTypeCoreFile:
269  case ObjectFile::eTypeDebugInfo:
270  case ObjectFile::eTypeObjectFile:
271  case ObjectFile::eTypeStubLibrary:
272  case ObjectFile::eTypeUnknown:
273  case ObjectFile::eTypeJIT:
274  return;
275 
276  case ObjectFile::eTypeExecutable:
277  case ObjectFile::eTypeDynamicLinker:
278  case ObjectFile::eTypeSharedLibrary:
279  break;
280  }
281 
282  // In order to get the abilities of this plug-in, we look at the list of
283  // N_OSO entries (object files) from the symbol table and make sure that
284  // these files exist and also contain valid DWARF. If we get any of that then
285  // we return the abilities of the first N_OSO's DWARF.
286 
287  Symtab *symtab = m_objfile_sp->GetSymtab();
288  if (symtab) {
289  Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_MAP));
290 
291  std::vector<uint32_t> oso_indexes;
292  // When a mach-o symbol is encoded, the n_type field is encoded in bits
293  // 23:16, and the n_desc field is encoded in bits 15:0.
294  //
295  // To find all N_OSO entries that are part of the DWARF + debug map we find
296  // only object file symbols with the flags value as follows: bits 23:16 ==
297  // 0x66 (N_OSO) bits 15: 0 == 0x0001 (specifies this is a debug map object
298  // file)
299  const uint32_t k_oso_symbol_flags_value = 0x660001u;
300 
301  const uint32_t oso_index_count =
303  eSymbolTypeObjectFile, k_oso_symbol_flags_value, oso_indexes);
304 
305  if (oso_index_count > 0) {
306  symtab->AppendSymbolIndexesWithType(eSymbolTypeCode, Symtab::eDebugYes,
307  Symtab::eVisibilityAny,
309  symtab->AppendSymbolIndexesWithType(eSymbolTypeData, Symtab::eDebugYes,
310  Symtab::eVisibilityAny,
312 
315 
316  for (uint32_t sym_idx : m_func_indexes) {
317  const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);
318  lldb::addr_t file_addr = symbol->GetAddressRef().GetFileAddress();
319  lldb::addr_t byte_size = symbol->GetByteSize();
320  DebugMap::Entry debug_map_entry(
321  file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));
322  m_debug_map.Append(debug_map_entry);
323  }
324  for (uint32_t sym_idx : m_glob_indexes) {
325  const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);
326  lldb::addr_t file_addr = symbol->GetAddressRef().GetFileAddress();
327  lldb::addr_t byte_size = symbol->GetByteSize();
328  DebugMap::Entry debug_map_entry(
329  file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));
330  m_debug_map.Append(debug_map_entry);
331  }
332  m_debug_map.Sort();
333 
334  m_compile_unit_infos.resize(oso_index_count);
335 
336  for (uint32_t i = 0; i < oso_index_count; ++i) {
337  const uint32_t so_idx = oso_indexes[i] - 1;
338  const uint32_t oso_idx = oso_indexes[i];
339  const Symbol *so_symbol = symtab->SymbolAtIndex(so_idx);
340  const Symbol *oso_symbol = symtab->SymbolAtIndex(oso_idx);
341  if (so_symbol && oso_symbol &&
342  so_symbol->GetType() == eSymbolTypeSourceFile &&
343  oso_symbol->GetType() == eSymbolTypeObjectFile) {
344  m_compile_unit_infos[i].so_file.SetFile(
345  so_symbol->GetName().AsCString(), FileSpec::Style::native);
346  m_compile_unit_infos[i].oso_path = oso_symbol->GetName();
347  m_compile_unit_infos[i].oso_mod_time =
348  llvm::sys::toTimePoint(oso_symbol->GetIntegerValue(0));
349  uint32_t sibling_idx = so_symbol->GetSiblingIndex();
350  // The sibling index can't be less that or equal to the current index
351  // "i"
352  if (sibling_idx == UINT32_MAX) {
353  m_objfile_sp->GetModule()->ReportError(
354  "N_SO in symbol with UID %u has invalid sibling in debug map, "
355  "please file a bug and attach the binary listed in this error",
356  so_symbol->GetID());
357  } else {
358  const Symbol *last_symbol = symtab->SymbolAtIndex(sibling_idx - 1);
359  m_compile_unit_infos[i].first_symbol_index = so_idx;
360  m_compile_unit_infos[i].last_symbol_index = sibling_idx - 1;
361  m_compile_unit_infos[i].first_symbol_id = so_symbol->GetID();
362  m_compile_unit_infos[i].last_symbol_id = last_symbol->GetID();
363 
364  LLDB_LOGF(log, "Initialized OSO 0x%8.8x: file=%s", i,
365  oso_symbol->GetName().GetCString());
366  }
367  } else {
368  if (oso_symbol == nullptr)
369  m_objfile_sp->GetModule()->ReportError(
370  "N_OSO symbol[%u] can't be found, please file a bug and attach "
371  "the binary listed in this error",
372  oso_idx);
373  else if (so_symbol == nullptr)
374  m_objfile_sp->GetModule()->ReportError(
375  "N_SO not found for N_OSO symbol[%u], please file a bug and "
376  "attach the binary listed in this error",
377  oso_idx);
378  else if (so_symbol->GetType() != eSymbolTypeSourceFile)
379  m_objfile_sp->GetModule()->ReportError(
380  "N_SO has incorrect symbol type (%u) for N_OSO symbol[%u], "
381  "please file a bug and attach the binary listed in this error",
382  so_symbol->GetType(), oso_idx);
383  else if (oso_symbol->GetType() != eSymbolTypeSourceFile)
384  m_objfile_sp->GetModule()->ReportError(
385  "N_OSO has incorrect symbol type (%u) for N_OSO symbol[%u], "
386  "please file a bug and attach the binary listed in this error",
387  oso_symbol->GetType(), oso_idx);
388  }
389  }
390  }
391  }
392 }
393 
395  const uint32_t cu_count = GetNumCompileUnits();
396  if (oso_idx < cu_count)
398  return nullptr;
399 }
400 
402  CompileUnitInfo *comp_unit_info) {
403  if (!comp_unit_info->oso_sp) {
404  auto pos = m_oso_map.find(
405  {comp_unit_info->oso_path, comp_unit_info->oso_mod_time});
406  if (pos != m_oso_map.end()) {
407  comp_unit_info->oso_sp = pos->second;
408  } else {
409  ObjectFile *obj_file = GetObjectFile();
410  comp_unit_info->oso_sp = std::make_shared<OSOInfo>();
411  m_oso_map[{comp_unit_info->oso_path, comp_unit_info->oso_mod_time}] =
412  comp_unit_info->oso_sp;
413  const char *oso_path = comp_unit_info->oso_path.GetCString();
414  FileSpec oso_file(oso_path);
415  ConstString oso_object;
416  if (FileSystem::Instance().Exists(oso_file)) {
417  FileSystem::Instance().Collect(oso_file);
418  // The modification time returned by the FS can have a higher precision
419  // than the one from the CU.
420  auto oso_mod_time = std::chrono::time_point_cast<std::chrono::seconds>(
421  FileSystem::Instance().GetModificationTime(oso_file));
422  // A timestamp of 0 means that the linker was in deterministic mode. In
423  // that case, we should skip the check against the filesystem last
424  // modification timestamp, since it will never match.
425  if (comp_unit_info->oso_mod_time != llvm::sys::TimePoint<>() &&
426  oso_mod_time != comp_unit_info->oso_mod_time) {
427  obj_file->GetModule()->ReportError(
428  "debug map object file '%s' has changed (actual time is "
429  "%s, debug map time is %s"
430  ") since this executable was linked, file will be ignored",
431  oso_file.GetPath().c_str(), llvm::to_string(oso_mod_time).c_str(),
432  llvm::to_string(comp_unit_info->oso_mod_time).c_str());
433  return nullptr;
434  }
435 
436  } else {
437  const bool must_exist = true;
438 
439  if (!ObjectFile::SplitArchivePathWithObject(oso_path, oso_file,
440  oso_object, must_exist)) {
441  return nullptr;
442  }
443  }
444  // Always create a new module for .o files. Why? Because we use the debug
445  // map, to add new sections to each .o file and even though a .o file
446  // might not have changed, the sections that get added to the .o file can
447  // change.
448  ArchSpec oso_arch;
449  // Only adopt the architecture from the module (not the vendor or OS)
450  // since .o files for "i386-apple-ios" will historically show up as "i386
451  // -apple-macosx" due to the lack of a LC_VERSION_MIN_MACOSX or
452  // LC_VERSION_MIN_IPHONEOS load command...
453  oso_arch.SetTriple(m_objfile_sp->GetModule()
454  ->GetArchitecture()
455  .GetTriple()
456  .getArchName()
457  .str()
458  .c_str());
459  comp_unit_info->oso_sp->module_sp = std::make_shared<DebugMapModule>(
460  obj_file->GetModule(), GetCompUnitInfoIndex(comp_unit_info), oso_file,
461  oso_arch, oso_object ? &oso_object : nullptr, 0,
462  oso_object ? comp_unit_info->oso_mod_time : llvm::sys::TimePoint<>());
463  }
464  }
465  if (comp_unit_info->oso_sp)
466  return comp_unit_info->oso_sp->module_sp.get();
467  return nullptr;
468 }
469 
471  FileSpec &file_spec) {
472  if (oso_idx < m_compile_unit_infos.size()) {
473  if (m_compile_unit_infos[oso_idx].so_file) {
474  file_spec = m_compile_unit_infos[oso_idx].so_file;
475  return true;
476  }
477  }
478  return false;
479 }
480 
482  Module *oso_module = GetModuleByOSOIndex(oso_idx);
483  if (oso_module)
484  return oso_module->GetObjectFile();
485  return nullptr;
486 }
487 
490  return GetSymbolFile(*sc.comp_unit);
491 }
492 
495  CompileUnitInfo *comp_unit_info = GetCompUnitInfo(comp_unit);
496  if (comp_unit_info)
497  return GetSymbolFileByCompUnitInfo(comp_unit_info);
498  return nullptr;
499 }
500 
502  CompileUnitInfo *comp_unit_info) {
503  Module *oso_module = GetModuleByCompUnitInfo(comp_unit_info);
504  if (oso_module)
505  return oso_module->GetObjectFile();
506  return nullptr;
507 }
508 
510  const CompileUnitInfo *comp_unit_info) {
511  if (!m_compile_unit_infos.empty()) {
512  const CompileUnitInfo *first_comp_unit_info = &m_compile_unit_infos.front();
513  const CompileUnitInfo *last_comp_unit_info = &m_compile_unit_infos.back();
514  if (first_comp_unit_info <= comp_unit_info &&
515  comp_unit_info <= last_comp_unit_info)
516  return comp_unit_info - first_comp_unit_info;
517  }
518  return UINT32_MAX;
519 }
520 
523  unsigned size = m_compile_unit_infos.size();
524  if (oso_idx < size)
526  return nullptr;
527 }
528 
531  if (sym_file && sym_file->GetPluginName() ==
533  return static_cast<SymbolFileDWARF *>(sym_file);
534  return nullptr;
535 }
536 
538  CompileUnitInfo *comp_unit_info) {
539  if (Module *oso_module = GetModuleByCompUnitInfo(comp_unit_info))
540  return GetSymbolFileAsSymbolFileDWARF(oso_module->GetSymbolFile());
541  return nullptr;
542 }
543 
545  // In order to get the abilities of this plug-in, we look at the list of
546  // N_OSO entries (object files) from the symbol table and make sure that
547  // these files exist and also contain valid DWARF. If we get any of that then
548  // we return the abilities of the first N_OSO's DWARF.
549 
550  const uint32_t oso_index_count = GetNumCompileUnits();
551  if (oso_index_count > 0) {
552  InitOSO();
553  if (!m_compile_unit_infos.empty()) {
554  return SymbolFile::CompileUnits | SymbolFile::Functions |
555  SymbolFile::Blocks | SymbolFile::GlobalVariables |
556  SymbolFile::LocalVariables | SymbolFile::VariableTypes |
557  SymbolFile::LineTables;
558  }
559  }
560  return 0;
561 }
562 
564  InitOSO();
565  return m_compile_unit_infos.size();
566 }
567 
569  CompUnitSP comp_unit_sp;
570  const uint32_t cu_count = GetNumCompileUnits();
571 
572  if (cu_idx < cu_count) {
573  Module *oso_module = GetModuleByCompUnitInfo(&m_compile_unit_infos[cu_idx]);
574  if (oso_module) {
575  FileSpec so_file_spec;
576  if (GetFileSpecForSO(cu_idx, so_file_spec)) {
577  // User zero as the ID to match the compile unit at offset zero in each
578  // .o file since each .o file can only have one compile unit for now.
579  lldb::user_id_t cu_id = 0;
580  m_compile_unit_infos[cu_idx].compile_unit_sp =
581  std::make_shared<CompileUnit>(
582  m_objfile_sp->GetModule(), nullptr, so_file_spec, cu_id,
584 
585  if (m_compile_unit_infos[cu_idx].compile_unit_sp) {
586  SetCompileUnitAtIndex(cu_idx,
587  m_compile_unit_infos[cu_idx].compile_unit_sp);
588  }
589  }
590  }
591  comp_unit_sp = m_compile_unit_infos[cu_idx].compile_unit_sp;
592  }
593 
594  return comp_unit_sp;
595 }
596 
599  return GetCompUnitInfo(*sc.comp_unit);
600 }
601 
604  const uint32_t cu_count = GetNumCompileUnits();
605  for (uint32_t i = 0; i < cu_count; ++i) {
606  if (&comp_unit == m_compile_unit_infos[i].compile_unit_sp.get())
607  return &m_compile_unit_infos[i];
608  }
609  return nullptr;
610 }
611 
613  const lldb_private::Module *module,
614  std::vector<CompileUnitInfo *> &cu_infos) {
615  const uint32_t cu_count = GetNumCompileUnits();
616  for (uint32_t i = 0; i < cu_count; ++i) {
618  cu_infos.push_back(&m_compile_unit_infos[i]);
619  }
620  return cu_infos.size();
621 }
622 
625  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
626  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
627  if (oso_dwarf)
628  return oso_dwarf->ParseLanguage(comp_unit);
629  return eLanguageTypeUnknown;
630 }
631 
633  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
634  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
635  if (oso_dwarf)
636  return oso_dwarf->ParseXcodeSDK(comp_unit);
637  return {};
638 }
639 
641  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
642  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
643  if (oso_dwarf)
644  return oso_dwarf->ParseFunctions(comp_unit);
645  return 0;
646 }
647 
649  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
650  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
651  if (oso_dwarf)
652  return oso_dwarf->ParseLineTable(comp_unit);
653  return false;
654 }
655 
657  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
658  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
659  if (oso_dwarf)
660  return oso_dwarf->ParseDebugMacros(comp_unit);
661  return false;
662 }
663 
665  CompileUnit &comp_unit,
666  llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
667  llvm::function_ref<bool(Module &)> f) {
668  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
669  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
670  if (oso_dwarf)
671  return oso_dwarf->ForEachExternalModule(comp_unit, visited_symbol_files, f);
672  return false;
673 }
674 
676  FileSpecList &support_files) {
677  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
678  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
679  if (oso_dwarf)
680  return oso_dwarf->ParseSupportFiles(comp_unit, support_files);
681  return false;
682 }
683 
685  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
686  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
687  if (oso_dwarf)
688  return oso_dwarf->ParseIsOptimized(comp_unit);
689  return false;
690 }
691 
693  const SymbolContext &sc, std::vector<SourceModule> &imported_modules) {
694  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
695  SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
696  if (oso_dwarf)
697  return oso_dwarf->ParseImportedModules(sc, imported_modules);
698  return false;
699 }
700 
702  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
703  CompileUnit *comp_unit = func.GetCompileUnit();
704  if (!comp_unit)
705  return 0;
706 
707  SymbolFileDWARF *oso_dwarf = GetSymbolFile(*comp_unit);
708  if (oso_dwarf)
709  return oso_dwarf->ParseBlocksRecursive(func);
710  return 0;
711 }
712 
714  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
715  SymbolFileDWARF *oso_dwarf = GetSymbolFile(comp_unit);
716  if (oso_dwarf)
717  return oso_dwarf->ParseTypes(comp_unit);
718  return 0;
719 }
720 
721 size_t
723  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
724  SymbolFileDWARF *oso_dwarf = GetSymbolFile(sc);
725  if (oso_dwarf)
726  return oso_dwarf->ParseVariablesForContext(sc);
727  return 0;
728 }
729 
731  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
732  const uint64_t oso_idx = GetOSOIndexFromUserID(type_uid);
733  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
734  if (oso_dwarf)
735  return oso_dwarf->ResolveTypeUID(type_uid);
736  return nullptr;
737 }
738 
739 llvm::Optional<SymbolFile::ArrayInfo>
741  lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx) {
742  const uint64_t oso_idx = GetOSOIndexFromUserID(type_uid);
743  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
744  if (oso_dwarf)
745  return oso_dwarf->GetDynamicArrayInfoForUID(type_uid, exe_ctx);
746  return llvm::None;
747 }
748 
750  bool success = false;
751  if (compiler_type) {
752  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
753  if (oso_dwarf->HasForwardDeclForClangType(compiler_type)) {
754  oso_dwarf->CompleteType(compiler_type);
755  success = true;
756  return true;
757  }
758  return false;
759  });
760  }
761  return success;
762 }
763 
764 uint32_t
766  SymbolContextItem resolve_scope,
767  SymbolContext &sc) {
768  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
769  uint32_t resolved_flags = 0;
770  Symtab *symtab = m_objfile_sp->GetSymtab();
771  if (symtab) {
772  const addr_t exe_file_addr = exe_so_addr.GetFileAddress();
773 
774  const DebugMap::Entry *debug_map_entry =
775  m_debug_map.FindEntryThatContains(exe_file_addr);
776  if (debug_map_entry) {
777 
778  sc.symbol =
779  symtab->SymbolAtIndex(debug_map_entry->data.GetExeSymbolIndex());
780 
781  if (sc.symbol != nullptr) {
782  resolved_flags |= eSymbolContextSymbol;
783 
784  uint32_t oso_idx = 0;
785  CompileUnitInfo *comp_unit_info =
787  if (comp_unit_info) {
788  comp_unit_info->GetFileRangeMap(this);
789  Module *oso_module = GetModuleByCompUnitInfo(comp_unit_info);
790  if (oso_module) {
791  lldb::addr_t oso_file_addr =
792  exe_file_addr - debug_map_entry->GetRangeBase() +
793  debug_map_entry->data.GetOSOFileAddress();
794  Address oso_so_addr;
795  if (oso_module->ResolveFileAddress(oso_file_addr, oso_so_addr)) {
796  resolved_flags |=
797  oso_module->GetSymbolFile()->ResolveSymbolContext(
798  oso_so_addr, resolve_scope, sc);
799  }
800  }
801  }
802  }
803  }
804  }
805  return resolved_flags;
806 }
807 
809  const SourceLocationSpec &src_location_spec,
810  SymbolContextItem resolve_scope, SymbolContextList &sc_list) {
811  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
812  const uint32_t initial = sc_list.GetSize();
813  const uint32_t cu_count = GetNumCompileUnits();
814 
815  for (uint32_t i = 0; i < cu_count; ++i) {
816  // If we are checking for inlines, then we need to look through all compile
817  // units no matter if "file_spec" matches.
818  bool resolve = src_location_spec.GetCheckInlines();
819 
820  if (!resolve) {
821  FileSpec so_file_spec;
822  if (GetFileSpecForSO(i, so_file_spec))
823  resolve =
824  FileSpec::Match(src_location_spec.GetFileSpec(), so_file_spec);
825  }
826  if (resolve) {
828  if (oso_dwarf)
829  oso_dwarf->ResolveSymbolContext(src_location_spec, resolve_scope,
830  sc_list);
831  }
832  }
833  return sc_list.GetSize() - initial;
834 }
835 
837  ConstString name, const CompilerDeclContext &parent_decl_ctx,
838  const std::vector<uint32_t>
839  &indexes, // Indexes into the symbol table that match "name"
840  uint32_t max_matches, VariableList &variables) {
841  const size_t match_count = indexes.size();
842  for (size_t i = 0; i < match_count; ++i) {
843  uint32_t oso_idx;
844  CompileUnitInfo *comp_unit_info =
845  GetCompileUnitInfoForSymbolWithIndex(indexes[i], &oso_idx);
846  if (comp_unit_info) {
847  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
848  if (oso_dwarf) {
849  oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches,
850  variables);
851  if (variables.GetSize() > max_matches)
852  break;
853  }
854  }
855  }
856 }
857 
859  ConstString name, const CompilerDeclContext &parent_decl_ctx,
860  uint32_t max_matches, VariableList &variables) {
861  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
862  uint32_t total_matches = 0;
863 
864  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
865  const uint32_t old_size = variables.GetSize();
866  oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches,
867  variables);
868  const uint32_t oso_matches = variables.GetSize() - old_size;
869  if (oso_matches > 0) {
870  total_matches += oso_matches;
871 
872  // Are we getting all matches?
873  if (max_matches == UINT32_MAX)
874  return false; // Yep, continue getting everything
875 
876  // If we have found enough matches, lets get out
877  if (max_matches >= total_matches)
878  return true;
879 
880  // Update the max matches for any subsequent calls to find globals in any
881  // other object files with DWARF
882  max_matches -= oso_matches;
883  }
884 
885  return false;
886  });
887 }
888 
890  const RegularExpression &regex, uint32_t max_matches,
891  VariableList &variables) {
892  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
893  uint32_t total_matches = 0;
894  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
895  const uint32_t old_size = variables.GetSize();
896  oso_dwarf->FindGlobalVariables(regex, max_matches, variables);
897 
898  const uint32_t oso_matches = variables.GetSize() - old_size;
899  if (oso_matches > 0) {
900  total_matches += oso_matches;
901 
902  // Are we getting all matches?
903  if (max_matches == UINT32_MAX)
904  return false; // Yep, continue getting everything
905 
906  // If we have found enough matches, lets get out
907  if (max_matches >= total_matches)
908  return true;
909 
910  // Update the max matches for any subsequent calls to find globals in any
911  // other object files with DWARF
912  max_matches -= oso_matches;
913  }
914 
915  return false;
916  });
917 }
918 
920  uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info) {
921  const uint32_t symbol_idx = *symbol_idx_ptr;
922 
923  if (symbol_idx < comp_unit_info->first_symbol_index)
924  return -1;
925 
926  if (symbol_idx <= comp_unit_info->last_symbol_index)
927  return 0;
928 
929  return 1;
930 }
931 
933  user_id_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info) {
934  const user_id_t symbol_id = *symbol_idx_ptr;
935 
936  if (symbol_id < comp_unit_info->first_symbol_id)
937  return -1;
938 
939  if (symbol_id <= comp_unit_info->last_symbol_id)
940  return 0;
941 
942  return 1;
943 }
944 
947  uint32_t symbol_idx, uint32_t *oso_idx_ptr) {
948  const uint32_t oso_index_count = m_compile_unit_infos.size();
949  CompileUnitInfo *comp_unit_info = nullptr;
950  if (oso_index_count) {
951  comp_unit_info = (CompileUnitInfo *)bsearch(
952  &symbol_idx, &m_compile_unit_infos[0], m_compile_unit_infos.size(),
953  sizeof(CompileUnitInfo),
954  (ComparisonFunction)SymbolContainsSymbolWithIndex);
955  }
956 
957  if (oso_idx_ptr) {
958  if (comp_unit_info != nullptr)
959  *oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
960  else
961  *oso_idx_ptr = UINT32_MAX;
962  }
963  return comp_unit_info;
964 }
965 
968  user_id_t symbol_id, uint32_t *oso_idx_ptr) {
969  const uint32_t oso_index_count = m_compile_unit_infos.size();
970  CompileUnitInfo *comp_unit_info = nullptr;
971  if (oso_index_count) {
972  comp_unit_info = (CompileUnitInfo *)::bsearch(
973  &symbol_id, &m_compile_unit_infos[0], m_compile_unit_infos.size(),
974  sizeof(CompileUnitInfo),
975  (ComparisonFunction)SymbolContainsSymbolWithID);
976  }
977 
978  if (oso_idx_ptr) {
979  if (comp_unit_info != nullptr)
980  *oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
981  else
982  *oso_idx_ptr = UINT32_MAX;
983  }
984  return comp_unit_info;
985 }
986 
987 static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp,
988  SymbolContextList &sc_list,
989  uint32_t start_idx) {
990  // We found functions in .o files. Not all functions in the .o files will
991  // have made it into the final output file. The ones that did make it into
992  // the final output file will have a section whose module matches the module
993  // from the ObjectFile for this SymbolFile. When the modules don't match,
994  // then we have something that was in a .o file, but doesn't map to anything
995  // in the final executable.
996  uint32_t i = start_idx;
997  while (i < sc_list.GetSize()) {
998  SymbolContext sc;
999  sc_list.GetContextAtIndex(i, sc);
1000  if (sc.function) {
1001  const SectionSP section_sp(
1003  if (section_sp->GetModule() != module_sp) {
1004  sc_list.RemoveContextAtIndex(i);
1005  continue;
1006  }
1007  }
1008  ++i;
1009  }
1010 }
1011 
1013  ConstString name, const CompilerDeclContext &parent_decl_ctx,
1014  FunctionNameType name_type_mask, bool include_inlines,
1015  SymbolContextList &sc_list) {
1016  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1017  LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::FindFunctions (name = %s)",
1018  name.GetCString());
1019 
1020  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1021  uint32_t sc_idx = sc_list.GetSize();
1022  oso_dwarf->FindFunctions(name, parent_decl_ctx, name_type_mask,
1023  include_inlines, sc_list);
1024  if (!sc_list.IsEmpty()) {
1025  RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
1026  sc_idx);
1027  }
1028  return false;
1029  });
1030 }
1031 
1033  bool include_inlines,
1034  SymbolContextList &sc_list) {
1035  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1036  LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::FindFunctions (regex = '%s')",
1037  regex.GetText().str().c_str());
1038 
1039  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1040  uint32_t sc_idx = sc_list.GetSize();
1041 
1042  oso_dwarf->FindFunctions(regex, include_inlines, sc_list);
1043  if (!sc_list.IsEmpty()) {
1044  RemoveFunctionsWithModuleNotEqualTo(m_objfile_sp->GetModule(), sc_list,
1045  sc_idx);
1046  }
1047  return false;
1048  });
1049 }
1050 
1052  lldb::TypeClass type_mask,
1053  TypeList &type_list) {
1054  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1055  LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::GetTypes (type_mask = 0x%8.8x)",
1056  type_mask);
1057 
1058  SymbolFileDWARF *oso_dwarf = nullptr;
1059  if (sc_scope) {
1060  SymbolContext sc;
1061  sc_scope->CalculateSymbolContext(&sc);
1062 
1063  CompileUnitInfo *cu_info = GetCompUnitInfo(sc);
1064  if (cu_info) {
1065  oso_dwarf = GetSymbolFileByCompUnitInfo(cu_info);
1066  if (oso_dwarf)
1067  oso_dwarf->GetTypes(sc_scope, type_mask, type_list);
1068  }
1069  } else {
1070  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1071  oso_dwarf->GetTypes(sc_scope, type_mask, type_list);
1072  return false;
1073  });
1074  }
1075 }
1076 
1077 std::vector<std::unique_ptr<lldb_private::CallEdge>>
1079  uint32_t oso_idx = GetOSOIndexFromUserID(func_id.GetID());
1080  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
1081  if (oso_dwarf)
1082  return oso_dwarf->ParseCallEdgesInFunction(func_id);
1083  return {};
1084 }
1085 
1087  const DWARFDeclContext &die_decl_ctx) {
1088  TypeSP type_sp;
1089  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1090  type_sp = oso_dwarf->FindDefinitionTypeForDWARFDeclContext(die_decl_ctx);
1091  return ((bool)type_sp);
1092  });
1093  return type_sp;
1094 }
1095 
1097  SymbolFileDWARF *skip_dwarf_oso) {
1100  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1101  if (skip_dwarf_oso != oso_dwarf &&
1102  oso_dwarf->Supports_DW_AT_APPLE_objc_complete_type(nullptr)) {
1103  m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
1104  return true;
1105  }
1106  return false;
1107  });
1108  }
1110 }
1111 
1113  const DWARFDIE &die, ConstString type_name,
1114  bool must_be_implementation) {
1115  // If we have a debug map, we will have an Objective-C symbol whose name is
1116  // the type name and whose type is eSymbolTypeObjCClass. If we can find that
1117  // symbol and find its containing parent, we can locate the .o file that will
1118  // contain the implementation definition since it will be scoped inside the
1119  // N_SO and we can then locate the SymbolFileDWARF that corresponds to that
1120  // N_SO.
1121  SymbolFileDWARF *oso_dwarf = nullptr;
1122  TypeSP type_sp;
1123  ObjectFile *module_objfile = m_objfile_sp->GetModule()->GetObjectFile();
1124  if (module_objfile) {
1125  Symtab *symtab = module_objfile->GetSymtab();
1126  if (symtab) {
1127  Symbol *objc_class_symbol = symtab->FindFirstSymbolWithNameAndType(
1128  type_name, eSymbolTypeObjCClass, Symtab::eDebugAny,
1129  Symtab::eVisibilityAny);
1130  if (objc_class_symbol) {
1131  // Get the N_SO symbol that contains the objective C class symbol as
1132  // this should be the .o file that contains the real definition...
1133  const Symbol *source_file_symbol = symtab->GetParent(objc_class_symbol);
1134 
1135  if (source_file_symbol &&
1136  source_file_symbol->GetType() == eSymbolTypeSourceFile) {
1137  const uint32_t source_file_symbol_idx =
1138  symtab->GetIndexForSymbol(source_file_symbol);
1139  if (source_file_symbol_idx != UINT32_MAX) {
1140  CompileUnitInfo *compile_unit_info =
1141  GetCompileUnitInfoForSymbolWithIndex(source_file_symbol_idx,
1142  nullptr);
1143  if (compile_unit_info) {
1144  oso_dwarf = GetSymbolFileByCompUnitInfo(compile_unit_info);
1145  if (oso_dwarf) {
1146  TypeSP type_sp(oso_dwarf->FindCompleteObjCDefinitionTypeForDIE(
1147  die, type_name, must_be_implementation));
1148  if (type_sp) {
1149  return type_sp;
1150  }
1151  }
1152  }
1153  }
1154  }
1155  }
1156  }
1157  }
1158 
1159  // Only search all .o files for the definition if we don't need the
1160  // implementation because otherwise, with a valid debug map we should have
1161  // the ObjC class symbol and the code above should have found it.
1162  if (!must_be_implementation) {
1163  TypeSP type_sp;
1164 
1165  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1166  type_sp = oso_dwarf->FindCompleteObjCDefinitionTypeForDIE(
1167  die, type_name, must_be_implementation);
1168  return (bool)type_sp;
1169  });
1170 
1171  return type_sp;
1172  }
1173  return TypeSP();
1174 }
1175 
1177  ConstString name, const CompilerDeclContext &parent_decl_ctx,
1178  uint32_t max_matches,
1179  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
1180  TypeMap &types) {
1181  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1182  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1183  oso_dwarf->FindTypes(name, parent_decl_ctx, max_matches,
1184  searched_symbol_files, types);
1185  return types.GetSize() >= max_matches;
1186  });
1187 }
1188 
1190  llvm::ArrayRef<CompilerContext> context, LanguageSet languages,
1191  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
1192  TypeMap &types) {
1193  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1194  oso_dwarf->FindTypes(context, languages, searched_symbol_files, types);
1195  return false;
1196  });
1197 }
1198 
1199 //
1200 // uint32_t
1201 // SymbolFileDWARFDebugMap::FindTypes (const SymbolContext& sc, const
1202 // RegularExpression& regex, bool append, uint32_t max_matches, Type::Encoding
1203 // encoding, lldb::user_id_t udt_uid, TypeList& types)
1204 //{
1205 // SymbolFileDWARF *oso_dwarf = GetSymbolFile (sc);
1206 // if (oso_dwarf)
1207 // return oso_dwarf->FindTypes (sc, regex, append, max_matches, encoding,
1208 // udt_uid, types);
1209 // return 0;
1210 //}
1211 
1214  const CompilerDeclContext &parent_decl_ctx) {
1215  std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
1216  CompilerDeclContext matching_namespace;
1217 
1218  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1219  matching_namespace = oso_dwarf->FindNamespace(name, parent_decl_ctx);
1220 
1221  return (bool)matching_namespace;
1222  });
1223 
1224  return matching_namespace;
1225 }
1226 
1228  ForEachSymbolFile([&s](SymbolFileDWARF *oso_dwarf) -> bool {
1229  oso_dwarf->DumpClangAST(s);
1230  // The underlying assumption is that DumpClangAST(...) will obtain the
1231  // AST from the underlying TypeSystem and therefore we only need to do
1232  // this once and can stop after the first iteration hence we return true.
1233  return true;
1234  });
1235 }
1236 
1237 lldb::CompUnitSP
1239  if (oso_dwarf) {
1240  const uint32_t cu_count = GetNumCompileUnits();
1241  for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1242  SymbolFileDWARF *oso_symfile =
1244  if (oso_symfile == oso_dwarf) {
1245  if (!m_compile_unit_infos[cu_idx].compile_unit_sp)
1246  m_compile_unit_infos[cu_idx].compile_unit_sp =
1247  ParseCompileUnitAtIndex(cu_idx);
1248 
1249  return m_compile_unit_infos[cu_idx].compile_unit_sp;
1250  }
1251  }
1252  }
1253  llvm_unreachable("this shouldn't happen");
1254 }
1255 
1258  if (oso_dwarf) {
1259  const uint32_t cu_count = GetNumCompileUnits();
1260  for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1261  SymbolFileDWARF *oso_symfile =
1263  if (oso_symfile == oso_dwarf) {
1264  return &m_compile_unit_infos[cu_idx];
1265  }
1266  }
1267  }
1268  return nullptr;
1269 }
1270 
1272  const CompUnitSP &cu_sp) {
1273  if (oso_dwarf) {
1274  const uint32_t cu_count = GetNumCompileUnits();
1275  for (uint32_t cu_idx = 0; cu_idx < cu_count; ++cu_idx) {
1276  SymbolFileDWARF *oso_symfile =
1278  if (oso_symfile == oso_dwarf) {
1279  if (m_compile_unit_infos[cu_idx].compile_unit_sp) {
1280  assert(m_compile_unit_infos[cu_idx].compile_unit_sp.get() ==
1281  cu_sp.get());
1282  } else {
1283  m_compile_unit_infos[cu_idx].compile_unit_sp = cu_sp;
1284  SetCompileUnitAtIndex(cu_idx, cu_sp);
1285  }
1286  }
1287  }
1288  }
1289 }
1290 
1293  const uint64_t oso_idx = GetOSOIndexFromUserID(type_uid);
1294  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
1295  if (oso_dwarf)
1296  return oso_dwarf->GetDeclContextForUID(type_uid);
1297  return CompilerDeclContext();
1298 }
1299 
1302  const uint64_t oso_idx = GetOSOIndexFromUserID(type_uid);
1303  SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
1304  if (oso_dwarf)
1305  return oso_dwarf->GetDeclContextContainingUID(type_uid);
1306  return CompilerDeclContext();
1307 }
1308 
1311  ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
1312  oso_dwarf->ParseDeclsForContext(decl_ctx);
1313  return true; // Keep iterating
1314  });
1315 }
1316 
1318  lldb::addr_t exe_file_addr,
1319  lldb::addr_t exe_byte_size,
1320  lldb::addr_t oso_file_addr,
1321  lldb::addr_t oso_byte_size) {
1322  const uint32_t debug_map_idx =
1323  m_debug_map.FindEntryIndexThatContains(exe_file_addr);
1324  if (debug_map_idx != UINT32_MAX) {
1325  DebugMap::Entry *debug_map_entry =
1326  m_debug_map.FindEntryThatContains(exe_file_addr);
1327  debug_map_entry->data.SetOSOFileAddress(oso_file_addr);
1328  addr_t range_size = std::min<addr_t>(exe_byte_size, oso_byte_size);
1329  if (range_size == 0) {
1330  range_size = std::max<addr_t>(exe_byte_size, oso_byte_size);
1331  if (range_size == 0)
1332  range_size = 1;
1333  }
1334  cu_info->file_range_map.Append(
1335  FileRangeMap::Entry(oso_file_addr, range_size, exe_file_addr));
1336  return true;
1337  }
1338  return false;
1339 }
1340 
1342  cu_info->file_range_map.Sort();
1343 #if defined(DEBUG_OSO_DMAP)
1344  const FileRangeMap &oso_file_range_map = cu_info->GetFileRangeMap(this);
1345  const size_t n = oso_file_range_map.GetSize();
1346  printf("SymbolFileDWARFDebugMap::FinalizeOSOFileRanges (cu_info = %p) %s\n",
1347  cu_info, cu_info->oso_sp->module_sp->GetFileSpec().GetPath().c_str());
1348  for (size_t i = 0; i < n; ++i) {
1349  const FileRangeMap::Entry &entry = oso_file_range_map.GetEntryRef(i);
1350  printf("oso [0x%16.16" PRIx64 " - 0x%16.16" PRIx64
1351  ") ==> exe [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")\n",
1352  entry.GetRangeBase(), entry.GetRangeEnd(), entry.data,
1353  entry.data + entry.GetByteSize());
1354  }
1355 #endif
1356 }
1357 
1360  lldb::addr_t oso_file_addr) {
1361  CompileUnitInfo *cu_info = GetCompileUnitInfo(oso_symfile);
1362  if (cu_info) {
1363  const FileRangeMap::Entry *oso_range_entry =
1364  cu_info->GetFileRangeMap(this).FindEntryThatContains(oso_file_addr);
1365  if (oso_range_entry) {
1366  const DebugMap::Entry *debug_map_entry =
1367  m_debug_map.FindEntryThatContains(oso_range_entry->data);
1368  if (debug_map_entry) {
1369  const lldb::addr_t offset =
1370  oso_file_addr - oso_range_entry->GetRangeBase();
1371  const lldb::addr_t exe_file_addr =
1372  debug_map_entry->GetRangeBase() + offset;
1373  return exe_file_addr;
1374  }
1375  }
1376  }
1377  return LLDB_INVALID_ADDRESS;
1378 }
1379 
1381  // Make sure this address hasn't been fixed already
1382  Module *exe_module = GetObjectFile()->GetModule().get();
1383  Module *addr_module = addr.GetModule().get();
1384  if (addr_module == exe_module)
1385  return true; // Address is already in terms of the main executable module
1386 
1389  if (cu_info) {
1390  const lldb::addr_t oso_file_addr = addr.GetFileAddress();
1391  const FileRangeMap::Entry *oso_range_entry =
1392  cu_info->GetFileRangeMap(this).FindEntryThatContains(oso_file_addr);
1393  if (oso_range_entry) {
1394  const DebugMap::Entry *debug_map_entry =
1395  m_debug_map.FindEntryThatContains(oso_range_entry->data);
1396  if (debug_map_entry) {
1397  const lldb::addr_t offset =
1398  oso_file_addr - oso_range_entry->GetRangeBase();
1399  const lldb::addr_t exe_file_addr =
1400  debug_map_entry->GetRangeBase() + offset;
1401  return exe_module->ResolveFileAddress(exe_file_addr, addr);
1402  }
1403  }
1404  }
1405  return true;
1406 }
1407 
1409  LineTable *line_table) {
1410  CompileUnitInfo *cu_info = GetCompileUnitInfo(oso_dwarf);
1411  if (cu_info)
1412  return line_table->LinkLineTable(cu_info->GetFileRangeMap(this));
1413  return nullptr;
1414 }
1415 
1416 size_t
1418  DWARFDebugAranges *debug_aranges) {
1419  size_t num_line_entries_added = 0;
1420  if (debug_aranges && dwarf2Data) {
1421  CompileUnitInfo *compile_unit_info = GetCompileUnitInfo(dwarf2Data);
1422  if (compile_unit_info) {
1423  const FileRangeMap &file_range_map =
1424  compile_unit_info->GetFileRangeMap(this);
1425  for (size_t idx = 0; idx < file_range_map.GetSize(); idx++) {
1426  const FileRangeMap::Entry *entry = file_range_map.GetEntryAtIndex(idx);
1427  if (entry) {
1428  debug_aranges->AppendRange(dwarf2Data->GetID(), entry->GetRangeBase(),
1429  entry->GetRangeEnd());
1430  num_line_entries_added++;
1431  }
1432  }
1433  }
1434  }
1435  return num_line_entries_added;
1436 }
SymbolFileDWARFDebugMap::ParseCompileUnitAtIndex
lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override
Definition: SymbolFileDWARFDebugMap.cpp:568
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:481
SymbolFileDWARFDebugMap::GetSymbolFile
SymbolFileDWARF * GetSymbolFile(const lldb_private::SymbolContext &sc)
Definition: SymbolFileDWARFDebugMap.cpp:489
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:177
SymbolFileDWARFDebugMap::m_glob_indexes
std::vector< uint32_t > m_glob_indexes
Definition: SymbolFileDWARFDebugMap.h:310
SymbolFileDWARFDebugMap.h
lldb_private::Module::GetObjectFile
virtual ObjectFile * GetObjectFile()
Get the object file representation for the current architecture.
Definition: Module.cpp:1238
lldb_private::SymbolFile::GetNumCompileUnits
uint32_t GetNumCompileUnits()
Definition: SymbolFile.cpp:157
lldb_private::SymbolFile
Definition: SymbolFile.h:37
SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo
lldb_private::ObjectFile * GetObjectFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:501
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:598
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:632
SymbolFileDWARFDebugMap::SetCompileUnit
void SetCompileUnit(SymbolFileDWARF *oso_dwarf, const lldb::CompUnitSP &cu_sp)
Definition: SymbolFileDWARFDebugMap.cpp:1271
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:307
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:1212
lldb::eSymbolTypeCode
@ eSymbolTypeCode
Definition: lldb-enumerations.h:616
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:500
lldb_private::RangeDataVector::GetEntryRef
Entry & GetEntryRef(size_t i)
Definition: RangeMap.h:489
CompileUnit.h
SymbolFileDWARF::ParseLineTable
bool ParseLineTable(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:1087
lldb_private::Function::GetAddressRange
const AddressRange & GetAddressRange()
Definition: Function.h:461
SymbolFileDWARF::ResolveTypeUID
lldb_private::Type * ResolveTypeUID(lldb::user_id_t type_uid) override
Definition: SymbolFileDWARF.cpp:1429
TypeMap.h
SymbolFileDWARF::ParseFunctions
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:893
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:530
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:1138
SymbolFileDWARFDebugMap::GetTypes
void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
Definition: SymbolFileDWARFDebugMap.cpp:1051
SymbolFileDWARFDebugMap::CompleteType
bool CompleteType(lldb_private::CompilerType &compiler_type) override
Definition: SymbolFileDWARFDebugMap.cpp:749
lldb_private::ObjectFile::GetSymtab
virtual Symtab * GetSymtab()=0
Gets the symbol table for the currently selected architecture (and object for archives).
SymbolFileDWARF::ParseLanguage
lldb::LanguageType ParseLanguage(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:856
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:932
SymbolFileDWARFDebugMap::ParseBlocksRecursive
size_t ParseBlocksRecursive(lldb_private::Function &func) override
Definition: SymbolFileDWARFDebugMap.cpp:701
lldb_private::eLazyBoolYes
@ eLazyBoolYes
Definition: lldb-private-enumerations.h:115
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
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:33
Module.h
SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE
lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die, lldb_private::ConstString type_name, bool must_be_implementation)
Definition: SymbolFileDWARFDebugMap.cpp:1112
SymbolFileDWARF::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: SymbolFileDWARF.cpp:280
SymbolFileDWARFDebugMap::GetOSOIndexFromUserID
static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid)
Definition: SymbolFileDWARFDebugMap.h:194
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:1033
SymbolFileDWARF
Definition: SymbolFileDWARF.h:58
lldb_private::RangeDataVector::Sort
void Sort()
Definition: RangeMap.h:411
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:648
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
SymbolFileDWARF.h
lldb::eSymbolTypeData
@ eSymbolTypeData
Definition: lldb-enumerations.h:618
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
SymbolFileDWARFDebugMap::InitializeObject
void InitializeObject() override
Initialize the SymbolFile object.
Definition: SymbolFileDWARFDebugMap.cpp:251
lldb_private::Module::GetSymbolFile
virtual SymbolFile * GetSymbolFile(bool can_create=true, Stream *feedback_strm=nullptr)
Get the module's symbol file.
Definition: Module.cpp:1035
lldb_private::SymbolContextList::GetContextAtIndex
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
Definition: SymbolContext.cpp:1262
lldb_private::Module
Definition: Module.h:84
SymbolFileDWARFDebugMap::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type(SymbolFileDWARF *skip_dwarf_oso)
Definition: SymbolFileDWARFDebugMap.cpp:1096
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:313
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:740
lldb_private::SymbolFile::GetObjectFile
ObjectFile * GetObjectFile()
Definition: SymbolFile.h:266
SymbolFileDWARFDebugMap::CreateInstance
static lldb_private::SymbolFile * CreateInstance(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileDWARFDebugMap.cpp:240
SymbolFileDWARFDebugMap::CompileUnitInfo
Definition: SymbolFileDWARFDebugMap.h:167
lldb_private::RangeDataVector::GetEntryAtIndex
const Entry * GetEntryAtIndex(size_t i) const
Definition: RangeMap.h:479
SymbolFileDWARF::SetDebugMapModule
void SetDebugMapModule(const lldb::ModuleSP &module_sp)
Definition: SymbolFileDWARF.h:423
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:373
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::Symtab::SymbolAtIndex
Symbol * SymbolAtIndex(size_t idx)
Definition: Symtab.cpp:210
SymbolFileDWARF::FindNamespace
lldb_private::CompilerDeclContext FindNamespace(lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx) override
Definition: SymbolFileDWARF.cpp:2492
SymbolFileDWARFDebugMap::ParseCallEdgesInFunction
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(lldb_private::UserID func_id) override
Definition: SymbolFileDWARFDebugMap.cpp:1078
RangeMap.h
SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type
bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu)
Definition: SymbolFileDWARF.cpp:2639
SymbolFileDWARFDebugMap::ParseImportedModules
bool ParseImportedModules(const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
Definition: SymbolFileDWARFDebugMap.cpp:692
SymbolFileDWARFDebugMap::ForEachExternalModule
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
Definition: SymbolFileDWARFDebugMap.cpp:664
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:1417
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:1441
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex
CompileUnitInfo * GetCompileUnitInfoForSymbolWithIndex(uint32_t symbol_idx, uint32_t *oso_idx_ptr)
Definition: SymbolFileDWARFDebugMap.cpp:946
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:2080
RemoveFunctionsWithModuleNotEqualTo
static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp, SymbolContextList &sc_list, uint32_t start_idx)
Definition: SymbolFileDWARFDebugMap.cpp:987
lldb_private::RangeDataVector< lldb::addr_t, lldb::addr_t, OSOEntry >::Entry
RangeData< lldb::addr_t, lldb::addr_t, OSOEntry > Entry
Definition: RangeMap.h:401
SymbolFileDWARFDebugMap::GetDeclContextForUID
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARFDebugMap.cpp:1292
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:1309
SymbolFileDWARFDebugMap::ParseIsOptimized
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:684
lldb_private::SymbolFile::SetCompileUnitAtIndex
void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp)
Definition: SymbolFile.cpp:178
SymbolFileDWARFDebugMap::GetCompUnitInfoIndex
uint32_t GetCompUnitInfoIndex(const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:509
lldb_private::Symtab::FindFirstSymbolWithNameAndType
Symbol * FindFirstSymbolWithNameAndType(ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility)
Definition: Symtab.cpp:854
DWARF_LOG_DEBUG_MAP
#define DWARF_LOG_DEBUG_MAP
Definition: LogChannelDWARF.h:18
lldb_private::RangeDataVector::FindEntryThatContains
Entry * FindEntryThatContains(B addr)
Definition: RangeMap.h:514
lldb_private::FileSpec
Definition: FileSpec.h:56
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_sp
OSOInfoSP oso_sp
Definition: SymbolFileDWARFDebugMap.h:171
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::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:858
lldb_private::Function
Definition: Function.h:413
lldb_private::RangeDataVector::Append
void Append(const Entry &entry)
Definition: RangeMap.h:409
SymbolFileDWARF::ForEachExternalModule
bool ForEachExternalModule(lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
Definition: SymbolFileDWARF.cpp:916
ModuleList.h
lldb_private::Function::GetCompileUnit
CompileUnit * GetCompileUnit()
Get accessor for the compile unit that owns this function.
Definition: Function.cpp:362
lldb::eSymbolTypeSourceFile
@ eSymbolTypeSourceFile
Definition: lldb-enumerations.h:622
lldb_private::ConstString::GetStringRef
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:202
SymbolFileDWARFDebugMap::FindDefinitionTypeForDWARFDeclContext
lldb::TypeSP FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx)
Definition: SymbolFileDWARFDebugMap.cpp:1086
lldb::eSymbolTypeObjectFile
@ eSymbolTypeObjectFile
Definition: lldb-enumerations.h:624
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:1257
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:169
SymbolFileDWARFDebugMap::CalculateAbilities
uint32_t CalculateAbilities() override
Definition: SymbolFileDWARFDebugMap.cpp:544
lldb_private::ArchSpec::SetTriple
bool SetTriple(const llvm::Triple &triple)
Architecture triple setter.
Definition: ArchSpec.cpp:739
DebugMapModule
Definition: SymbolFileDWARFDebugMap.cpp:165
SymbolFileDWARFDebugMap::m_func_indexes
std::vector< uint32_t > m_func_indexes
Definition: SymbolFileDWARFDebugMap.h:309
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:290
SymbolFileDWARFDebugMap::GetCompileUnit
lldb::CompUnitSP GetCompileUnit(SymbolFileDWARF *oso_dwarf)
Definition: SymbolFileDWARFDebugMap.cpp:1238
SymbolFileDWARFDebugMap::GetDeclContextContainingUID
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARFDebugMap.cpp:1301
lldb_private::Symbol::GetAddressRef
Address & GetAddressRef()
Definition: Symbol.h:57
SymbolFileDWARFDebugMap::ParseTypes
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:713
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:1278
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:2807
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:470
SymbolFileDWARF::ParseTypes
size_t ParseTypes(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:3021
SymbolFileDWARFDebugMap::GetSymbolFileByOSOIndex
SymbolFileDWARF * GetSymbolFileByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:522
SymbolFileDWARFDebugMap::m_debug_map
DebugMap m_debug_map
Definition: SymbolFileDWARFDebugMap.h:316
LogChannelDWARF.h
lldb::eSymbolTypeObjCClass
@ eSymbolTypeObjCClass
Definition: lldb-enumerations.h:640
lldb_private::SymbolFile::m_objfile_sp
lldb::ObjectFileSP m_objfile_sp
Definition: SymbolFile.h:310
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID
CompileUnitInfo * GetCompileUnitInfoForSymbolWithID(lldb::user_id_t symbol_id, uint32_t *oso_idx_ptr)
Definition: SymbolFileDWARFDebugMap.cpp:967
lldb_private::Symtab::GetIndexForSymbol
uint32_t GetIndexForSymbol(const Symbol *symbol) const
Definition: Symtab.cpp:543
SymbolFileDWARF::GetDeclContextForUID
lldb_private::CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARF.cpp:1406
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:1317
lldb_private::Address::GetSection
lldb::SectionSP GetSection() const
Get const accessor for the section.
Definition: Address.h:420
SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo
lldb_private::Module * GetModuleByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:401
SymbolFileDWARFDebugMap::CompileUnitInfo::oso_mod_time
llvm::sys::TimePoint oso_mod_time
Definition: SymbolFileDWARFDebugMap.h:170
SymbolFileDWARFDebugMap::Initialize
static void Initialize()
Definition: SymbolFileDWARFDebugMap.cpp:222
SymbolFileDWARFDebugMap::ParseFunctions
size_t ParseFunctions(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:640
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:865
VariableList.h
lldb_private::TypeMap
Definition: TypeMap.h:20
lldb_private::RangeDataVector::FindEntryIndexThatContains
uint32_t FindEntryIndexThatContains(B addr) const
Definition: RangeMap.h:496
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:3037
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:612
SymbolFileDWARF::ParseIsOptimized
bool ParseIsOptimized(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:1025
lldb_private::Symbol::GetName
ConstString GetName() const
Definition: Symbol.cpp:500
SymbolFileDWARFDebugMap::GetPluginDescriptionStatic
static const char * GetPluginDescriptionStatic()
Definition: SymbolFileDWARFDebugMap.cpp:236
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:1068
SymbolFileDWARFDebugMap::FinalizeOSOFileRanges
void FinalizeOSOFileRanges(CompileUnitInfo *cu_info)
Definition: SymbolFileDWARFDebugMap.cpp:1341
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:482
SymbolFileDWARFDebugMap::SymbolContainsSymbolWithIndex
static int SymbolContainsSymbolWithIndex(uint32_t *symbol_idx_ptr, const CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:919
SymbolFileDWARF::ParseDebugMacros
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARF.cpp:1164
SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo
SymbolFileDWARF * GetSymbolFileByCompUnitInfo(CompileUnitInfo *comp_unit_info)
Definition: SymbolFileDWARFDebugMap.cpp:537
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:1380
lldb_private::eLazyBoolNo
@ eLazyBoolNo
Definition: lldb-private-enumerations.h:115
lldb_private::RangeDataVector::GetSize
size_t GetSize() const
Definition: RangeMap.h:477
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:1227
SymbolFileDWARFDebugMap::SymbolFileDWARFDebugMap
SymbolFileDWARFDebugMap(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFileDWARFDebugMap.cpp:244
SymbolFileDWARFDebugMap::m_supports_DW_AT_APPLE_objc_complete_type
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type
Definition: SymbolFileDWARFDebugMap.h:315
lldb_private::Type
Definition: Type.h:66
LineTable.h
lldb_private::ObjectFile::ClearSymtab
virtual void ClearSymtab()
Frees the symbol table.
Definition: ObjectFile.cpp:571
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:414
lldb_private::Range::GetByteSize
SizeType GetByteSize() const
Definition: RangeMap.h:71
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
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:730
SymbolFileDWARF::ParseDeclsForContext
void ParseDeclsForContext(lldb_private::CompilerDeclContext decl_ctx) override
Definition: SymbolFileDWARF.cpp:1329
PluginManager.h
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
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:229
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
SymbolFileDWARFDebugMap::InitOSO
void InitOSO()
Definition: SymbolFileDWARFDebugMap.cpp:253
SymbolFileDWARFDebugMap::ParseSupportFiles
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
Definition: SymbolFileDWARFDebugMap.cpp:675
lldb_private::SymbolContextList::IsEmpty
bool IsEmpty() const
Definition: SymbolContext.cpp:1280
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:624
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:2665
SymbolFileDWARFDebugMap::GetModuleByOSOIndex
lldb_private::Module * GetModuleByOSOIndex(uint32_t oso_idx)
Definition: SymbolFileDWARFDebugMap.cpp:394
SymbolFileDWARF::ParseBlocksRecursive
size_t ParseBlocksRecursive(lldb_private::Function &func) override
Definition: SymbolFileDWARF.cpp:3000
DWARFDeclContext
Definition: DWARFDeclContext.h:23
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
SymbolFileDWARFDebugMap::kHaveInitializedOSOs
@ kHaveInitializedOSOs
Definition: SymbolFileDWARFDebugMap.h:148
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:563
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:1408
lldb_private::Symtab::SortSymbolIndexesByValue
void SortSymbolIndexesByValue(std::vector< uint32_t > &indexes, bool remove_duplicates) const
Definition: Symtab.cpp:608
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:1359
SymbolFileDWARFDebugMap::OSOEntry
Definition: SymbolFileDWARFDebugMap.h:279
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:282
SymbolFileDWARF::GetDeclContextContainingUID
lldb_private::CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid) override
Definition: SymbolFileDWARF.cpp:1419
SymbolFileDWARF::ParseSupportFiles
bool ParseSupportFiles(lldb_private::CompileUnit &comp_unit, lldb_private::FileSpecList &support_files) override
lldb_private::Log
Definition: Log.h:49
lldb_private::SourceLocationSpec::GetCheckInlines
bool GetCheckInlines() const
Definition: SourceLocationSpec.h:172
SymbolFileDWARFDebugMap::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: SymbolFileDWARFDebugMap.cpp:231
SymbolFileDWARFDebugMap::ParseDebugMacros
bool ParseDebugMacros(lldb_private::CompileUnit &comp_unit) override
Definition: SymbolFileDWARFDebugMap.cpp:656
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:376
SymbolVendor.h
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:348
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:722
lldb
Definition: SBAddress.h:15
SymbolFileDWARFDebugMap::m_compile_unit_infos
std::vector< CompileUnitInfo > m_compile_unit_infos
Definition: SymbolFileDWARFDebugMap.h:308
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:1496
SymbolFileDWARF::ParseCallEdgesInFunction
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction(UserID func_id) override
Definition: SymbolFileDWARF.cpp:3824
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:58
SymbolFileDWARF::DumpClangAST
void DumpClangAST(lldb_private::Stream &s) override
Definition: SymbolFileDWARF.cpp:3841
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:836
lldb_private::SymbolContextList::RemoveContextAtIndex
bool RemoveContextAtIndex(size_t idx)
Definition: SymbolContext.cpp:1270
lldb_private::Symbol::GetSiblingIndex
uint32_t GetSiblingIndex() const
Definition: Symbol.cpp:169
lldb_private::Symbol::GetID
uint32_t GetID() const
Definition: Symbol.h:111
lldb_private::Range::GetRangeEnd
BaseType GetRangeEnd() const
Definition: RangeMap.h:62