blob: 00d80da9892f66a533857aeef2e5bc01ed3f1255 [file] [log] [blame]
Johnny Chen6d91e0a2011-07-19 01:07:06 +00001//===-- 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
10namespace lldb {
11
12%feature("docstring",
13"A context object that provides access to core debugger entities.
14
15Manay debugger functions require a context when doing lookups. This class
16provides a common structure that can be used as the result of a query that
17can contain a single result.
18
19For 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;
49class SBSymbolContext
50{
51public:
52 SBSymbolContext ();
53
54 SBSymbolContext (const lldb::SBSymbolContext& rhs);
55
56 ~SBSymbolContext ();
57
58 bool
59 IsValid () const;
60
Greg Clayton23b8abb2011-09-26 07:11:27 +000061 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 GetParentInlinedFrameInfo (const lldb::SBAddress &curr_frame_pc,
77 bool is_concrete_frame,
78 lldb::SBAddress &parent_frame_addr) const;
79
Johnny Chen6d91e0a2011-07-19 01:07:06 +000080
81 bool
82 GetDescription (lldb::SBStream &description);
83};
84
85} // namespace lldb