1 //===-- SBSymbol.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_SBSYMBOL_H 10 #define LLDB_API_SBSYMBOL_H 11 12 #include "lldb/API/SBAddress.h" 13 #include "lldb/API/SBDefines.h" 14 #include "lldb/API/SBInstructionList.h" 15 #include "lldb/API/SBTarget.h" 16 17 namespace lldb { 18 19 class LLDB_API SBSymbol { 20 public: 21 SBSymbol(); 22 23 ~SBSymbol(); 24 25 SBSymbol(const lldb::SBSymbol &rhs); 26 27 const lldb::SBSymbol &operator=(const lldb::SBSymbol &rhs); 28 29 explicit operator bool() const; 30 31 bool IsValid() const; 32 33 const char *GetName() const; 34 35 const char *GetDisplayName() const; 36 37 const char *GetMangledName() const; 38 39 lldb::SBInstructionList GetInstructions(lldb::SBTarget target); 40 41 lldb::SBInstructionList GetInstructions(lldb::SBTarget target, 42 const char *flavor_string); 43 44 SBAddress GetStartAddress(); 45 46 SBAddress GetEndAddress(); 47 48 uint32_t GetPrologueByteSize(); 49 50 SymbolType GetType(); 51 52 bool operator==(const lldb::SBSymbol &rhs) const; 53 54 bool operator!=(const lldb::SBSymbol &rhs) const; 55 56 bool GetDescription(lldb::SBStream &description); 57 58 // Returns true if the symbol is externally visible in the module that it is 59 // defined in 60 bool IsExternal(); 61 62 // Returns true if the symbol was synthetically generated from something 63 // other than the actual symbol table itself in the object file. 64 bool IsSynthetic(); 65 66 protected: 67 lldb_private::Symbol *get(); 68 69 void reset(lldb_private::Symbol *); 70 71 private: 72 friend class SBAddress; 73 friend class SBFrame; 74 friend class SBModule; 75 friend class SBSymbolContext; 76 77 SBSymbol(lldb_private::Symbol *lldb_object_ptr); 78 79 void SetSymbol(lldb_private::Symbol *lldb_object_ptr); 80 81 lldb_private::Symbol *m_opaque_ptr = nullptr; 82 }; 83 84 } // namespace lldb 85 86 #endif // LLDB_API_SBSYMBOL_H 87