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