LLDB mainline
SBCompileUnit.h
Go to the documentation of this file.
1//===-- SBCompileUnit.h -----------------------------------------*- 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#ifndef LLDB_API_SBCOMPILEUNIT_H
10#define LLDB_API_SBCOMPILEUNIT_H
11
12#include "lldb/API/SBDefines.h"
13#include "lldb/API/SBFileSpec.h"
14
15namespace lldb {
16
18public:
20
22
24
26
27 explicit operator bool() const;
28
29 bool IsValid() const;
30
32
33 uint32_t GetNumLineEntries() const;
34
35 lldb::SBLineEntry GetLineEntryAtIndex(uint32_t idx) const;
36
37 uint32_t FindLineEntryIndex(lldb::SBLineEntry &line_entry,
38 bool exact = false) const;
39
40 uint32_t FindLineEntryIndex(uint32_t start_idx, uint32_t line,
41 lldb::SBFileSpec *inline_file_spec) const;
42
43 uint32_t FindLineEntryIndex(uint32_t start_idx, uint32_t line,
44 lldb::SBFileSpec *inline_file_spec,
45 bool exact) const;
46
47 SBFileSpec GetSupportFileAtIndex(uint32_t idx) const;
48
49 uint32_t GetNumSupportFiles() const;
50
51 uint32_t FindSupportFileIndex(uint32_t start_idx, const SBFileSpec &sb_file,
52 bool full);
53
54 /// Get all types matching \a type_mask from debug info in this
55 /// compile unit.
56 ///
57 /// \param[in] type_mask
58 /// A bitfield that consists of one or more bits logically OR'ed
59 /// together from the lldb::TypeClass enumeration. This allows
60 /// you to request only structure types, or only class, struct
61 /// and union types. Passing in lldb::eTypeClassAny will return
62 /// all types found in the debug information for this compile
63 /// unit.
64 ///
65 /// \return
66 /// A list of types in this compile unit that match \a type_mask
67 lldb::SBTypeList GetTypes(uint32_t type_mask = lldb::eTypeClassAny);
68
70
71 /// Returns true if this compile unit was compiled with optimization, false if
72 /// unoptimized or unknown.
73 bool GetIsOptimized();
74
75 /// Return an ID that identifies this compile unit within its module, or
76 /// LLDB_INVALID_INDEX32 if invalid. SBModule::GetCompileUnitAtIndex maps it
77 /// back to this compile unit. The ID is not unique across modules.
78 uint32_t GetIDInModule() const;
79
80 bool operator==(const lldb::SBCompileUnit &rhs) const;
81
82 bool operator!=(const lldb::SBCompileUnit &rhs) const;
83
84 bool GetDescription(lldb::SBStream &description);
85
86private:
87 friend class SBAddress;
88 friend class SBFrame;
89 friend class SBSymbolContext;
90 friend class SBModule;
91
93
95
97
99
100 void reset(lldb_private::CompileUnit *lldb_object_ptr);
101
103};
104
105} // namespace lldb
106
107#endif // LLDB_API_SBCOMPILEUNIT_H
#define LLDB_API
Definition SBDefines.h:28
bool operator==(const lldb::SBCompileUnit &rhs) const
const lldb_private::CompileUnit * operator->() const
uint32_t FindLineEntryIndex(lldb::SBLineEntry &line_entry, bool exact=false) const
lldb::SBFileSpec GetFileSpec() const
lldb::SBTypeList GetTypes(uint32_t type_mask=lldb::eTypeClassAny)
Get all types matching type_mask from debug info in this compile unit.
const lldb::SBCompileUnit & operator=(const lldb::SBCompileUnit &rhs)
bool GetIsOptimized()
Returns true if this compile unit was compiled with optimization, false if unoptimized or unknown.
bool GetDescription(lldb::SBStream &description)
const lldb_private::CompileUnit & operator*() const
lldb::SBLineEntry GetLineEntryAtIndex(uint32_t idx) const
friend class SBModule
lldb_private::CompileUnit * get()
friend class SBSymbolContext
friend class SBAddress
lldb_private::CompileUnit * m_opaque_ptr
void reset(lldb_private::CompileUnit *lldb_object_ptr)
uint32_t GetIDInModule() const
Return an ID that identifies this compile unit within its module, or LLDB_INVALID_INDEX32 if invalid.
uint32_t GetNumSupportFiles() const
uint32_t FindSupportFileIndex(uint32_t start_idx, const SBFileSpec &sb_file, bool full)
SBFileSpec GetSupportFileAtIndex(uint32_t idx) const
friend class SBFrame
uint32_t GetNumLineEntries() const
bool operator!=(const lldb::SBCompileUnit &rhs) const
lldb::LanguageType GetLanguage()
A class that describes a compilation unit.
Definition CompileUnit.h:43
LanguageType
Programming language type.