1 //===-- SBSymbolContext.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_SBSYMBOLCONTEXT_H 10 #define LLDB_API_SBSYMBOLCONTEXT_H 11 12 #include "lldb/API/SBBlock.h" 13 #include "lldb/API/SBCompileUnit.h" 14 #include "lldb/API/SBDefines.h" 15 #include "lldb/API/SBFunction.h" 16 #include "lldb/API/SBLineEntry.h" 17 #include "lldb/API/SBModule.h" 18 #include "lldb/API/SBSymbol.h" 19 20 namespace lldb { 21 22 class LLDB_API SBSymbolContext { 23 public: 24 SBSymbolContext(); 25 26 SBSymbolContext(const lldb::SBSymbolContext &rhs); 27 28 SBSymbolContext(const lldb_private::SymbolContext *sc_ptr); 29 30 ~SBSymbolContext(); 31 32 explicit operator bool() const; 33 34 bool IsValid() const; 35 36 const lldb::SBSymbolContext &operator=(const lldb::SBSymbolContext &rhs); 37 38 lldb::SBModule GetModule(); 39 lldb::SBCompileUnit GetCompileUnit(); 40 lldb::SBFunction GetFunction(); 41 lldb::SBBlock GetBlock(); 42 lldb::SBLineEntry GetLineEntry(); 43 lldb::SBSymbol GetSymbol(); 44 45 void SetModule(lldb::SBModule module); 46 void SetCompileUnit(lldb::SBCompileUnit compile_unit); 47 void SetFunction(lldb::SBFunction function); 48 void SetBlock(lldb::SBBlock block); 49 void SetLineEntry(lldb::SBLineEntry line_entry); 50 void SetSymbol(lldb::SBSymbol symbol); 51 52 SBSymbolContext GetParentOfInlinedScope(const SBAddress &curr_frame_pc, 53 SBAddress &parent_frame_addr) const; 54 55 bool GetDescription(lldb::SBStream &description); 56 57 protected: 58 friend class SBAddress; 59 friend class SBFrame; 60 friend class SBModule; 61 friend class SBThread; 62 friend class SBTarget; 63 friend class SBSymbolContextList; 64 65 lldb_private::SymbolContext *operator->() const; 66 67 lldb_private::SymbolContext &operator*(); 68 69 lldb_private::SymbolContext &ref(); 70 71 const lldb_private::SymbolContext &operator*() const; 72 73 lldb_private::SymbolContext *get() const; 74 75 void SetSymbolContext(const lldb_private::SymbolContext *sc_ptr); 76 77 private: 78 std::unique_ptr<lldb_private::SymbolContext> m_opaque_up; 79 }; 80 81 } // namespace lldb 82 83 #endif // LLDB_API_SBSYMBOLCONTEXT_H 84