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