1 //===-- SBModule.cpp --------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
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"
16 #include "lldb/API/SBSymbolContextList.h"
17 #include "lldb/Core/Module.h"
18 #include "lldb/Core/Section.h"
19 #include "lldb/Core/ValueObjectList.h"
20 #include "lldb/Core/ValueObjectVariable.h"
21 #include "lldb/Symbol/ObjectFile.h"
22 #include "lldb/Symbol/SymbolFile.h"
23 #include "lldb/Symbol/SymbolVendor.h"
24 #include "lldb/Symbol/Symtab.h"
25 #include "lldb/Symbol/TypeSystem.h"
26 #include "lldb/Symbol/VariableList.h"
27 #include "lldb/Target/Target.h"
28 #include "lldb/Utility/StreamString.h"
31 using namespace lldb_private;
33 SBModule::SBModule() : m_opaque_sp() {
34 LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBModule);
37 SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {}
39 SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() {
40 LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &), module_spec);
43 Status error = ModuleList::GetSharedModule(
44 *module_spec.m_opaque_up, module_sp, nullptr, nullptr, nullptr);
49 SBModule::SBModule(const SBModule &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
50 LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModule &), rhs);
53 SBModule::SBModule(lldb::SBProcess &process, lldb::addr_t header_addr)
55 LLDB_RECORD_CONSTRUCTOR(SBModule, (lldb::SBProcess &, lldb::addr_t), process,
58 ProcessSP process_sp(process.GetSP());
60 m_opaque_sp = process_sp->ReadModuleFromMemory(FileSpec(), header_addr);
62 Target &target = process_sp->GetTarget();
64 m_opaque_sp->SetLoadAddress(target, 0, true, changed);
65 target.GetImages().Append(m_opaque_sp);
70 const SBModule &SBModule::operator=(const SBModule &rhs) {
71 LLDB_RECORD_METHOD(const lldb::SBModule &,
72 SBModule, operator=,(const lldb::SBModule &), rhs);
75 m_opaque_sp = rhs.m_opaque_sp;
76 return LLDB_RECORD_RESULT(*this);
79 SBModule::~SBModule() {}
81 bool SBModule::IsValid() const {
82 LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, IsValid);
83 return this->operator bool();
85 SBModule::operator bool() const {
86 LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, operator bool);
88 return m_opaque_sp.get() != nullptr;
91 void SBModule::Clear() {
92 LLDB_RECORD_METHOD_NO_ARGS(void, SBModule, Clear);
97 SBFileSpec SBModule::GetFileSpec() const {
98 LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule, GetFileSpec);
100 SBFileSpec file_spec;
101 ModuleSP module_sp(GetSP());
103 file_spec.SetFileSpec(module_sp->GetFileSpec());
105 return LLDB_RECORD_RESULT(file_spec);
108 lldb::SBFileSpec SBModule::GetPlatformFileSpec() const {
109 LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule,
110 GetPlatformFileSpec);
113 SBFileSpec file_spec;
114 ModuleSP module_sp(GetSP());
116 file_spec.SetFileSpec(module_sp->GetPlatformFileSpec());
118 return LLDB_RECORD_RESULT(file_spec);
121 bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) {
122 LLDB_RECORD_METHOD(bool, SBModule, SetPlatformFileSpec,
123 (const lldb::SBFileSpec &), platform_file);
127 ModuleSP module_sp(GetSP());
129 module_sp->SetPlatformFileSpec(*platform_file);
136 lldb::SBFileSpec SBModule::GetRemoteInstallFileSpec() {
137 LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFileSpec, SBModule,
138 GetRemoteInstallFileSpec);
140 SBFileSpec sb_file_spec;
141 ModuleSP module_sp(GetSP());
143 sb_file_spec.SetFileSpec(module_sp->GetRemoteInstallFileSpec());
144 return LLDB_RECORD_RESULT(sb_file_spec);
147 bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) {
148 LLDB_RECORD_METHOD(bool, SBModule, SetRemoteInstallFileSpec,
149 (lldb::SBFileSpec &), file);
151 ModuleSP module_sp(GetSP());
153 module_sp->SetRemoteInstallFileSpec(file.ref());
159 const uint8_t *SBModule::GetUUIDBytes() const {
160 LLDB_RECORD_METHOD_CONST_NO_ARGS(const uint8_t *, SBModule, GetUUIDBytes);
162 const uint8_t *uuid_bytes = nullptr;
163 ModuleSP module_sp(GetSP());
165 uuid_bytes = module_sp->GetUUID().GetBytes().data();
170 const char *SBModule::GetUUIDString() const {
171 LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBModule, GetUUIDString);
173 const char *uuid_cstr = nullptr;
174 ModuleSP module_sp(GetSP());
176 // We are going to return a "const char *" value through the public API, so
177 // we need to constify it so it gets added permanently the string pool and
178 // then we don't need to worry about the lifetime of the string as it will
179 // never go away once it has been put into the ConstString string pool
180 uuid_cstr = ConstString(module_sp->GetUUID().GetAsString()).GetCString();
183 if (uuid_cstr && uuid_cstr[0]) {
190 bool SBModule::operator==(const SBModule &rhs) const {
191 LLDB_RECORD_METHOD_CONST(bool, SBModule, operator==,(const lldb::SBModule &),
195 return m_opaque_sp.get() == rhs.m_opaque_sp.get();
199 bool SBModule::operator!=(const SBModule &rhs) const {
200 LLDB_RECORD_METHOD_CONST(bool, SBModule, operator!=,(const lldb::SBModule &),
204 return m_opaque_sp.get() != rhs.m_opaque_sp.get();
208 ModuleSP SBModule::GetSP() const { return m_opaque_sp; }
210 void SBModule::SetSP(const ModuleSP &module_sp) { m_opaque_sp = module_sp; }
212 SBAddress SBModule::ResolveFileAddress(lldb::addr_t vm_addr) {
213 LLDB_RECORD_METHOD(lldb::SBAddress, SBModule, ResolveFileAddress,
214 (lldb::addr_t), vm_addr);
216 lldb::SBAddress sb_addr;
217 ModuleSP module_sp(GetSP());
220 if (module_sp->ResolveFileAddress(vm_addr, addr))
221 sb_addr.ref() = addr;
223 return LLDB_RECORD_RESULT(sb_addr);
227 SBModule::ResolveSymbolContextForAddress(const SBAddress &addr,
228 uint32_t resolve_scope) {
229 LLDB_RECORD_METHOD(lldb::SBSymbolContext, SBModule,
230 ResolveSymbolContextForAddress,
231 (const lldb::SBAddress &, uint32_t), addr, resolve_scope);
233 SBSymbolContext sb_sc;
234 ModuleSP module_sp(GetSP());
235 SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope);
236 if (module_sp && addr.IsValid())
237 module_sp->ResolveSymbolContextForAddress(addr.ref(), scope, *sb_sc);
238 return LLDB_RECORD_RESULT(sb_sc);
241 bool SBModule::GetDescription(SBStream &description) {
242 LLDB_RECORD_METHOD(bool, SBModule, GetDescription, (lldb::SBStream &),
245 Stream &strm = description.ref();
247 ModuleSP module_sp(GetSP());
249 module_sp->GetDescription(&strm);
251 strm.PutCString("No value");
256 uint32_t SBModule::GetNumCompileUnits() {
257 LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBModule, GetNumCompileUnits);
259 ModuleSP module_sp(GetSP());
261 return module_sp->GetNumCompileUnits();
266 SBCompileUnit SBModule::GetCompileUnitAtIndex(uint32_t index) {
267 LLDB_RECORD_METHOD(lldb::SBCompileUnit, SBModule, GetCompileUnitAtIndex,
271 ModuleSP module_sp(GetSP());
273 CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(index);
274 sb_cu.reset(cu_sp.get());
276 return LLDB_RECORD_RESULT(sb_cu);
279 SBSymbolContextList SBModule::FindCompileUnits(const SBFileSpec &sb_file_spec) {
280 LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBModule, FindCompileUnits,
281 (const lldb::SBFileSpec &), sb_file_spec);
283 SBSymbolContextList sb_sc_list;
284 const ModuleSP module_sp(GetSP());
285 if (sb_file_spec.IsValid() && module_sp) {
286 const bool append = true;
287 module_sp->FindCompileUnits(*sb_file_spec, append, *sb_sc_list);
289 return LLDB_RECORD_RESULT(sb_sc_list);
292 static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
294 SymbolVendor *symbols = module_sp->GetSymbolVendor();
296 return symbols->GetSymtab();
301 size_t SBModule::GetNumSymbols() {
302 LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSymbols);
304 ModuleSP module_sp(GetSP());
306 Symtab *symtab = GetUnifiedSymbolTable(module_sp);
308 return symtab->GetNumSymbols();
313 SBSymbol SBModule::GetSymbolAtIndex(size_t idx) {
314 LLDB_RECORD_METHOD(lldb::SBSymbol, SBModule, GetSymbolAtIndex, (size_t), idx);
317 ModuleSP module_sp(GetSP());
318 Symtab *symtab = GetUnifiedSymbolTable(module_sp);
320 sb_symbol.SetSymbol(symtab->SymbolAtIndex(idx));
321 return LLDB_RECORD_RESULT(sb_symbol);
324 lldb::SBSymbol SBModule::FindSymbol(const char *name,
325 lldb::SymbolType symbol_type) {
326 LLDB_RECORD_METHOD(lldb::SBSymbol, SBModule, FindSymbol,
327 (const char *, lldb::SymbolType), name, symbol_type);
330 if (name && name[0]) {
331 ModuleSP module_sp(GetSP());
332 Symtab *symtab = GetUnifiedSymbolTable(module_sp);
334 sb_symbol.SetSymbol(symtab->FindFirstSymbolWithNameAndType(
335 ConstString(name), symbol_type, Symtab::eDebugAny,
336 Symtab::eVisibilityAny));
338 return LLDB_RECORD_RESULT(sb_symbol);
341 lldb::SBSymbolContextList SBModule::FindSymbols(const char *name,
342 lldb::SymbolType symbol_type) {
343 LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBModule, FindSymbols,
344 (const char *, lldb::SymbolType), name, symbol_type);
346 SBSymbolContextList sb_sc_list;
347 if (name && name[0]) {
348 ModuleSP module_sp(GetSP());
349 Symtab *symtab = GetUnifiedSymbolTable(module_sp);
351 std::vector<uint32_t> matching_symbol_indexes;
352 const size_t num_matches = symtab->FindAllSymbolsWithNameAndType(
353 ConstString(name), symbol_type, matching_symbol_indexes);
356 sc.module_sp = module_sp;
357 SymbolContextList &sc_list = *sb_sc_list;
358 for (size_t i = 0; i < num_matches; ++i) {
359 sc.symbol = symtab->SymbolAtIndex(matching_symbol_indexes[i]);
366 return LLDB_RECORD_RESULT(sb_sc_list);
369 size_t SBModule::GetNumSections() {
370 LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSections);
372 ModuleSP module_sp(GetSP());
374 // Give the symbol vendor a chance to add to the unified section list.
375 module_sp->GetSymbolVendor();
376 SectionList *section_list = module_sp->GetSectionList();
378 return section_list->GetSize();
383 SBSection SBModule::GetSectionAtIndex(size_t idx) {
384 LLDB_RECORD_METHOD(lldb::SBSection, SBModule, GetSectionAtIndex, (size_t),
387 SBSection sb_section;
388 ModuleSP module_sp(GetSP());
390 // Give the symbol vendor a chance to add to the unified section list.
391 module_sp->GetSymbolVendor();
392 SectionList *section_list = module_sp->GetSectionList();
395 sb_section.SetSP(section_list->GetSectionAtIndex(idx));
397 return LLDB_RECORD_RESULT(sb_section);
400 lldb::SBSymbolContextList SBModule::FindFunctions(const char *name,
401 uint32_t name_type_mask) {
402 LLDB_RECORD_METHOD(lldb::SBSymbolContextList, SBModule, FindFunctions,
403 (const char *, uint32_t), name, name_type_mask);
405 lldb::SBSymbolContextList sb_sc_list;
406 ModuleSP module_sp(GetSP());
407 if (name && module_sp) {
408 const bool append = true;
409 const bool symbols_ok = true;
410 const bool inlines_ok = true;
411 FunctionNameType type = static_cast<FunctionNameType>(name_type_mask);
412 module_sp->FindFunctions(ConstString(name), nullptr, type, symbols_ok,
413 inlines_ok, append, *sb_sc_list);
415 return LLDB_RECORD_RESULT(sb_sc_list);
418 SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name,
419 uint32_t max_matches) {
420 LLDB_RECORD_METHOD(lldb::SBValueList, SBModule, FindGlobalVariables,
421 (lldb::SBTarget &, const char *, uint32_t), target, name,
424 SBValueList sb_value_list;
425 ModuleSP module_sp(GetSP());
426 if (name && module_sp) {
427 VariableList variable_list;
428 const uint32_t match_count = module_sp->FindGlobalVariables(
429 ConstString(name), nullptr, max_matches, variable_list);
431 if (match_count > 0) {
432 for (uint32_t i = 0; i < match_count; ++i) {
433 lldb::ValueObjectSP valobj_sp;
434 TargetSP target_sp(target.GetSP());
435 valobj_sp = ValueObjectVariable::Create(
436 target_sp.get(), variable_list.GetVariableAtIndex(i));
438 sb_value_list.Append(SBValue(valobj_sp));
443 return LLDB_RECORD_RESULT(sb_value_list);
446 lldb::SBValue SBModule::FindFirstGlobalVariable(lldb::SBTarget &target,
448 LLDB_RECORD_METHOD(lldb::SBValue, SBModule, FindFirstGlobalVariable,
449 (lldb::SBTarget &, const char *), target, name);
451 SBValueList sb_value_list(FindGlobalVariables(target, name, 1));
452 if (sb_value_list.IsValid() && sb_value_list.GetSize() > 0)
453 return LLDB_RECORD_RESULT(sb_value_list.GetValueAtIndex(0));
454 return LLDB_RECORD_RESULT(SBValue());
457 lldb::SBType SBModule::FindFirstType(const char *name_cstr) {
458 LLDB_RECORD_METHOD(lldb::SBType, SBModule, FindFirstType, (const char *),
462 ModuleSP module_sp(GetSP());
463 if (name_cstr && module_sp) {
465 const bool exact_match = false;
466 ConstString name(name_cstr);
468 sb_type = SBType(module_sp->FindFirstType(sc, name, exact_match));
470 if (!sb_type.IsValid()) {
471 TypeSystem *type_system =
472 module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
474 sb_type = SBType(type_system->GetBuiltinTypeByName(name));
477 return LLDB_RECORD_RESULT(sb_type);
480 lldb::SBType SBModule::GetBasicType(lldb::BasicType type) {
481 LLDB_RECORD_METHOD(lldb::SBType, SBModule, GetBasicType, (lldb::BasicType),
484 ModuleSP module_sp(GetSP());
486 TypeSystem *type_system =
487 module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
489 return LLDB_RECORD_RESULT(SBType(type_system->GetBasicTypeFromAST(type)));
491 return LLDB_RECORD_RESULT(SBType());
494 lldb::SBTypeList SBModule::FindTypes(const char *type) {
495 LLDB_RECORD_METHOD(lldb::SBTypeList, SBModule, FindTypes, (const char *),
500 ModuleSP module_sp(GetSP());
501 if (type && module_sp) {
503 const bool exact_match = false;
504 ConstString name(type);
505 llvm::DenseSet<SymbolFile *> searched_symbol_files;
506 const uint32_t num_matches = module_sp->FindTypes(
507 name, exact_match, UINT32_MAX, searched_symbol_files, type_list);
509 if (num_matches > 0) {
510 for (size_t idx = 0; idx < num_matches; idx++) {
511 TypeSP type_sp(type_list.GetTypeAtIndex(idx));
513 retval.Append(SBType(type_sp));
516 TypeSystem *type_system =
517 module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
519 CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);
521 retval.Append(SBType(compiler_type));
526 return LLDB_RECORD_RESULT(retval);
529 lldb::SBType SBModule::GetTypeByID(lldb::user_id_t uid) {
530 LLDB_RECORD_METHOD(lldb::SBType, SBModule, GetTypeByID, (lldb::user_id_t),
533 ModuleSP module_sp(GetSP());
535 SymbolVendor *vendor = module_sp->GetSymbolVendor();
537 Type *type_ptr = vendor->ResolveTypeUID(uid);
539 return LLDB_RECORD_RESULT(SBType(type_ptr->shared_from_this()));
542 return LLDB_RECORD_RESULT(SBType());
545 lldb::SBTypeList SBModule::GetTypes(uint32_t type_mask) {
546 LLDB_RECORD_METHOD(lldb::SBTypeList, SBModule, GetTypes, (uint32_t),
549 SBTypeList sb_type_list;
551 ModuleSP module_sp(GetSP());
553 return LLDB_RECORD_RESULT(sb_type_list);
554 SymbolVendor *vendor = module_sp->GetSymbolVendor();
556 return LLDB_RECORD_RESULT(sb_type_list);
558 TypeClass type_class = static_cast<TypeClass>(type_mask);
560 vendor->GetTypes(nullptr, type_class, type_list);
561 sb_type_list.m_opaque_up->Append(type_list);
562 return LLDB_RECORD_RESULT(sb_type_list);
565 SBSection SBModule::FindSection(const char *sect_name) {
566 LLDB_RECORD_METHOD(lldb::SBSection, SBModule, FindSection, (const char *),
569 SBSection sb_section;
571 ModuleSP module_sp(GetSP());
572 if (sect_name && module_sp) {
573 // Give the symbol vendor a chance to add to the unified section list.
574 module_sp->GetSymbolVendor();
575 SectionList *section_list = module_sp->GetSectionList();
577 ConstString const_sect_name(sect_name);
578 SectionSP section_sp(section_list->FindSectionByName(const_sect_name));
580 sb_section.SetSP(section_sp);
584 return LLDB_RECORD_RESULT(sb_section);
587 lldb::ByteOrder SBModule::GetByteOrder() {
588 LLDB_RECORD_METHOD_NO_ARGS(lldb::ByteOrder, SBModule, GetByteOrder);
590 ModuleSP module_sp(GetSP());
592 return module_sp->GetArchitecture().GetByteOrder();
593 return eByteOrderInvalid;
596 const char *SBModule::GetTriple() {
597 LLDB_RECORD_METHOD_NO_ARGS(const char *, SBModule, GetTriple);
599 ModuleSP module_sp(GetSP());
601 std::string triple(module_sp->GetArchitecture().GetTriple().str());
602 // Unique the string so we don't run into ownership issues since the const
603 // strings put the string into the string pool once and the strings never
605 ConstString const_triple(triple.c_str());
606 return const_triple.GetCString();
611 uint32_t SBModule::GetAddressByteSize() {
612 LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBModule, GetAddressByteSize);
614 ModuleSP module_sp(GetSP());
616 return module_sp->GetArchitecture().GetAddressByteSize();
617 return sizeof(void *);
620 uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) {
621 LLDB_RECORD_METHOD(uint32_t, SBModule, GetVersion, (uint32_t *, uint32_t),
622 versions, num_versions);
624 llvm::VersionTuple version;
625 if (ModuleSP module_sp = GetSP())
626 version = module_sp->GetVersion();
628 if (!version.empty())
630 if (version.getMinor())
632 if(version.getSubminor())
638 if (num_versions > 0)
639 versions[0] = version.empty() ? UINT32_MAX : version.getMajor();
640 if (num_versions > 1)
641 versions[1] = version.getMinor().getValueOr(UINT32_MAX);
642 if (num_versions > 2)
643 versions[2] = version.getSubminor().getValueOr(UINT32_MAX);
644 for (uint32_t i = 3; i < num_versions; ++i)
645 versions[i] = UINT32_MAX;
649 lldb::SBFileSpec SBModule::GetSymbolFileSpec() const {
650 LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBModule,
653 lldb::SBFileSpec sb_file_spec;
654 ModuleSP module_sp(GetSP());
656 SymbolVendor *symbol_vendor_ptr = module_sp->GetSymbolVendor();
657 if (symbol_vendor_ptr)
658 sb_file_spec.SetFileSpec(symbol_vendor_ptr->GetMainFileSpec());
660 return LLDB_RECORD_RESULT(sb_file_spec);
663 lldb::SBAddress SBModule::GetObjectFileHeaderAddress() const {
664 LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBModule,
665 GetObjectFileHeaderAddress);
667 lldb::SBAddress sb_addr;
668 ModuleSP module_sp(GetSP());
670 ObjectFile *objfile_ptr = module_sp->GetObjectFile();
672 sb_addr.ref() = objfile_ptr->GetBaseAddress();
674 return LLDB_RECORD_RESULT(sb_addr);
677 lldb::SBAddress SBModule::GetObjectFileEntryPointAddress() const {
678 LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBAddress, SBModule,
679 GetObjectFileEntryPointAddress);
681 lldb::SBAddress sb_addr;
682 ModuleSP module_sp(GetSP());
684 ObjectFile *objfile_ptr = module_sp->GetObjectFile();
686 sb_addr.ref() = objfile_ptr->GetEntryPointAddress();
688 return LLDB_RECORD_RESULT(sb_addr);
691 namespace lldb_private {
695 void RegisterMethods<SBModule>(Registry &R) {
696 LLDB_REGISTER_CONSTRUCTOR(SBModule, ());
697 LLDB_REGISTER_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &));
698 LLDB_REGISTER_CONSTRUCTOR(SBModule, (const lldb::SBModule &));
699 LLDB_REGISTER_CONSTRUCTOR(SBModule, (lldb::SBProcess &, lldb::addr_t));
700 LLDB_REGISTER_METHOD(const lldb::SBModule &,
701 SBModule, operator=,(const lldb::SBModule &));
702 LLDB_REGISTER_METHOD_CONST(bool, SBModule, IsValid, ());
703 LLDB_REGISTER_METHOD_CONST(bool, SBModule, operator bool, ());
704 LLDB_REGISTER_METHOD(void, SBModule, Clear, ());
705 LLDB_REGISTER_METHOD_CONST(lldb::SBFileSpec, SBModule, GetFileSpec, ());
706 LLDB_REGISTER_METHOD_CONST(lldb::SBFileSpec, SBModule, GetPlatformFileSpec,
708 LLDB_REGISTER_METHOD(bool, SBModule, SetPlatformFileSpec,
709 (const lldb::SBFileSpec &));
710 LLDB_REGISTER_METHOD(lldb::SBFileSpec, SBModule, GetRemoteInstallFileSpec,
712 LLDB_REGISTER_METHOD(bool, SBModule, SetRemoteInstallFileSpec,
713 (lldb::SBFileSpec &));
714 LLDB_REGISTER_METHOD_CONST(const char *, SBModule, GetUUIDString, ());
715 LLDB_REGISTER_METHOD_CONST(bool,
716 SBModule, operator==,(const lldb::SBModule &));
717 LLDB_REGISTER_METHOD_CONST(bool,
718 SBModule, operator!=,(const lldb::SBModule &));
719 LLDB_REGISTER_METHOD(lldb::SBAddress, SBModule, ResolveFileAddress,
721 LLDB_REGISTER_METHOD(lldb::SBSymbolContext, SBModule,
722 ResolveSymbolContextForAddress,
723 (const lldb::SBAddress &, uint32_t));
724 LLDB_REGISTER_METHOD(bool, SBModule, GetDescription, (lldb::SBStream &));
725 LLDB_REGISTER_METHOD(uint32_t, SBModule, GetNumCompileUnits, ());
726 LLDB_REGISTER_METHOD(lldb::SBCompileUnit, SBModule, GetCompileUnitAtIndex,
728 LLDB_REGISTER_METHOD(lldb::SBSymbolContextList, SBModule, FindCompileUnits,
729 (const lldb::SBFileSpec &));
730 LLDB_REGISTER_METHOD(size_t, SBModule, GetNumSymbols, ());
731 LLDB_REGISTER_METHOD(lldb::SBSymbol, SBModule, GetSymbolAtIndex, (size_t));
732 LLDB_REGISTER_METHOD(lldb::SBSymbol, SBModule, FindSymbol,
733 (const char *, lldb::SymbolType));
734 LLDB_REGISTER_METHOD(lldb::SBSymbolContextList, SBModule, FindSymbols,
735 (const char *, lldb::SymbolType));
736 LLDB_REGISTER_METHOD(size_t, SBModule, GetNumSections, ());
737 LLDB_REGISTER_METHOD(lldb::SBSection, SBModule, GetSectionAtIndex,
739 LLDB_REGISTER_METHOD(lldb::SBSymbolContextList, SBModule, FindFunctions,
740 (const char *, uint32_t));
741 LLDB_REGISTER_METHOD(lldb::SBValueList, SBModule, FindGlobalVariables,
742 (lldb::SBTarget &, const char *, uint32_t));
743 LLDB_REGISTER_METHOD(lldb::SBValue, SBModule, FindFirstGlobalVariable,
744 (lldb::SBTarget &, const char *));
745 LLDB_REGISTER_METHOD(lldb::SBType, SBModule, FindFirstType, (const char *));
746 LLDB_REGISTER_METHOD(lldb::SBType, SBModule, GetBasicType,
748 LLDB_REGISTER_METHOD(lldb::SBTypeList, SBModule, FindTypes, (const char *));
749 LLDB_REGISTER_METHOD(lldb::SBType, SBModule, GetTypeByID,
751 LLDB_REGISTER_METHOD(lldb::SBTypeList, SBModule, GetTypes, (uint32_t));
752 LLDB_REGISTER_METHOD(lldb::SBSection, SBModule, FindSection,
754 LLDB_REGISTER_METHOD(lldb::ByteOrder, SBModule, GetByteOrder, ());
755 LLDB_REGISTER_METHOD(const char *, SBModule, GetTriple, ());
756 LLDB_REGISTER_METHOD(uint32_t, SBModule, GetAddressByteSize, ());
757 LLDB_REGISTER_METHOD(uint32_t, SBModule, GetVersion,
758 (uint32_t *, uint32_t));
759 LLDB_REGISTER_METHOD_CONST(lldb::SBFileSpec, SBModule, GetSymbolFileSpec,
761 LLDB_REGISTER_METHOD_CONST(lldb::SBAddress, SBModule,
762 GetObjectFileHeaderAddress, ());
763 LLDB_REGISTER_METHOD_CONST(lldb::SBAddress, SBModule,
764 GetObjectFileEntryPointAddress, ());