• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- SBSymbolContext.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_SBSymbolContext_h_
11 #define LLDB_SBSymbolContext_h_
12 
13 #include "lldb/API/SBDefines.h"
14 #include "lldb/API/SBBlock.h"
15 #include "lldb/API/SBCompileUnit.h"
16 #include "lldb/API/SBFunction.h"
17 #include "lldb/API/SBLineEntry.h"
18 #include "lldb/API/SBModule.h"
19 #include "lldb/API/SBSymbol.h"
20 
21 namespace lldb {
22 
23 class SBSymbolContext
24 {
25 public:
26     SBSymbolContext ();
27 
28     SBSymbolContext (const lldb::SBSymbolContext& rhs);
29 
30     ~SBSymbolContext ();
31 
32     bool
33     IsValid () const;
34 
35     const lldb::SBSymbolContext &
36     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
53     GetParentOfInlinedScope (const SBAddress &curr_frame_pc,
54                              SBAddress &parent_frame_addr) const;
55 
56     bool
57     GetDescription (lldb::SBStream &description);
58 
59 protected:
60     friend class SBAddress;
61     friend class SBFrame;
62     friend class SBModule;
63     friend class SBThread;
64     friend class SBTarget;
65     friend class SBSymbolContextList;
66 
67     lldb_private::SymbolContext*
68     operator->() const;
69 
70     lldb_private::SymbolContext&
71     operator*();
72 
73     lldb_private::SymbolContext&
74     ref();
75 
76     const lldb_private::SymbolContext&
77     operator*() const;
78 
79     lldb_private::SymbolContext *
80     get() const;
81 
82     SBSymbolContext (const lldb_private::SymbolContext *sc_ptr);
83 
84     void
85     SetSymbolContext (const lldb_private::SymbolContext *sc_ptr);
86 
87 private:
88     std::unique_ptr<lldb_private::SymbolContext> m_opaque_ap;
89 };
90 
91 
92 } // namespace lldb
93 
94 #endif // LLDB_SBSymbolContext_h_
95