• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- SWIG Interface for SBSymbolContext ----------------------*- 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 namespace lldb {
11 
12 %feature("docstring",
13 "A context object that provides access to core debugger entities.
14 
15 Manay debugger functions require a context when doing lookups. This class
16 provides a common structure that can be used as the result of a query that
17 can contain a single result.
18 
19 For example,
20 
21         exe = os.path.join(os.getcwd(), 'a.out')
22 
23         # Create a target for the debugger.
24         target = self.dbg.CreateTarget(exe)
25 
26         # Now create a breakpoint on main.c by name 'c'.
27         breakpoint = target.BreakpointCreateByName('c', 'a.out')
28 
29         # Now launch the process, and do not stop at entry point.
30         process = target.LaunchSimple(None, None, os.getcwd())
31 
32         # The inferior should stop on 'c'.
33         from lldbutil import get_stopped_thread
34         thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
35         frame0 = thread.GetFrameAtIndex(0)
36 
37         # Now get the SBSymbolContext from this frame.  We want everything. :-)
38         context = frame0.GetSymbolContext(lldb.eSymbolContextEverything)
39 
40         # Get the module.
41         module = context.GetModule()
42         ...
43 
44         # And the compile unit associated with the frame.
45         compileUnit = context.GetCompileUnit()
46         ...
47 "
48 ) SBSymbolContext;
49 class SBSymbolContext
50 {
51 public:
52     SBSymbolContext ();
53 
54     SBSymbolContext (const lldb::SBSymbolContext& rhs);
55 
56     ~SBSymbolContext ();
57 
58     bool
59     IsValid () const;
60 
61     lldb::SBModule        GetModule ();
62     lldb::SBCompileUnit   GetCompileUnit ();
63     lldb::SBFunction      GetFunction ();
64     lldb::SBBlock         GetBlock ();
65     lldb::SBLineEntry     GetLineEntry ();
66     lldb::SBSymbol        GetSymbol ();
67 
68     void SetModule      (lldb::SBModule module);
69     void SetCompileUnit (lldb::SBCompileUnit compile_unit);
70     void SetFunction    (lldb::SBFunction function);
71     void SetBlock       (lldb::SBBlock block);
72     void SetLineEntry   (lldb::SBLineEntry line_entry);
73     void SetSymbol      (lldb::SBSymbol symbol);
74 
75     lldb::SBSymbolContext
76     GetParentOfInlinedScope (const lldb::SBAddress &curr_frame_pc,
77                              lldb::SBAddress &parent_frame_addr) const;
78 
79 
80     bool
81     GetDescription (lldb::SBStream &description);
82 
83 
84     %pythoncode %{
85         __swig_getmethods__["module"] = GetModule
86         __swig_setmethods__["module"] = SetModule
87         if _newclass: module = property(GetModule, SetModule, doc='''A read/write property that allows the getting/setting of the module (lldb.SBModule) in this symbol context.''')
88 
89         __swig_getmethods__["compile_unit"] = GetCompileUnit
90         __swig_setmethods__["compile_unit"] = SetCompileUnit
91         if _newclass: compile_unit = property(GetCompileUnit, SetCompileUnit, doc='''A read/write property that allows the getting/setting of the compile unit (lldb.SBCompileUnit) in this symbol context.''')
92 
93         __swig_getmethods__["function"] = GetFunction
94         __swig_setmethods__["function"] = SetFunction
95         if _newclass: function = property(GetFunction, SetFunction, doc='''A read/write property that allows the getting/setting of the function (lldb.SBFunction) in this symbol context.''')
96 
97         __swig_getmethods__["block"] = GetBlock
98         __swig_setmethods__["block"] = SetBlock
99         if _newclass: block = property(GetBlock, SetBlock, doc='''A read/write property that allows the getting/setting of the block (lldb.SBBlock) in this symbol context.''')
100 
101         __swig_getmethods__["symbol"] = GetSymbol
102         __swig_setmethods__["symbol"] = SetSymbol
103         if _newclass: symbol = property(GetSymbol, SetSymbol, doc='''A read/write property that allows the getting/setting of the symbol (lldb.SBSymbol) in this symbol context.''')
104 
105         __swig_getmethods__["line_entry"] = GetLineEntry
106         __swig_setmethods__["line_entry"] = SetLineEntry
107         if _newclass: line_entry = property(GetLineEntry, SetLineEntry, doc='''A read/write property that allows the getting/setting of the line entry (lldb.SBLineEntry) in this symbol context.''')
108     %}
109 
110 };
111 
112 } // namespace lldb
113