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"
29
30using namespace lldb;
31using namespace lldb_private;
32
34
35SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {}
36
37SBModule::SBModule(const SBModuleSpec &module_spec) {
38 LLDB_INSTRUMENT_VA(this, module_spec);
39
40 ModuleSP module_sp;
42 module_sp, nullptr, nullptr);
43 if (module_sp)
44 SetSP(module_sp);
45}
46
50
52 LLDB_INSTRUMENT_VA(this, process, header_addr);
53
54 ProcessSP process_sp(process.GetSP());
55 if (process_sp) {
56 llvm::Expected<ModuleSP> module_sp_or_err =
57 process_sp->ReadModuleFromMemory(FileSpec(), header_addr);
58 if (auto err = module_sp_or_err.takeError()) {
59 llvm::consumeError(std::move(err));
60 return;
61 }
62
63 m_opaque_sp = *module_sp_or_err;
64 if (m_opaque_sp) {
65 Target &target = process_sp->GetTarget();
66 bool changed = false;
67 m_opaque_sp->SetLoadAddress(target, 0, true, changed);
69 }
70 }
71}
72
74 LLDB_INSTRUMENT_VA(this, rhs);
75
76 if (this != &rhs)
78 return *this;
79}
80
81SBModule::~SBModule() = default;
82
83bool SBModule::IsValid() const {
85 return this->operator bool();
86}
87SBModule::operator bool() const {
89
90 return m_opaque_sp.get() != nullptr;
91}
92
95
96 m_opaque_sp.reset();
97}
98
100 LLDB_INSTRUMENT_VA(this);
101
102 ModuleSP module_sp(GetSP());
103 if (!module_sp)
104 return false;
105
106 ObjectFile *obj_file = module_sp->GetObjectFile();
107 if (!obj_file)
108 return false;
109
110 return !obj_file->IsInMemory();
111}
112
114 LLDB_INSTRUMENT_VA(this);
115
116 SBFileSpec file_spec;
117 ModuleSP module_sp(GetSP());
118 if (module_sp)
119 file_spec.SetFileSpec(module_sp->GetFileSpec());
120
121 return file_spec;
122}
123
125 LLDB_INSTRUMENT_VA(this);
126
127 SBFileSpec file_spec;
128 ModuleSP module_sp(GetSP());
129 if (module_sp)
130 file_spec.SetFileSpec(module_sp->GetPlatformFileSpec());
131
132 return file_spec;
133}
134
136 LLDB_INSTRUMENT_VA(this, platform_file);
137
138 bool result = false;
139
140 ModuleSP module_sp(GetSP());
141 if (module_sp) {
142 module_sp->SetPlatformFileSpec(*platform_file);
143 result = true;
144 }
145
146 return result;
147}
148
150 LLDB_INSTRUMENT_VA(this);
151
152 SBFileSpec sb_file_spec;
153 ModuleSP module_sp(GetSP());
154 if (module_sp)
155 sb_file_spec.SetFileSpec(module_sp->GetRemoteInstallFileSpec());
156 return sb_file_spec;
157}
158
160 LLDB_INSTRUMENT_VA(this, file);
161
162 ModuleSP module_sp(GetSP());
163 if (module_sp) {
164 module_sp->SetRemoteInstallFileSpec(file.ref());
165 return true;
166 }
167 return false;
168}
169
170const uint8_t *SBModule::GetUUIDBytes() const {
171 LLDB_INSTRUMENT_VA(this);
172
173 const uint8_t *uuid_bytes = nullptr;
174 ModuleSP module_sp(GetSP());
175 if (module_sp)
176 uuid_bytes = module_sp->GetUUID().GetBytes().data();
177
178 return uuid_bytes;
179}
180
181const char *SBModule::GetUUIDString() const {
182 LLDB_INSTRUMENT_VA(this);
183
184 ModuleSP module_sp(GetSP());
185 if (!module_sp)
186 return nullptr;
187
189 module_sp->GetUUID().GetAsString());
190}
191
192bool SBModule::operator==(const SBModule &rhs) const {
193 LLDB_INSTRUMENT_VA(this, rhs);
194
195 if (m_opaque_sp)
196 return m_opaque_sp.get() == rhs.m_opaque_sp.get();
197 return false;
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
209
210void SBModule::SetSP(const ModuleSP &module_sp) { m_opaque_sp = module_sp; }
211
213 LLDB_INSTRUMENT_VA(this, vm_addr);
214
215 lldb::SBAddress sb_addr;
216 ModuleSP module_sp(GetSP());
217 if (module_sp) {
218 Address addr;
219 if (module_sp->ResolveFileAddress(vm_addr, addr))
220 sb_addr.ref() = addr;
221 }
222 return sb_addr;
223}
224
227 uint32_t resolve_scope) {
228 LLDB_INSTRUMENT_VA(this, addr, resolve_scope);
229
230 SBSymbolContext sb_sc;
231 ModuleSP module_sp(GetSP());
232 SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope);
233 if (module_sp && addr.IsValid())
234 module_sp->ResolveSymbolContextForAddress(addr.ref(), scope, *sb_sc);
235 return sb_sc;
236}
237
239 LLDB_INSTRUMENT_VA(this, description);
240
241 Stream &strm = description.ref();
242
243 ModuleSP module_sp(GetSP());
244 if (module_sp) {
245 module_sp->GetDescription(strm.AsRawOstream());
246 } else
247 strm.PutCString("No value");
248
249 return true;
250}
251
253 LLDB_INSTRUMENT_VA(this);
254
255 ModuleSP module_sp(GetSP());
256 if (module_sp) {
257 return module_sp->GetNumCompileUnits();
258 }
259 return 0;
260}
261
263 LLDB_INSTRUMENT_VA(this, index);
264
265 SBCompileUnit sb_cu;
266 ModuleSP module_sp(GetSP());
267 if (module_sp) {
268 CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(index);
269 sb_cu.reset(cu_sp.get());
270 }
271 return sb_cu;
272}
273
275 LLDB_INSTRUMENT_VA(this, sb_file_spec);
276
277 SBSymbolContextList sb_sc_list;
278 const ModuleSP module_sp(GetSP());
279 if (sb_file_spec.IsValid() && module_sp) {
280 module_sp->FindCompileUnits(*sb_file_spec, *sb_sc_list);
281 }
282 return sb_sc_list;
283}
284
285static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
286 if (module_sp)
287 return module_sp->GetSymtab();
288 return nullptr;
289}
290
292 LLDB_INSTRUMENT_VA(this);
293
294 ModuleSP module_sp(GetSP());
295 if (Symtab *symtab = GetUnifiedSymbolTable(module_sp))
296 return symtab->GetNumSymbols();
297 return 0;
298}
299
300uint32_t SBModule::GetSymtabState() const {
301 LLDB_INSTRUMENT_VA(this);
302
303 if (ModuleSP module_sp = GetSP())
304 return module_sp->GetSymtabState();
305 return eSymtabStateNone;
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 SectionSP section_sp(section_list->FindSectionByName(sect_name));
561 if (section_sp) {
562 sb_section.SetSP(section_sp);
563 }
564 }
565 }
566 return sb_section;
567}
568
570 LLDB_INSTRUMENT_VA(this);
571
572 ModuleSP module_sp(GetSP());
573 if (module_sp)
574 return module_sp->GetArchitecture().GetByteOrder();
575 return eByteOrderInvalid;
576}
577
578const char *SBModule::GetTriple() {
579 LLDB_INSTRUMENT_VA(this);
580
581 ModuleSP module_sp(GetSP());
582 if (!module_sp)
583 return nullptr;
584
585 std::string triple(module_sp->GetArchitecture().GetTriple().str());
586 return StringPool::GetSystemPool().Intern(triple);
587}
588
590 LLDB_INSTRUMENT_VA(this);
591
592 ModuleSP module_sp(GetSP());
593 if (module_sp)
594 return module_sp->GetArchitecture().GetAddressByteSize();
595 return sizeof(void *);
596}
597
598uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) {
599 LLDB_INSTRUMENT_VA(this, versions, num_versions);
600
601 llvm::VersionTuple version;
602 if (ModuleSP module_sp = GetSP())
603 version = module_sp->GetVersion();
604 uint32_t result = 0;
605 if (!version.empty())
606 ++result;
607 if (version.getMinor())
608 ++result;
609 if (version.getSubminor())
610 ++result;
611
612 if (!versions)
613 return result;
614
615 if (num_versions > 0)
616 versions[0] = version.empty() ? UINT32_MAX : version.getMajor();
617 if (num_versions > 1)
618 versions[1] = version.getMinor().value_or(UINT32_MAX);
619 if (num_versions > 2)
620 versions[2] = version.getSubminor().value_or(UINT32_MAX);
621 for (uint32_t i = 3; i < num_versions; ++i)
622 versions[i] = UINT32_MAX;
623 return result;
624}
625
627 LLDB_INSTRUMENT_VA(this);
628
629 lldb::SBFileSpec sb_file_spec;
630 ModuleSP module_sp(GetSP());
631 if (module_sp) {
632 if (SymbolFile *symfile = module_sp->GetSymbolFile())
633 sb_file_spec.SetFileSpec(symfile->GetObjectFile()->GetFileSpec());
634 }
635 return sb_file_spec;
636}
637
639 LLDB_INSTRUMENT_VA(this);
640 ModuleSP module_sp(GetSP());
641 if (module_sp)
642 return lldb::SBModuleSpecList(module_sp->GetSeparateDebugInfoFiles());
643
644 return lldb::SBModuleSpecList();
645}
646
648 LLDB_INSTRUMENT_VA(this);
649
650 lldb::SBAddress sb_addr;
651 ModuleSP module_sp(GetSP());
652 if (module_sp) {
653 ObjectFile *objfile_ptr = module_sp->GetObjectFile();
654 if (objfile_ptr)
655 sb_addr.ref() = objfile_ptr->GetBaseAddress();
656 }
657 return sb_addr;
658}
659
661 LLDB_INSTRUMENT_VA(this);
662
663 lldb::SBAddress sb_addr;
664 ModuleSP module_sp(GetSP());
665 if (module_sp)
666 sb_addr.ref() = module_sp->GetObjectFileEntryPointAddress();
667 return sb_addr;
668}
669
675
678
679 const bool mandatory = false;
681}
682
683const char *SBModule::GetObjectName() const {
684 LLDB_INSTRUMENT_VA(this);
685
686 if (!m_opaque_sp)
687 return nullptr;
689 m_opaque_sp->GetObjectName());
690}
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:285
lldb_private::Address & ref()
bool IsValid() const
Definition SBAddress.cpp:74
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:238
const char * GetTriple()
Definition SBModule.cpp:578
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:210
lldb::SBType FindFirstType(const char *name)
Definition SBModule.cpp:443
lldb::SBAddress GetObjectFileEntryPointAddress() const
Definition SBModule.cpp:660
uint32_t GetAddressByteSize()
Definition SBModule.cpp:589
uint32_t GetNumCompileUnits()
Definition SBModule.cpp:252
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:676
static uint32_t GetNumberAllocatedModules()
Get the number of global modules.
Definition SBModule.cpp:670
uint32_t GetSymtabState() const
Get a bitmask of lldb::SymtabState flags describing the state of this module's symbol table.
Definition SBModule.cpp:300
lldb::SBFileSpec GetSymbolFileSpec() const
Get accessor for the symbol file specification.
Definition SBModule.cpp:626
friend class SBTarget
Definition SBModule.h:338
lldb::SBSymbol GetSymbolAtIndex(size_t idx)
Definition SBModule.cpp:308
lldb::ModuleSP m_opaque_sp
Definition SBModule.h:349
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:212
bool IsFileBacked() const
Definition SBModule.cpp:99
friend class SBSymbolContext
Definition SBModule.h:336
friend class SBAddress
Definition SBModule.h:333
const uint8_t * GetUUIDBytes() const
Definition SBModule.cpp:170
lldb::SBFileSpec GetRemoteInstallFileSpec()
Get accessor for the remote install path for a module.
Definition SBModule.cpp:149
lldb::SBModuleSpecList GetSeparateDebugInfoFiles()
Get the separate debug info files for this module.
Definition SBModule.cpp:638
uint32_t GetVersion(uint32_t *versions, uint32_t num_versions)
Get the module version numbers.
Definition SBModule.cpp:598
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:262
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:159
size_t GetNumSymbols()
Definition SBModule.cpp:291
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:683
bool operator==(const lldb::SBModule &rhs) const
Definition SBModule.cpp:192
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:647
lldb::SBFileSpec GetFileSpec() const
Get const accessor for the module file specification.
Definition SBModule.cpp:113
lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec)
Find compile units related to *this module and passed source file.
Definition SBModule.cpp:274
lldb::ByteOrder GetByteOrder()
Definition SBModule.cpp:569
const SBModule & operator=(const SBModule &rhs)
Definition SBModule.cpp:73
ModuleSP GetSP() const
Definition SBModule.cpp:208
bool operator!=(const lldb::SBModule &rhs) const
Definition SBModule.cpp:200
const char * GetUUIDString() const
Definition SBModule.cpp:181
friend class SBSection
Definition SBModule.h:335
lldb::SBFileSpec GetPlatformFileSpec() const
Get accessor for the module platform file specification.
Definition SBModule.cpp:124
bool IsValid() const
Definition SBModule.cpp:83
lldb::SBSymbolContext ResolveSymbolContextForAddress(const lldb::SBAddress &addr, uint32_t resolve_scope)
Definition SBModule.cpp:226
bool SetPlatformFileSpec(const lldb::SBFileSpec &platform_file)
Definition SBModule.cpp:135
friend class SBType
Definition SBModule.h:339
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:179
void SetSymbol(lldb_private::Symbol *lldb_object_ptr)
Definition SBSymbol.cpp:40
lldb::TargetSP GetSP() const
Definition SBTarget.cpp:600
std::unique_ptr< lldb_private::TypeListImpl > m_opaque_up
Definition SBType.h:322
void Append(lldb::SBType type)
Definition SBType.cpp:780
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.
A file utility class.
Definition FileSpec.h:56
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, bool invoke_symbol_locators=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:47
bool IsInMemory() const
Returns true if the object file exists only in memory.
Definition ObjectFile.h:696
virtual lldb_private::Address GetBaseAddress()
Returns base address of this object file.
Definition ObjectFile.h:473
size_t GetSize() const
Definition Section.h:76
lldb::SectionSP FindSectionByName(llvm::StringRef section_name) const
Definition Section.cpp:562
lldb::SectionSP GetSectionAtIndex(size_t idx) const
Definition Section.cpp:555
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:405
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition Stream.cpp:63
const char * Intern(llvm::StringRef str) const
Definition StringPool.h:78
const char * InternNonEmpty(llvm::StringRef str) const
Like Intern, but an empty string yields nullptr.
Definition StringPool.h:81
static StringPoolRef GetSystemPool()
The system pool. Only valid between Initialize and Terminate.
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:262
Symbol * FindFirstSymbolWithNameAndType(ConstString name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility)
Definition Symtab.cpp:850
void FindAllSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, std::vector< uint32_t > &symbol_indexes)
Definition Symtab.cpp:804
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1295
TypeIterable Types() const
Definition TypeMap.h:47
bool Empty() const
Definition TypeMap.cpp:53
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
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.
class LLDB_API SBModuleSpecList
Definition SBDefines.h:94
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:83
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:138
std::shared_ptr< lldb_private::Module > ModuleSP
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
Options used by Module::FindFunctions.
Definition Module.h:68
bool include_inlines
Include inlined functions.
Definition Module.h:72
bool include_symbols
Include the symbol table.
Definition Module.h:70