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 
15 namespace lldb {
16 
18 public:
19  SBCompileUnit();
20 
22 
23  ~SBCompileUnit();
24 
25  const lldb::SBCompileUnit &operator=(const lldb::SBCompileUnit &rhs);
26 
27  explicit operator bool() const;
28 
29  bool IsValid() const;
30 
31  lldb::SBFileSpec GetFileSpec() const;
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 
69  lldb::LanguageType GetLanguage();
70 
71  bool operator==(const lldb::SBCompileUnit &rhs) const;
72 
73  bool operator!=(const lldb::SBCompileUnit &rhs) const;
74 
75  bool GetDescription(lldb::SBStream &description);
76 
77 private:
78  friend class SBAddress;
79  friend class SBFrame;
80  friend class SBSymbolContext;
81  friend class SBModule;
82 
83  SBCompileUnit(lldb_private::CompileUnit *lldb_object_ptr);
84 
85  const lldb_private::CompileUnit *operator->() const;
86 
87  const lldb_private::CompileUnit &operator*() const;
88 
90 
91  void reset(lldb_private::CompileUnit *lldb_object_ptr);
92 
93  lldb_private::CompileUnit *m_opaque_ptr = nullptr;
94 };
95 
96 } // namespace lldb
97 
98 #endif // LLDB_API_SBCOMPILEUNIT_H
SBDefines.h
lldb::SBCompileUnit
Definition: SBCompileUnit.h:17
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::CompileUnit
Definition: CompileUnit.h:38
lldb::SBFrame
Definition: SBFrame.h:17
SBFileSpec.h
lldb::operator==
bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs)
Definition: SBAddress.cpp:60
lldb_private::operator!=
bool operator!=(const Address &lhs, const Address &rhs)
Definition: Address.cpp:1022
lldb::SBTypeList
Definition: SBType.h:243
lldb::SBSymbolContext
Definition: SBSymbolContext.h:22
uint32_t
lldb::SBCompileUnit
class LLDB_API SBCompileUnit
Definition: SBDefines.h:47
lldb::SBModule
Definition: SBModule.h:20
lldb::SBFileSpec
Definition: SBFileSpec.h:16
lldb::SBLineEntry
Definition: SBLineEntry.h:18
lldb::SBAddress
Definition: SBAddress.h:17
lldb::SBStream
Definition: SBStream.h:18
lldb_private::operator*
const Scalar operator*(Scalar lhs, Scalar rhs)
Definition: Scalar.cpp:556
lldb
Definition: SBAddress.h:15
LLDB_API
#define LLDB_API
Definition: SBDefines.h:26