LLDB  mainline
SBModule.cpp
Go to the documentation of this file.
1 //===-- SBModule.cpp --------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "lldb/API/SBModule.h"
10 #include "SBReproducerPrivate.h"
11 #include "lldb/API/SBAddress.h"
12 #include "lldb/API/SBFileSpec.h"
13 #include "lldb/API/SBModuleSpec.h"
14 #include "lldb/API/SBProcess.h"
15 #include "lldb/API/SBStream.h"
17 #include "lldb/Core/Module.h"
18 #include "lldb/Core/Section.h"
21 #include "lldb/Symbol/ObjectFile.h"
22 #include "lldb/Symbol/SymbolFile.h"
24 #include "lldb/Symbol/Symtab.h"
25 #include "lldb/Symbol/TypeSystem.h"
27 #include "lldb/Target/Target.h"
29 
30 using namespace lldb;
31 using namespace lldb_private;
32 
33 SBModule::SBModule() : m_opaque_sp() {
35 }
36 
37 SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {}
38 
39 SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() {
40  LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &), module_spec);
41 
42  ModuleSP module_sp;
43  Status error = ModuleList::GetSharedModule(*module_spec.m_opaque_up,
44  module_sp, NULL, NULL, NULL);
45  if (module_sp)
46  SetSP(module_sp);
47 }
48 
49 SBModule::SBModule(const SBModule &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
51 }
52 
54  : m_opaque_sp() {
56  header_addr);
57 
58  ProcessSP process_sp(process.GetSP());
59  if (process_sp) {
60  m_opaque_sp = process_sp->ReadModuleFromMemory(FileSpec(), header_addr);
61  if (m_opaque_sp) {
62  Target &target = process_sp->GetTarget();
63  bool changed = false;
64  m_opaque_sp->SetLoadAddress(target, 0, true, changed);
65  target.GetImages().Append(m_opaque_sp);
66  }
67  }
68 }
69 
72  SBModule, operator=,(const lldb::SBModule &), rhs);
73 
74  if (this != &rhs)
75  m_opaque_sp = rhs.m_opaque_sp;
76  return LLDB_RECORD_RESULT(*this);
77 }
78 
80 
81 bool SBModule::IsValid() const {
83  return this->operator bool();
84 }
85 SBModule::operator bool() const {
86  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, operator bool);
87 
88  return m_opaque_sp.get() != NULL;
89 }
90 
93 
94  m_opaque_sp.reset();
95 }
96 
99 
100  SBFileSpec file_spec;
101  ModuleSP module_sp(GetSP());
102  if (module_sp)
103  file_spec.SetFileSpec(module_sp->GetFileSpec());
104 
105  return LLDB_RECORD_RESULT(file_spec);
106 }
107 
111 
112 
113  SBFileSpec file_spec;
114  ModuleSP module_sp(GetSP());
115  if (module_sp)
116  file_spec.SetFileSpec(module_sp->GetPlatformFileSpec());
117 
118  return LLDB_RECORD_RESULT(file_spec);
119 }
120 
123  (const lldb::SBFileSpec &), platform_file);
124 
125  bool result = false;
126 
127  ModuleSP module_sp(GetSP());
128  if (module_sp) {
129  module_sp->SetPlatformFileSpec(*platform_file);
130  result = true;
131  }
132 
133  return result;
134 }
135 
139 
140  SBFileSpec sb_file_spec;
141  ModuleSP module_sp(GetSP());
142  if (module_sp)
143  sb_file_spec.SetFileSpec(module_sp->GetRemoteInstallFileSpec());
144  return LLDB_RECORD_RESULT(sb_file_spec);
145 }
146 
149  (lldb::SBFileSpec &), file);
150 
151  ModuleSP module_sp(GetSP());
152  if (module_sp) {
153  module_sp->SetRemoteInstallFileSpec(file.ref());
154  return true;
155  }
156  return false;
157 }
158 
159 const uint8_t *SBModule::GetUUIDBytes() const {
161 
162  const uint8_t *uuid_bytes = NULL;
163  ModuleSP module_sp(GetSP());
164  if (module_sp)
165  uuid_bytes = module_sp->GetUUID().GetBytes().data();
166 
167  return uuid_bytes;
168 }
169 
170 const char *SBModule::GetUUIDString() const {
172 
173 
174  const char *uuid_cstr = NULL;
175  ModuleSP module_sp(GetSP());
176  if (module_sp) {
177  // We are going to return a "const char *" value through the public API, so
178  // we need to constify it so it gets added permanently the string pool and
179  // then we don't need to worry about the lifetime of the string as it will
180  // never go away once it has been put into the ConstString string pool
181  uuid_cstr = ConstString(module_sp->GetUUID().GetAsString()).GetCString();
182  }
183 
184  if (uuid_cstr && uuid_cstr[0]) {
185  return uuid_cstr;
186  }
187 
188  return NULL;
189 }
190 
191 bool SBModule::operator==(const SBModule &rhs) const {
192  LLDB_RECORD_METHOD_CONST(bool, SBModule, operator==,(const lldb::SBModule &),
193  rhs);
194 
195  if (m_opaque_sp)
196  return m_opaque_sp.get() == rhs.m_opaque_sp.get();
197  return false;
198 }
199 
200 bool SBModule::operator!=(const SBModule &rhs) const {
201  LLDB_RECORD_METHOD_CONST(bool, SBModule, operator!=,(const lldb::SBModule &),
202  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 
215  (lldb::addr_t), vm_addr);
216 
217  lldb::SBAddress sb_addr;
218  ModuleSP module_sp(GetSP());
219  if (module_sp) {
220  Address addr;
221  if (module_sp->ResolveFileAddress(vm_addr, addr))
222  sb_addr.ref() = addr;
223  }
224  return LLDB_RECORD_RESULT(sb_addr);
225 }
226 
229  uint32_t resolve_scope) {
232  (const lldb::SBAddress &, uint32_t), addr, resolve_scope);
233 
234  SBSymbolContext sb_sc;
235  ModuleSP module_sp(GetSP());
236  SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope);
237  if (module_sp && addr.IsValid())
238  module_sp->ResolveSymbolContextForAddress(addr.ref(), scope, *sb_sc);
239  return LLDB_RECORD_RESULT(sb_sc);
240 }
241 
242 bool SBModule::GetDescription(SBStream &description) {
244  description);
245 
246  Stream &strm = description.ref();
247 
248  ModuleSP module_sp(GetSP());
249  if (module_sp) {
250  module_sp->GetDescription(&strm);
251  } else
252  strm.PutCString("No value");
253 
254  return true;
255 }
256 
259 
260  ModuleSP module_sp(GetSP());
261  if (module_sp) {
262  return module_sp->GetNumCompileUnits();
263  }
264  return 0;
265 }
266 
269  (uint32_t), index);
270 
271  SBCompileUnit sb_cu;
272  ModuleSP module_sp(GetSP());
273  if (module_sp) {
274  CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(index);
275  sb_cu.reset(cu_sp.get());
276  }
277  return LLDB_RECORD_RESULT(sb_cu);
278 }
279 
282  (const lldb::SBFileSpec &), sb_file_spec);
283 
284  SBSymbolContextList sb_sc_list;
285  const ModuleSP module_sp(GetSP());
286  if (sb_file_spec.IsValid() && module_sp) {
287  const bool append = true;
288  module_sp->FindCompileUnits(*sb_file_spec, append, *sb_sc_list);
289  }
290  return LLDB_RECORD_RESULT(sb_sc_list);
291 }
292 
293 static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
294  if (module_sp) {
295  SymbolVendor *symbols = module_sp->GetSymbolVendor();
296  if (symbols)
297  return symbols->GetSymtab();
298  }
299  return NULL;
300 }
301 
304 
305  ModuleSP module_sp(GetSP());
306  if (module_sp) {
307  Symtab *symtab = GetUnifiedSymbolTable(module_sp);
308  if (symtab)
309  return symtab->GetNumSymbols();
310  }
311  return 0;
312 }
313 
316 
317  SBSymbol sb_symbol;
318  ModuleSP module_sp(GetSP());
319  Symtab *symtab = GetUnifiedSymbolTable(module_sp);
320  if (symtab)
321  sb_symbol.SetSymbol(symtab->SymbolAtIndex(idx));
322  return LLDB_RECORD_RESULT(sb_symbol);
323 }
324 
326  lldb::SymbolType symbol_type) {
328  (const char *, lldb::SymbolType), name, symbol_type);
329 
330  SBSymbol sb_symbol;
331  if (name && name[0]) {
332  ModuleSP module_sp(GetSP());
333  Symtab *symtab = GetUnifiedSymbolTable(module_sp);
334  if (symtab)
335  sb_symbol.SetSymbol(symtab->FindFirstSymbolWithNameAndType(
336  ConstString(name), symbol_type, Symtab::eDebugAny,
337  Symtab::eVisibilityAny));
338  }
339  return LLDB_RECORD_RESULT(sb_symbol);
340 }
341 
343  lldb::SymbolType symbol_type) {
345  (const char *, lldb::SymbolType), name, symbol_type);
346 
347  SBSymbolContextList sb_sc_list;
348  if (name && name[0]) {
349  ModuleSP module_sp(GetSP());
350  Symtab *symtab = GetUnifiedSymbolTable(module_sp);
351  if (symtab) {
352  std::vector<uint32_t> matching_symbol_indexes;
353  const size_t num_matches = symtab->FindAllSymbolsWithNameAndType(
354  ConstString(name), symbol_type, matching_symbol_indexes);
355  if (num_matches) {
356  SymbolContext sc;
357  sc.module_sp = module_sp;
358  SymbolContextList &sc_list = *sb_sc_list;
359  for (size_t i = 0; i < num_matches; ++i) {
360  sc.symbol = symtab->SymbolAtIndex(matching_symbol_indexes[i]);
361  if (sc.symbol)
362  sc_list.Append(sc);
363  }
364  }
365  }
366  }
367  return LLDB_RECORD_RESULT(sb_sc_list);
368 }
369 
372 
373  ModuleSP module_sp(GetSP());
374  if (module_sp) {
375  // Give the symbol vendor a chance to add to the unified section list.
376  module_sp->GetSymbolVendor();
377  SectionList *section_list = module_sp->GetSectionList();
378  if (section_list)
379  return section_list->GetSize();
380  }
381  return 0;
382 }
383 
386  idx);
387 
388  SBSection sb_section;
389  ModuleSP module_sp(GetSP());
390  if (module_sp) {
391  // Give the symbol vendor a chance to add to the unified section list.
392  module_sp->GetSymbolVendor();
393  SectionList *section_list = module_sp->GetSectionList();
394 
395  if (section_list)
396  sb_section.SetSP(section_list->GetSectionAtIndex(idx));
397  }
398  return LLDB_RECORD_RESULT(sb_section);
399 }
400 
402  uint32_t name_type_mask) {
404  (const char *, uint32_t), name, name_type_mask);
405 
406  lldb::SBSymbolContextList sb_sc_list;
407  ModuleSP module_sp(GetSP());
408  if (name && module_sp) {
409  const bool append = true;
410  const bool symbols_ok = true;
411  const bool inlines_ok = true;
412  FunctionNameType type = static_cast<FunctionNameType>(name_type_mask);
413  module_sp->FindFunctions(ConstString(name), NULL, type, symbols_ok,
414  inlines_ok, append, *sb_sc_list);
415  }
416  return LLDB_RECORD_RESULT(sb_sc_list);
417 }
418 
420  uint32_t max_matches) {
422  (lldb::SBTarget &, const char *, uint32_t), target, name,
423  max_matches);
424 
425  SBValueList sb_value_list;
426  ModuleSP module_sp(GetSP());
427  if (name && module_sp) {
428  VariableList variable_list;
429  const uint32_t match_count = module_sp->FindGlobalVariables(
430  ConstString(name), NULL, max_matches, variable_list);
431 
432  if (match_count > 0) {
433  for (uint32_t i = 0; i < match_count; ++i) {
434  lldb::ValueObjectSP valobj_sp;
435  TargetSP target_sp(target.GetSP());
436  valobj_sp = ValueObjectVariable::Create(
437  target_sp.get(), variable_list.GetVariableAtIndex(i));
438  if (valobj_sp)
439  sb_value_list.Append(SBValue(valobj_sp));
440  }
441  }
442  }
443 
444  return LLDB_RECORD_RESULT(sb_value_list);
445 }
446 
448  const char *name) {
450  (lldb::SBTarget &, const char *), target, name);
451 
452  SBValueList sb_value_list(FindGlobalVariables(target, name, 1));
453  if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0)
454  return LLDB_RECORD_RESULT(sb_value_list.GetValueAtIndex(0));
455  return LLDB_RECORD_RESULT(SBValue());
456 }
457 
458 lldb::SBType SBModule::FindFirstType(const char *name_cstr) {
460  name_cstr);
461 
462  SBType sb_type;
463  ModuleSP module_sp(GetSP());
464  if (name_cstr && module_sp) {
465  SymbolContext sc;
466  const bool exact_match = false;
467  ConstString name(name_cstr);
468 
469  sb_type = SBType(module_sp->FindFirstType(sc, name, exact_match));
470 
471  if (!sb_type.IsValid()) {
472  TypeSystem *type_system =
473  module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
474  if (type_system)
475  sb_type = SBType(type_system->GetBuiltinTypeByName(name));
476  }
477  }
478  return LLDB_RECORD_RESULT(sb_type);
479 }
480 
483  type);
484 
485  ModuleSP module_sp(GetSP());
486  if (module_sp) {
487  TypeSystem *type_system =
488  module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
489  if (type_system)
490  return LLDB_RECORD_RESULT(SBType(type_system->GetBasicTypeFromAST(type)));
491  }
492  return LLDB_RECORD_RESULT(SBType());
493 }
494 
497  type);
498 
499  SBTypeList retval;
500 
501  ModuleSP module_sp(GetSP());
502  if (type && module_sp) {
503  TypeList type_list;
504  const bool exact_match = false;
505  ConstString name(type);
506  llvm::DenseSet<SymbolFile *> searched_symbol_files;
507  const uint32_t num_matches = module_sp->FindTypes(
508  name, exact_match, UINT32_MAX, searched_symbol_files, type_list);
509 
510  if (num_matches > 0) {
511  for (size_t idx = 0; idx < num_matches; idx++) {
512  TypeSP type_sp(type_list.GetTypeAtIndex(idx));
513  if (type_sp)
514  retval.Append(SBType(type_sp));
515  }
516  } else {
517  TypeSystem *type_system =
518  module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
519  if (type_system) {
520  CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);
521  if (compiler_type)
522  retval.Append(SBType(compiler_type));
523  }
524  }
525  }
526 
527  return LLDB_RECORD_RESULT(retval);
528 }
529 
532  uid);
533 
534  ModuleSP module_sp(GetSP());
535  if (module_sp) {
536  SymbolVendor *vendor = module_sp->GetSymbolVendor();
537  if (vendor) {
538  Type *type_ptr = vendor->ResolveTypeUID(uid);
539  if (type_ptr)
540  return LLDB_RECORD_RESULT(SBType(type_ptr->shared_from_this()));
541  }
542  }
543  return LLDB_RECORD_RESULT(SBType());
544 }
545 
548  type_mask);
549 
550  SBTypeList sb_type_list;
551 
552  ModuleSP module_sp(GetSP());
553  if (!module_sp)
554  return LLDB_RECORD_RESULT(sb_type_list);
555  SymbolVendor *vendor = module_sp->GetSymbolVendor();
556  if (!vendor)
557  return LLDB_RECORD_RESULT(sb_type_list);
558 
559  TypeClass type_class = static_cast<TypeClass>(type_mask);
560  TypeList type_list;
561  vendor->GetTypes(NULL, type_class, type_list);
562  sb_type_list.m_opaque_up->Append(type_list);
563  return LLDB_RECORD_RESULT(sb_type_list);
564 }
565 
566 SBSection SBModule::FindSection(const char *sect_name) {
568  sect_name);
569 
570  SBSection sb_section;
571 
572  ModuleSP module_sp(GetSP());
573  if (sect_name && module_sp) {
574  // Give the symbol vendor a chance to add to the unified section list.
575  module_sp->GetSymbolVendor();
576  SectionList *section_list = module_sp->GetSectionList();
577  if (section_list) {
578  ConstString const_sect_name(sect_name);
579  SectionSP section_sp(section_list->FindSectionByName(const_sect_name));
580  if (section_sp) {
581  sb_section.SetSP(section_sp);
582  }
583  }
584  }
585  return LLDB_RECORD_RESULT(sb_section);
586 }
587 
590 
591  ModuleSP module_sp(GetSP());
592  if (module_sp)
593  return module_sp->GetArchitecture().GetByteOrder();
594  return eByteOrderInvalid;
595 }
596 
597 const char *SBModule::GetTriple() {
599 
600  ModuleSP module_sp(GetSP());
601  if (module_sp) {
602  std::string triple(module_sp->GetArchitecture().GetTriple().str());
603  // Unique the string so we don't run into ownership issues since the const
604  // strings put the string into the string pool once and the strings never
605  // comes out
606  ConstString const_triple(triple.c_str());
607  return const_triple.GetCString();
608  }
609  return NULL;
610 }
611 
614 
615  ModuleSP module_sp(GetSP());
616  if (module_sp)
617  return module_sp->GetArchitecture().GetAddressByteSize();
618  return sizeof(void *);
619 }
620 
621 uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) {
623  versions, num_versions);
624 
625  llvm::VersionTuple version;
626  if (ModuleSP module_sp = GetSP())
627  version = module_sp->GetVersion();
628  uint32_t result = 0;
629  if (!version.empty())
630  ++result;
631  if (version.getMinor())
632  ++result;
633  if(version.getSubminor())
634  ++result;
635 
636  if (!versions)
637  return result;
638 
639  if (num_versions > 0)
640  versions[0] = version.empty() ? UINT32_MAX : version.getMajor();
641  if (num_versions > 1)
642  versions[1] = version.getMinor().getValueOr(UINT32_MAX);
643  if (num_versions > 2)
644  versions[2] = version.getSubminor().getValueOr(UINT32_MAX);
645  for (uint32_t i = 3; i < num_versions; ++i)
646  versions[i] = UINT32_MAX;
647  return result;
648 }
649 
653 
654  lldb::SBFileSpec sb_file_spec;
655  ModuleSP module_sp(GetSP());
656  if (module_sp) {
657  SymbolVendor *symbol_vendor_ptr = module_sp->GetSymbolVendor();
658  if (symbol_vendor_ptr)
659  sb_file_spec.SetFileSpec(symbol_vendor_ptr->GetMainFileSpec());
660  }
661  return LLDB_RECORD_RESULT(sb_file_spec);
662 }
663 
667 
668  lldb::SBAddress sb_addr;
669  ModuleSP module_sp(GetSP());
670  if (module_sp) {
671  ObjectFile *objfile_ptr = module_sp->GetObjectFile();
672  if (objfile_ptr)
673  sb_addr.ref() = objfile_ptr->GetBaseAddress();
674  }
675  return LLDB_RECORD_RESULT(sb_addr);
676 }
677 
681 
682  lldb::SBAddress sb_addr;
683  ModuleSP module_sp(GetSP());
684  if (module_sp) {
685  ObjectFile *objfile_ptr = module_sp->GetObjectFile();
686  if (objfile_ptr)
687  sb_addr.ref() = objfile_ptr->GetEntryPointAddress();
688  }
689  return LLDB_RECORD_RESULT(sb_addr);
690 }
691 
692 namespace lldb_private {
693 namespace repro {
694 
695 template <>
702  SBModule, operator=,(const lldb::SBModule &));
704  LLDB_REGISTER_METHOD_CONST(bool, SBModule, operator bool, ());
705  LLDB_REGISTER_METHOD(void, SBModule, Clear, ());
708  ());
710  (const lldb::SBFileSpec &));
712  ());
714  (lldb::SBFileSpec &));
717  SBModule, operator==,(const lldb::SBModule &));
719  SBModule, operator!=,(const lldb::SBModule &));
721  (lldb::addr_t));
724  (const lldb::SBAddress &, uint32_t));
728  (uint32_t));
730  (const lldb::SBFileSpec &));
734  (const char *, lldb::SymbolType));
736  (const char *, lldb::SymbolType));
739  (size_t));
741  (const char *, uint32_t));
743  (lldb::SBTarget &, const char *, uint32_t));
745  (lldb::SBTarget &, const char *));
748  (lldb::BasicType));
751  (lldb::user_id_t));
754  (const char *));
756  LLDB_REGISTER_METHOD(const char *, SBModule, GetTriple, ());
759  (uint32_t *, uint32_t));
761  ());
766 }
767 
768 }
769 }
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:61
The registry contains a unique mapping between functions and their ID.
virtual lldb_private::Address GetBaseAddress()
Returns base address of this object file.
Definition: ObjectFile.h:478
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeList.cpp:66
Defines a list of symbol context objects.
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
FileSpec GetMainFileSpec() const
lldb::SBAddress ResolveFileAddress(lldb::addr_t vm_addr)
Definition: SBModule.cpp:213
uint32_t GetSize() const
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:33
lldb::SBSection GetSectionAtIndex(size_t idx)
Definition: SBModule.cpp:384
lldb::SBFileSpec GetRemoteInstallFileSpec()
Get accessor for the remote install path for a module.
Definition: SBModule.cpp:136
const uint8_t * GetUUIDBytes() const
Definition: SBModule.cpp:159
lldb::SBSymbolContext ResolveSymbolContextForAddress(const lldb::SBAddress &addr, uint32_t resolve_scope)
Definition: SBModule.cpp:228
bool SetRemoteInstallFileSpec(lldb::SBFileSpec &file)
Set accessor for the remote install path for a module.
Definition: SBModule.cpp:147
A file utility class.
Definition: FileSpec.h:55
lldb::SBValue GetValueAtIndex(uint32_t idx) const
lldb::SBSymbolContextList FindFunctions(const char *name, uint32_t name_type_mask=lldb::eFunctionNameTypeAny)
Find functions by name.
Definition: SBModule.cpp:401
size_t GetNumSymbols() const
Definition: Symtab.cpp:63
A plug-in interface definition class for object file parsers.
Definition: ObjectFile.h:58
lldb::SBType GetTypeByID(lldb::user_id_t uid)
Get a type using its type ID.
Definition: SBModule.cpp:530
lldb::SBSymbol FindSymbol(const char *name, lldb::SymbolType type=eSymbolTypeAny)
Definition: SBModule.cpp:325
lldb::SBAddress GetObjectFileHeaderAddress() const
Definition: SBModule.cpp:664
Symbol * symbol
The Symbol for a given query.
void Append(lldb::SBType type)
Definition: SBType.cpp:598
lldb::SBAddress GetObjectFileEntryPointAddress() const
Definition: SBModule.cpp:678
bool IsValid() const
Definition: SBFileSpec.cpp:79
lldb::SBValueList FindGlobalVariables(lldb::SBTarget &target, const char *name, uint32_t max_matches)
Find global and static variables by name.
Definition: SBModule.cpp:419
lldb::SBFileSpec GetSymbolFileSpec() const
Get accessor for the symbol file specification.
Definition: SBModule.cpp:650
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb::VariableSP GetVariableAtIndex(size_t idx) const
size_t FindAllSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, std::vector< uint32_t > &symbol_indexes)
Definition: Symtab.cpp:772
lldb::SBTypeList GetTypes(uint32_t type_mask=lldb::eTypeClassAny)
Get all types matching type_mask from debug info in this module.
Definition: SBModule.cpp:546
virtual lldb_private::Address GetEntryPointAddress()
Returns the address of the Entry Point in this object file - if the object file doesn&#39;t have an entry...
Definition: ObjectFile.h:468
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
uint64_t user_id_t
Definition: lldb-types.h:84
lldb::TargetSP GetSP() const
Definition: SBTarget.cpp:600
lldb::SBValue FindFirstGlobalVariable(lldb::SBTarget &target, const char *name)
Find the first global (or static) variable by name.
Definition: SBModule.cpp:447
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
lldb::SBTypeList FindTypes(const char *type)
Definition: SBModule.cpp:495
lldb_private::Address & ref()
Definition: SBAddress.cpp:188
class LLDB_API SBValue
Definition: SBDefines.h:90
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
const SBModule & operator=(const SBModule &rhs)
Definition: SBModule.cpp:70
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
Definition: Section.cpp:505
size_t GetNumSymbols()
Definition: SBModule.cpp:302
bool operator==(const lldb::SBModule &rhs) const
Definition: SBModule.cpp:191
bool GetDescription(lldb::SBStream &description)
Definition: SBModule.cpp:242
virtual CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type)=0
lldb::SBType FindFirstType(const char *name)
Definition: SBModule.cpp:458
bool IsValid() const
Definition: SBValueList.cpp:88
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
lldb::ProcessSP GetSP() const
Definition: SBProcess.cpp:106
static Symtab * GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp)
Definition: SBModule.cpp:293
lldb::SBCompileUnit GetCompileUnitAtIndex(uint32_t)
Definition: SBModule.cpp:267
lldb::SectionSP GetSectionAtIndex(size_t idx) const
Definition: Section.cpp:497
bool operator!=(const lldb::SBModule &rhs) const
Definition: SBModule.cpp:200
uint32_t GetAddressByteSize()
Definition: SBModule.cpp:612
void Append(const SymbolContext &sc)
Append a new symbol context to the list.
A section + offset based address class.
Definition: Address.h:80
Symbol * FindFirstSymbolWithNameAndType(ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility)
Definition: Symtab.cpp:824
lldb::SBFileSpec GetFileSpec() const
Get const accessor for the module file specification.
Definition: SBModule.cpp:97
Symbol * SymbolAtIndex(size_t idx)
Definition: Symtab.cpp:203
void Clear()
Definition: SBModule.cpp:91
lldb_private::Stream & ref()
Definition: SBStream.cpp:162
virtual Type * ResolveTypeUID(lldb::user_id_t type_uid)
const char * GetTriple()
Definition: SBModule.cpp:597
#define LLDB_RECORD_METHOD_CONST(Result, Class, Method, Signature,...)
bool SetPlatformFileSpec(const lldb::SBFileSpec &platform_file)
Definition: SBModule.cpp:121
lldb::ByteOrder GetByteOrder()
Definition: SBModule.cpp:588
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:899
size_t GetNumSections()
Definition: SBModule.cpp:370
uint64_t addr_t
Definition: lldb-types.h:83
A uniqued constant string class.
Definition: ConstString.h:38
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:247
virtual size_t GetTypes(SymbolContextScope *sc_scope, lldb::TypeClass type_mask, TypeList &type_list)
const char * GetUUIDString() const
Definition: SBModule.cpp:170
class LLDB_API SBType
Definition: SBDefines.h:78
uint32_t GetVersion(uint32_t *versions, uint32_t num_versions)
Get the module version numbers.
Definition: SBModule.cpp:621
lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec)
Find compile units related to *this module and passed source file.
Definition: SBModule.cpp:280
bool IsValid() const
Definition: SBModule.cpp:81
Non-standardized C, such as K&R.
lldb::ModuleSP module_sp
The Module for a given query.
Definition: SBAddress.h:15
size_t GetSize() const
Definition: Section.h:83
lldb::SBSection FindSection(const char *sect_name)
Definition: SBModule.cpp:566
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
lldb::SBFileSpec GetPlatformFileSpec() const
Get accessor for the module platform file specification.
Definition: SBModule.cpp:108
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
lldb::SBSymbol GetSymbolAtIndex(size_t idx)
Definition: SBModule.cpp:314
bool IsValid() const
Definition: SBType.cpp:108
virtual CompilerType GetBuiltinTypeByName(ConstString name)
Definition: TypeSystem.cpp:95
#define LLDB_RECORD_RESULT(Result)
virtual Symtab * GetSymtab()
void RegisterMethods< SBModule >(Registry &R)
Definition: SBModule.cpp:696
uint32_t GetNumCompileUnits()
Definition: SBModule.cpp:257
lldb::SBType GetBasicType(lldb::BasicType type)
Definition: SBModule.cpp:481
bool IsValid() const
Definition: SBAddress.cpp:79
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
lldb::SBSymbolContextList FindSymbols(const char *name, lldb::SymbolType type=eSymbolTypeAny)
Definition: SBModule.cpp:342
An error handling class.
Definition: Status.h:44
void Append(const lldb::SBValue &val_obj)