LLDB  mainline
SBModule.cpp
Go to the documentation of this file.
1 //===-- SBModule.cpp ------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "lldb/API/SBModule.h"
10 #include "lldb/API/SBAddress.h"
11 #include "lldb/API/SBFileSpec.h"
12 #include "lldb/API/SBModuleSpec.h"
13 #include "lldb/API/SBProcess.h"
14 #include "lldb/API/SBStream.h"
16 #include "lldb/Core/Module.h"
17 #include "lldb/Core/Section.h"
20 #include "lldb/Symbol/ObjectFile.h"
21 #include "lldb/Symbol/SymbolFile.h"
22 #include "lldb/Symbol/Symtab.h"
23 #include "lldb/Symbol/TypeSystem.h"
25 #include "lldb/Target/Target.h"
28 
29 using namespace lldb;
30 using namespace lldb_private;
31 
33 
34 SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {}
35 
36 SBModule::SBModule(const SBModuleSpec &module_spec) {
37  LLDB_INSTRUMENT_VA(this, module_spec);
38 
39  ModuleSP module_sp;
40  Status error = ModuleList::GetSharedModule(
41  *module_spec.m_opaque_up, module_sp, nullptr, nullptr, nullptr);
42  if (module_sp)
43  SetSP(module_sp);
44 }
45 
46 SBModule::SBModule(const SBModule &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
47  LLDB_INSTRUMENT_VA(this, rhs);
48 }
49 
51  LLDB_INSTRUMENT_VA(this, process, header_addr);
52 
53  ProcessSP process_sp(process.GetSP());
54  if (process_sp) {
55  m_opaque_sp = process_sp->ReadModuleFromMemory(FileSpec(), header_addr);
56  if (m_opaque_sp) {
57  Target &target = process_sp->GetTarget();
58  bool changed = false;
59  m_opaque_sp->SetLoadAddress(target, 0, true, changed);
60  target.GetImages().Append(m_opaque_sp);
61  }
62  }
63 }
64 
66  LLDB_INSTRUMENT_VA(this, rhs);
67 
68  if (this != &rhs)
70  return *this;
71 }
72 
73 SBModule::~SBModule() = default;
74 
75 bool SBModule::IsValid() const {
76  LLDB_INSTRUMENT_VA(this);
77  return this->operator bool();
78 }
79 SBModule::operator bool() const {
80  LLDB_INSTRUMENT_VA(this);
81 
82  return m_opaque_sp.get() != nullptr;
83 }
84 
86  LLDB_INSTRUMENT_VA(this);
87 
88  m_opaque_sp.reset();
89 }
90 
91 bool SBModule::IsFileBacked() const {
92  LLDB_INSTRUMENT_VA(this);
93 
94  ModuleSP module_sp(GetSP());
95  if (!module_sp)
96  return false;
97 
98  ObjectFile *obj_file = module_sp->GetObjectFile();
99  if (!obj_file)
100  return false;
101 
102  return !obj_file->IsInMemory();
103 }
104 
106  LLDB_INSTRUMENT_VA(this);
107 
108  SBFileSpec file_spec;
109  ModuleSP module_sp(GetSP());
110  if (module_sp)
111  file_spec.SetFileSpec(module_sp->GetFileSpec());
112 
113  return file_spec;
114 }
115 
117  LLDB_INSTRUMENT_VA(this);
118 
119  SBFileSpec file_spec;
120  ModuleSP module_sp(GetSP());
121  if (module_sp)
122  file_spec.SetFileSpec(module_sp->GetPlatformFileSpec());
123 
124  return file_spec;
125 }
126 
128  LLDB_INSTRUMENT_VA(this, platform_file);
129 
130  bool result = false;
131 
132  ModuleSP module_sp(GetSP());
133  if (module_sp) {
134  module_sp->SetPlatformFileSpec(*platform_file);
135  result = true;
136  }
137 
138  return result;
139 }
140 
142  LLDB_INSTRUMENT_VA(this);
143 
144  SBFileSpec sb_file_spec;
145  ModuleSP module_sp(GetSP());
146  if (module_sp)
147  sb_file_spec.SetFileSpec(module_sp->GetRemoteInstallFileSpec());
148  return sb_file_spec;
149 }
150 
152  LLDB_INSTRUMENT_VA(this, file);
153 
154  ModuleSP module_sp(GetSP());
155  if (module_sp) {
156  module_sp->SetRemoteInstallFileSpec(file.ref());
157  return true;
158  }
159  return false;
160 }
161 
162 const uint8_t *SBModule::GetUUIDBytes() const {
163  LLDB_INSTRUMENT_VA(this);
164 
165  const uint8_t *uuid_bytes = nullptr;
166  ModuleSP module_sp(GetSP());
167  if (module_sp)
168  uuid_bytes = module_sp->GetUUID().GetBytes().data();
169 
170  return uuid_bytes;
171 }
172 
173 const char *SBModule::GetUUIDString() const {
174  LLDB_INSTRUMENT_VA(this);
175 
176  const char *uuid_cstr = nullptr;
177  ModuleSP module_sp(GetSP());
178  if (module_sp) {
179  // We are going to return a "const char *" value through the public API, so
180  // we need to constify it so it gets added permanently the string pool and
181  // then we don't need to worry about the lifetime of the string as it will
182  // never go away once it has been put into the ConstString string pool
183  uuid_cstr = ConstString(module_sp->GetUUID().GetAsString()).GetCString();
184  }
185 
186  if (uuid_cstr && uuid_cstr[0]) {
187  return uuid_cstr;
188  }
189 
190  return nullptr;
191 }
192 
193 bool SBModule::operator==(const SBModule &rhs) const {
194  LLDB_INSTRUMENT_VA(this, rhs);
195 
196  if (m_opaque_sp)
197  return m_opaque_sp.get() == rhs.m_opaque_sp.get();
198  return false;
199 }
200 
201 bool SBModule::operator!=(const SBModule &rhs) const {
202  LLDB_INSTRUMENT_VA(this, rhs);
203 
204  if (m_opaque_sp)
205  return m_opaque_sp.get() != rhs.m_opaque_sp.get();
206  return false;
207 }
208 
209 ModuleSP SBModule::GetSP() const { return m_opaque_sp; }
210 
211 void SBModule::SetSP(const ModuleSP &module_sp) { m_opaque_sp = module_sp; }
212 
214  LLDB_INSTRUMENT_VA(this, vm_addr);
215 
216  lldb::SBAddress sb_addr;
217  ModuleSP module_sp(GetSP());
218  if (module_sp) {
219  Address addr;
220  if (module_sp->ResolveFileAddress(vm_addr, addr))
221  sb_addr.ref() = addr;
222  }
223  return sb_addr;
224 }
225 
228  uint32_t resolve_scope) {
229  LLDB_INSTRUMENT_VA(this, addr, resolve_scope);
230 
231  SBSymbolContext sb_sc;
232  ModuleSP module_sp(GetSP());
233  SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope);
234  if (module_sp && addr.IsValid())
235  module_sp->ResolveSymbolContextForAddress(addr.ref(), scope, *sb_sc);
236  return sb_sc;
237 }
238 
239 bool SBModule::GetDescription(SBStream &description) {
240  LLDB_INSTRUMENT_VA(this, description);
241 
242  Stream &strm = description.ref();
243 
244  ModuleSP module_sp(GetSP());
245  if (module_sp) {
246  module_sp->GetDescription(strm.AsRawOstream());
247  } else
248  strm.PutCString("No value");
249 
250  return true;
251 }
252 
254  LLDB_INSTRUMENT_VA(this);
255 
256  ModuleSP module_sp(GetSP());
257  if (module_sp) {
258  return module_sp->GetNumCompileUnits();
259  }
260  return 0;
261 }
262 
264  LLDB_INSTRUMENT_VA(this, index);
265 
266  SBCompileUnit sb_cu;
267  ModuleSP module_sp(GetSP());
268  if (module_sp) {
269  CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(index);
270  sb_cu.reset(cu_sp.get());
271  }
272  return sb_cu;
273 }
274 
276  LLDB_INSTRUMENT_VA(this, sb_file_spec);
277 
278  SBSymbolContextList sb_sc_list;
279  const ModuleSP module_sp(GetSP());
280  if (sb_file_spec.IsValid() && module_sp) {
281  module_sp->FindCompileUnits(*sb_file_spec, *sb_sc_list);
282  }
283  return sb_sc_list;
284 }
285 
286 static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
287  if (module_sp)
288  return module_sp->GetSymtab();
289  return nullptr;
290 }
291 
293  LLDB_INSTRUMENT_VA(this);
294 
295  ModuleSP module_sp(GetSP());
296  if (Symtab *symtab = GetUnifiedSymbolTable(module_sp))
297  return symtab->GetNumSymbols();
298  return 0;
299 }
300 
302  LLDB_INSTRUMENT_VA(this, idx);
303 
304  SBSymbol sb_symbol;
305  ModuleSP module_sp(GetSP());
306  Symtab *symtab = GetUnifiedSymbolTable(module_sp);
307  if (symtab)
308  sb_symbol.SetSymbol(symtab->SymbolAtIndex(idx));
309  return sb_symbol;
310 }
311 
313  lldb::SymbolType symbol_type) {
314  LLDB_INSTRUMENT_VA(this, name, symbol_type);
315 
316  SBSymbol sb_symbol;
317  if (name && name[0]) {
318  ModuleSP module_sp(GetSP());
319  Symtab *symtab = GetUnifiedSymbolTable(module_sp);
320  if (symtab)
321  sb_symbol.SetSymbol(symtab->FindFirstSymbolWithNameAndType(
322  ConstString(name), symbol_type, Symtab::eDebugAny,
323  Symtab::eVisibilityAny));
324  }
325  return sb_symbol;
326 }
327 
329  lldb::SymbolType symbol_type) {
330  LLDB_INSTRUMENT_VA(this, name, symbol_type);
331 
332  SBSymbolContextList sb_sc_list;
333  if (name && name[0]) {
334  ModuleSP module_sp(GetSP());
335  Symtab *symtab = GetUnifiedSymbolTable(module_sp);
336  if (symtab) {
337  std::vector<uint32_t> matching_symbol_indexes;
338  symtab->FindAllSymbolsWithNameAndType(ConstString(name), symbol_type,
339  matching_symbol_indexes);
340  const size_t num_matches = matching_symbol_indexes.size();
341  if (num_matches) {
342  SymbolContext sc;
343  sc.module_sp = module_sp;
344  SymbolContextList &sc_list = *sb_sc_list;
345  for (size_t i = 0; i < num_matches; ++i) {
346  sc.symbol = symtab->SymbolAtIndex(matching_symbol_indexes[i]);
347  if (sc.symbol)
348  sc_list.Append(sc);
349  }
350  }
351  }
352  }
353  return sb_sc_list;
354 }
355 
357  LLDB_INSTRUMENT_VA(this);
358 
359  ModuleSP module_sp(GetSP());
360  if (module_sp) {
361  // Give the symbol vendor a chance to add to the unified section list.
362  module_sp->GetSymbolFile();
363  SectionList *section_list = module_sp->GetSectionList();
364  if (section_list)
365  return section_list->GetSize();
366  }
367  return 0;
368 }
369 
371  LLDB_INSTRUMENT_VA(this, idx);
372 
373  SBSection sb_section;
374  ModuleSP module_sp(GetSP());
375  if (module_sp) {
376  // Give the symbol vendor a chance to add to the unified section list.
377  module_sp->GetSymbolFile();
378  SectionList *section_list = module_sp->GetSectionList();
379 
380  if (section_list)
381  sb_section.SetSP(section_list->GetSectionAtIndex(idx));
382  }
383  return sb_section;
384 }
385 
387  uint32_t name_type_mask) {
388  LLDB_INSTRUMENT_VA(this, name, name_type_mask);
389 
390  lldb::SBSymbolContextList sb_sc_list;
391  ModuleSP module_sp(GetSP());
392  if (name && module_sp) {
393 
394  ModuleFunctionSearchOptions function_options;
395  function_options.include_symbols = true;
396  function_options.include_inlines = true;
397  FunctionNameType type = static_cast<FunctionNameType>(name_type_mask);
398  module_sp->FindFunctions(ConstString(name), CompilerDeclContext(), type,
399  function_options, *sb_sc_list);
400  }
401  return sb_sc_list;
402 }
403 
405  uint32_t max_matches) {
406  LLDB_INSTRUMENT_VA(this, target, name, max_matches);
407 
408  SBValueList sb_value_list;
409  ModuleSP module_sp(GetSP());
410  if (name && module_sp) {
411  VariableList variable_list;
412  module_sp->FindGlobalVariables(ConstString(name), CompilerDeclContext(),
413  max_matches, variable_list);
414  for (const VariableSP &var_sp : variable_list) {
415  lldb::ValueObjectSP valobj_sp;
416  TargetSP target_sp(target.GetSP());
417  valobj_sp = ValueObjectVariable::Create(target_sp.get(), var_sp);
418  if (valobj_sp)
419  sb_value_list.Append(SBValue(valobj_sp));
420  }
421  }
422 
423  return sb_value_list;
424 }
425 
427  const char *name) {
428  LLDB_INSTRUMENT_VA(this, target, name);
429 
430  SBValueList sb_value_list(FindGlobalVariables(target, name, 1));
431  if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0)
432  return sb_value_list.GetValueAtIndex(0);
433  return SBValue();
434 }
435 
436 lldb::SBType SBModule::FindFirstType(const char *name_cstr) {
437  LLDB_INSTRUMENT_VA(this, name_cstr);
438 
439  SBType sb_type;
440  ModuleSP module_sp(GetSP());
441  if (name_cstr && module_sp) {
442  SymbolContext sc;
443  const bool exact_match = false;
444  ConstString name(name_cstr);
445 
446  sb_type = SBType(module_sp->FindFirstType(sc, name, exact_match));
447 
448  if (!sb_type.IsValid()) {
449  auto type_system_or_err =
450  module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
451  if (auto err = type_system_or_err.takeError()) {
452  llvm::consumeError(std::move(err));
453  return SBType();
454  }
455  sb_type = SBType(type_system_or_err->GetBuiltinTypeByName(name));
456  }
457  }
458  return sb_type;
459 }
460 
462  LLDB_INSTRUMENT_VA(this, type);
463 
464  ModuleSP module_sp(GetSP());
465  if (module_sp) {
466  auto type_system_or_err =
467  module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
468  if (auto err = type_system_or_err.takeError()) {
469  llvm::consumeError(std::move(err));
470  } else {
471  return SBType(type_system_or_err->GetBasicTypeFromAST(type));
472  }
473  }
474  return SBType();
475 }
476 
478  LLDB_INSTRUMENT_VA(this, type);
479 
480  SBTypeList retval;
481 
482  ModuleSP module_sp(GetSP());
483  if (type && module_sp) {
484  TypeList type_list;
485  const bool exact_match = false;
486  ConstString name(type);
487  llvm::DenseSet<SymbolFile *> searched_symbol_files;
488  module_sp->FindTypes(name, exact_match, UINT32_MAX, searched_symbol_files,
489  type_list);
490 
491  if (type_list.Empty()) {
492  auto type_system_or_err =
493  module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
494  if (auto err = type_system_or_err.takeError()) {
495  llvm::consumeError(std::move(err));
496  } else {
497  CompilerType compiler_type =
498  type_system_or_err->GetBuiltinTypeByName(name);
499  if (compiler_type)
500  retval.Append(SBType(compiler_type));
501  }
502  } else {
503  for (size_t idx = 0; idx < type_list.GetSize(); idx++) {
504  TypeSP type_sp(type_list.GetTypeAtIndex(idx));
505  if (type_sp)
506  retval.Append(SBType(type_sp));
507  }
508  }
509  }
510  return retval;
511 }
512 
514  LLDB_INSTRUMENT_VA(this, uid);
515 
516  ModuleSP module_sp(GetSP());
517  if (module_sp) {
518  if (SymbolFile *symfile = module_sp->GetSymbolFile()) {
519  Type *type_ptr = symfile->ResolveTypeUID(uid);
520  if (type_ptr)
521  return SBType(type_ptr->shared_from_this());
522  }
523  }
524  return SBType();
525 }
526 
528  LLDB_INSTRUMENT_VA(this, type_mask);
529 
530  SBTypeList sb_type_list;
531 
532  ModuleSP module_sp(GetSP());
533  if (!module_sp)
534  return sb_type_list;
535  SymbolFile *symfile = module_sp->GetSymbolFile();
536  if (!symfile)
537  return sb_type_list;
538 
539  TypeClass type_class = static_cast<TypeClass>(type_mask);
540  TypeList type_list;
541  symfile->GetTypes(nullptr, type_class, type_list);
542  sb_type_list.m_opaque_up->Append(type_list);
543  return sb_type_list;
544 }
545 
546 SBSection SBModule::FindSection(const char *sect_name) {
547  LLDB_INSTRUMENT_VA(this, sect_name);
548 
549  SBSection sb_section;
550 
551  ModuleSP module_sp(GetSP());
552  if (sect_name && module_sp) {
553  // Give the symbol vendor a chance to add to the unified section list.
554  module_sp->GetSymbolFile();
555  SectionList *section_list = module_sp->GetSectionList();
556  if (section_list) {
557  ConstString const_sect_name(sect_name);
558  SectionSP section_sp(section_list->FindSectionByName(const_sect_name));
559  if (section_sp) {
560  sb_section.SetSP(section_sp);
561  }
562  }
563  }
564  return sb_section;
565 }
566 
568  LLDB_INSTRUMENT_VA(this);
569 
570  ModuleSP module_sp(GetSP());
571  if (module_sp)
572  return module_sp->GetArchitecture().GetByteOrder();
573  return eByteOrderInvalid;
574 }
575 
576 const char *SBModule::GetTriple() {
577  LLDB_INSTRUMENT_VA(this);
578 
579  ModuleSP module_sp(GetSP());
580  if (module_sp) {
581  std::string triple(module_sp->GetArchitecture().GetTriple().str());
582  // Unique the string so we don't run into ownership issues since the const
583  // strings put the string into the string pool once and the strings never
584  // comes out
585  ConstString const_triple(triple.c_str());
586  return const_triple.GetCString();
587  }
588  return nullptr;
589 }
590 
592  LLDB_INSTRUMENT_VA(this);
593 
594  ModuleSP module_sp(GetSP());
595  if (module_sp)
596  return module_sp->GetArchitecture().GetAddressByteSize();
597  return sizeof(void *);
598 }
599 
600 uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) {
601  LLDB_INSTRUMENT_VA(this, versions, num_versions);
602 
603  llvm::VersionTuple version;
604  if (ModuleSP module_sp = GetSP())
605  version = module_sp->GetVersion();
606  uint32_t result = 0;
607  if (!version.empty())
608  ++result;
609  if (version.getMinor())
610  ++result;
611  if (version.getSubminor())
612  ++result;
613 
614  if (!versions)
615  return result;
616 
617  if (num_versions > 0)
618  versions[0] = version.empty() ? UINT32_MAX : version.getMajor();
619  if (num_versions > 1)
620  versions[1] = version.getMinor().getValueOr(UINT32_MAX);
621  if (num_versions > 2)
622  versions[2] = version.getSubminor().getValueOr(UINT32_MAX);
623  for (uint32_t i = 3; i < num_versions; ++i)
624  versions[i] = UINT32_MAX;
625  return result;
626 }
627 
629  LLDB_INSTRUMENT_VA(this);
630 
631  lldb::SBFileSpec sb_file_spec;
632  ModuleSP module_sp(GetSP());
633  if (module_sp) {
634  if (SymbolFile *symfile = module_sp->GetSymbolFile())
635  sb_file_spec.SetFileSpec(symfile->GetObjectFile()->GetFileSpec());
636  }
637  return sb_file_spec;
638 }
639 
641  LLDB_INSTRUMENT_VA(this);
642 
643  lldb::SBAddress sb_addr;
644  ModuleSP module_sp(GetSP());
645  if (module_sp) {
646  ObjectFile *objfile_ptr = module_sp->GetObjectFile();
647  if (objfile_ptr)
648  sb_addr.ref() = objfile_ptr->GetBaseAddress();
649  }
650  return sb_addr;
651 }
652 
654  LLDB_INSTRUMENT_VA(this);
655 
656  lldb::SBAddress sb_addr;
657  ModuleSP module_sp(GetSP());
658  if (module_sp) {
659  ObjectFile *objfile_ptr = module_sp->GetObjectFile();
660  if (objfile_ptr)
661  sb_addr.ref() = objfile_ptr->GetEntryPointAddress();
662  }
663  return sb_addr;
664 }
665 
667  LLDB_INSTRUMENT();
668 
669  return Module::GetNumberAllocatedModules();
670 }
671 
673  LLDB_INSTRUMENT();
674 
675  const bool mandatory = false;
676  ModuleList::RemoveOrphanSharedModules(mandatory);
677 }
lldb::SBValueList
Definition: SBValueList.h:18
Instrumentation.h
lldb_private::SymbolFile
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:45
lldb_private::SectionList::FindSectionByName
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
Definition: Section.cpp:546
lldb::SBModuleSpec
Definition: SBModuleSpec.h:17
lldb::SBStream::ref
lldb_private::Stream & ref()
Definition: SBStream.cpp:176
lldb::SBModule::~SBModule
~SBModule()
lldb::SBModule::GetCompileUnitAtIndex
lldb::SBCompileUnit GetCompileUnitAtIndex(uint32_t)
Definition: SBModule.cpp:263
lldb::SBModule::FindFirstType
lldb::SBType FindFirstType(const char *name)
Definition: SBModule.cpp:436
lldb::SBModule::operator!=
bool operator!=(const lldb::SBModule &rhs) const
Definition: SBModule.cpp:201
lldb::SBModule::GetTriple
const char * GetTriple()
Definition: SBModule.cpp:576
SBModule.h
lldb::SBModule::GetByteOrder
lldb::ByteOrder GetByteOrder()
Definition: SBModule.cpp:567
lldb::SBCompileUnit
Definition: SBCompileUnit.h:17
lldb::SBModuleSpec::m_opaque_up
std::unique_ptr< lldb_private::ModuleSpec > m_opaque_up
Definition: SBModuleSpec.h:87
lldb::SBModule::GetTypes
lldb::SBTypeList GetTypes(uint32_t type_mask=lldb::eTypeClassAny)
Get all types matching type_mask from debug info in this module.
Definition: SBModule.cpp:527
lldb::SBModule::GetAddressByteSize
uint32_t GetAddressByteSize()
Definition: SBModule.cpp:591
SBModuleSpec.h
lldb::SBModule::SBModule
SBModule()
Definition: SBModule.cpp:32
lldb_private::SymbolContextList::Append
void Append(const SymbolContext &sc)
Append a new symbol context to the list.
Definition: SymbolContext.cpp:1189
lldb::SBModule::FindFirstGlobalVariable
lldb::SBValue FindFirstGlobalVariable(lldb::SBTarget &target, const char *name)
Find the first global (or static) variable by name.
Definition: SBModule.cpp:426
lldb_private::SectionList::GetSize
size_t GetSize() const
Definition: Section.h:74
lldb::SBModule::GetSymbolAtIndex
lldb::SBSymbol GetSymbolAtIndex(size_t idx)
Definition: SBModule.cpp:301
lldb::SBValue
Definition: SBValue.h:21
lldb::SBModule::FindSection
lldb::SBSection FindSection(const char *sect_name)
Definition: SBModule.cpp:546
Module.h
lldb::SBSymbol
Definition: SBSymbol.h:19
lldb::SBModule::Clear
void Clear()
Definition: SBModule.cpp:85
lldb::SBSymbolContextList
Definition: SBSymbolContextList.h:17
lldb::SBModule::GetPlatformFileSpec
lldb::SBFileSpec GetPlatformFileSpec() const
Get accessor for the module platform file specification.
Definition: SBModule.cpp:116
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::SectionList
Definition: Section.h:34
lldb::SBModule::GetBasicType
lldb::SBType GetBasicType(lldb::BasicType type)
Definition: SBModule.cpp:461
LLDB_INSTRUMENT
#define LLDB_INSTRUMENT()
Definition: Instrumentation.h:95
lldb::SBProcess
Definition: SBProcess.h:23
lldb_private::Stream
Definition: Stream.h:28
lldb_private::TypeList::GetTypeAtIndex
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeList.cpp:66
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
lldb::BasicType
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
Definition: lldb-enumerations.h:741
lldb_private::ModuleFunctionSearchOptions::include_symbols
bool include_symbols
Include the symbol table.
Definition: Module.h:65
lldb::SBModule::FindCompileUnits
lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec)
Find compile units related to *this module and passed source file.
Definition: SBModule.cpp:275
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:464
Section.h
SBSymbolContextList.h
lldb::SBFileSpec::SetFileSpec
void SetFileSpec(const lldb_private::FileSpec &fspec)
Definition: SBFileSpec.cpp:164
lldb::SBModule::GetNumSections
size_t GetNumSections()
Definition: SBModule.cpp:356
lldb_private::Target::GetImages
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:938
lldb::SBModule::IsValid
bool IsValid() const
Definition: SBModule.cpp:75
lldb_private::VariableList
Definition: VariableList.h:18
lldb::SBModule::IsFileBacked
bool IsFileBacked() const
Definition: SBModule.cpp:91
lldb_private::ModuleFunctionSearchOptions::include_inlines
bool include_inlines
Include inlined functions.
Definition: Module.h:67
lldb::SBValueList::GetValueAtIndex
lldb::SBValue GetValueAtIndex(uint32_t idx) const
Definition: SBValueList.cpp:147
Target.h
lldb::SBModule::GarbageCollectAllocatedModules
static void GarbageCollectAllocatedModules()
Remove any global modules which are no longer needed.
Definition: SBModule.cpp:672
lldb::SBValueList::IsValid
bool IsValid() const
Definition: SBValueList.cpp:86
lldb::SBTarget
Definition: SBTarget.h:29
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::FileSpec
Definition: FileSpec.h:56
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::SymbolContext::symbol
Symbol * symbol
The Symbol for a given query.
Definition: SymbolContext.h:323
SBStream.h
lldb::SBModule::GetUUIDString
const char * GetUUIDString() const
Definition: SBModule.cpp:173
lldb_private::TypeList::Empty
bool Empty() const
Definition: TypeList.h:37
lldb::SBModule::GetRemoteInstallFileSpec
lldb::SBFileSpec GetRemoteInstallFileSpec()
Get accessor for the remote install path for a module.
Definition: SBModule.cpp:141
SBFileSpec.h
lldb::SBModule::SetSP
void SetSP(const ModuleSP &module_sp)
Definition: SBModule.cpp:211
lldb::SBModule::m_opaque_sp
lldb::ModuleSP m_opaque_sp
Definition: SBModule.h:313
GetUnifiedSymbolTable
static Symtab * GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp)
Definition: SBModule.cpp:286
lldb_private::ObjectFile::GetBaseAddress
virtual lldb_private::Address GetBaseAddress()
Returns base address of this object file.
Definition: ObjectFile.h:497
StreamString.h
lldb::SBModule::GetVersion
uint32_t GetVersion(uint32_t *versions, uint32_t num_versions)
Get the module version numbers.
Definition: SBModule.cpp:600
lldb_private::TypeList::GetSize
uint32_t GetSize() const
Definition: TypeList.cpp:60
lldb_private::ConstString
Definition: ConstString.h:40
lldb::SBValueList::Append
void Append(const lldb::SBValue &val_obj)
Definition: SBValueList.cpp:124
lldb::SBFileSpec::ref
const lldb_private::FileSpec & ref() const
Definition: SBFileSpec.cpp:162
lldb::SBFileSpec::IsValid
bool IsValid() const
Definition: SBFileSpec.cpp:76
lldb::SBAddress::IsValid
bool IsValid() const
Definition: SBAddress.cpp:72
lldb::SBModule::GetNumCompileUnits
uint32_t GetNumCompileUnits()
Definition: SBModule.cpp:253
lldb::SBModule::GetNumberAllocatedModules
static uint32_t GetNumberAllocatedModules()
Get the number of global modules.
Definition: SBModule.cpp:666
lldb_private::SectionList::GetSectionAtIndex
lldb::SectionSP GetSectionAtIndex(size_t idx) const
Definition: Section.cpp:538
lldb::SBSection
Definition: SBSection.h:17
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb::SBModule::SBType
friend class SBType
Definition: SBModule.h:305
lldb::SBModule::ResolveSymbolContextForAddress
lldb::SBSymbolContext ResolveSymbolContextForAddress(const lldb::SBAddress &addr, uint32_t resolve_scope)
Definition: SBModule.cpp:227
TypeSystem.h
lldb::SymbolType
SymbolType
Symbol types.
Definition: lldb-enumerations.h:612
lldb::SBTypeList::m_opaque_up
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
Definition: SBType.h:264
VariableList.h
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
SBAddress.h
lldb::SBModule::GetObjectFileHeaderAddress
lldb::SBAddress GetObjectFileHeaderAddress() const
Definition: SBModule.cpp:640
ObjectFile.h
lldb::SBType
Definition: SBType.h:104
lldb_private::ModuleFunctionSearchOptions
Options used by Module::FindFunctions.
Definition: Module.h:63
lldb::SBModule::GetSectionAtIndex
lldb::SBSection GetSectionAtIndex(size_t idx)
Definition: SBModule.cpp:370
lldb::SBTypeList
Definition: SBType.h:243
lldb::SBModule::GetObjectFileEntryPointAddress
lldb::SBAddress GetObjectFileEntryPointAddress() const
Definition: SBModule.cpp:653
lldb_private::Status
Definition: Status.h:44
lldb::SBModule::FindSymbols
lldb::SBSymbolContextList FindSymbols(const char *name, lldb::SymbolType type=eSymbolTypeAny)
Definition: SBModule.cpp:328
lldb::SBSymbolContext
Definition: SBSymbolContext.h:22
lldb::SBModule::SetRemoteInstallFileSpec
bool SetRemoteInstallFileSpec(lldb::SBFileSpec &file)
Set accessor for the remote install path for a module.
Definition: SBModule.cpp:151
lldb::eByteOrderInvalid
@ eByteOrderInvalid
Definition: lldb-enumerations.h:139
lldb_private::Symtab
Definition: Symtab.h:22
lldb::SBModule::FindSymbol
lldb::SBSymbol FindSymbol(const char *name, lldb::SymbolType type=eSymbolTypeAny)
Definition: SBModule.cpp:312
uint32_t
lldb::SBProcess::GetSP
lldb::ProcessSP GetSP() const
Definition: SBProcess.cpp:102
lldb::SBModule::ResolveFileAddress
lldb::SBAddress ResolveFileAddress(lldb::addr_t vm_addr)
Definition: SBModule.cpp:213
lldb_private::Address
Definition: Address.h:59
lldb_private::Type
Definition: Type.h:66
lldb::SBModule
Definition: SBModule.h:20
Symtab.h
lldb::SBModule::GetTypeByID
lldb::SBType GetTypeByID(lldb::user_id_t uid)
Get a type using its type ID.
Definition: SBModule.cpp:513
lldb_private::Stream::AsRawOstream
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
Definition: Stream.h:357
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
lldb::SBCompileUnit::reset
void reset(lldb_private::CompileUnit *lldb_object_ptr)
Definition: SBCompileUnit.cpp:220
lldb::SBValue
class LLDB_API SBValue
Definition: SBDefines.h:103
lldb_private::SymbolContext::module_sp
lldb::ModuleSP module_sp
The Module for a given query.
Definition: SymbolContext.h:318
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
lldb::SBModule::GetSP
ModuleSP GetSP() const
Definition: SBModule.cpp:209
lldb::SBFileSpec
Definition: SBFileSpec.h:16
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb::SBAddress
Definition: SBAddress.h:17
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb::SBModule::FindGlobalVariables
lldb::SBValueList FindGlobalVariables(lldb::SBTarget &target, const char *name, uint32_t max_matches)
Find global and static variables by name.
Definition: SBModule.cpp:404
lldb::eLanguageTypeC
@ eLanguageTypeC
Non-standardized C, such as K&R.
Definition: lldb-enumerations.h:439
lldb::SBAddress::ref
lldb_private::Address & ref()
Definition: SBAddress.cpp:173
lldb::SBModule::GetUUIDBytes
const uint8_t * GetUUIDBytes() const
Definition: SBModule.cpp:162
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ObjectFile::IsInMemory
bool IsInMemory() const
Definition: ObjectFile.h:676
lldb::SBModule::FindFunctions
lldb::SBSymbolContextList FindFunctions(const char *name, uint32_t name_type_mask=lldb::eFunctionNameTypeAny)
Find functions by name.
Definition: SBModule.cpp:386
lldb_private::TypeList
Definition: TypeList.h:20
lldb_private::Symtab::FindAllSymbolsWithNameAndType
void FindAllSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, std::vector< uint32_t > &symbol_indexes)
Definition: Symtab.cpp:811
lldb::SBTarget::GetSP
lldb::TargetSP GetSP() const
Definition: SBTarget.cpp:576
LLDB_INSTRUMENT_VA
#define LLDB_INSTRUMENT_VA(...)
Definition: Instrumentation.h:98
lldb::SBSymbol::SetSymbol
void SetSymbol(lldb_private::Symbol *lldb_object_ptr)
Definition: SBSymbol.cpp:39
SBProcess.h
lldb::SBModule::operator=
const SBModule & operator=(const SBModule &rhs)
Definition: SBModule.cpp:65
ValueObjectVariable.h
lldb_private::SymbolFile::GetTypes
virtual void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list)=0
lldb::SBTypeList::Append
void Append(lldb::SBType type)
Definition: SBType.cpp:616
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb::SBType::IsValid
bool IsValid() const
Definition: SBType.cpp:108
lldb::SBStream
Definition: SBStream.h:18
lldb::SBModule::GetDescription
bool GetDescription(lldb::SBStream &description)
Definition: SBModule.cpp:239
lldb::SBValueList::GetSize
uint32_t GetSize() const
Definition: SBValueList.cpp:157
lldb
Definition: SBAddress.h:15
lldb::SBModule::GetSymbolFileSpec
lldb::SBFileSpec GetSymbolFileSpec() const
Get accessor for the symbol file specification.
Definition: SBModule.cpp:628
lldb::SBSection::SetSP
void SetSP(const lldb::SectionSP &section_sp)
Definition: SBSection.cpp:114
ValueObjectList.h
lldb::SBModule::GetNumSymbols
size_t GetNumSymbols()
Definition: SBModule.cpp:292
lldb::SBModule::operator==
bool operator==(const lldb::SBModule &rhs) const
Definition: SBModule.cpp:193
lldb::SBModule::FindTypes
lldb::SBTypeList FindTypes(const char *type)
Definition: SBModule.cpp:477
SymbolFile.h
lldb::SBModule::SetPlatformFileSpec
bool SetPlatformFileSpec(const lldb::SBFileSpec &platform_file)
Definition: SBModule.cpp:127
lldb_private::ObjectFile::GetEntryPointAddress
virtual lldb_private::Address GetEntryPointAddress()
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry...
Definition: ObjectFile.h:487
lldb_private::ObjectFile
Definition: ObjectFile.h:60
lldb_private::ModuleList::Append
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
lldb::SBModule::GetFileSpec
lldb::SBFileSpec GetFileSpec() const
Get const accessor for the module file specification.
Definition: SBModule.cpp:105
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138