2 "A context object that provides access to core debugger entities.
4 Many debugger functions require a context when doing lookups. This class
5 provides a common structure that can be used as the result of a query that
6 can contain a single result.
10 exe = os.path.join(os.getcwd(), 'a.out')
12 # Create a target for the debugger.
13 target = self.dbg.CreateTarget(exe)
15 # Now create a breakpoint on main.c by name 'c'.
16 breakpoint = target.BreakpointCreateByName('c', 'a.out')
18 # Now launch the process, and do not stop at entry point.
19 process = target.LaunchSimple(None, None, os.getcwd())
21 # The inferior should stop on 'c'.
22 from lldbutil import get_stopped_thread
23 thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
24 frame0 = thread.GetFrameAtIndex(0)
26 # Now get the SBSymbolContext from this frame. We want everything. :-)
27 context = frame0.GetSymbolContext(lldb.eSymbolContextEverything)
30 module = context.GetModule()
33 # And the compile unit associated with the frame.
34 compileUnit = context.GetCompileUnit()
37 ) lldb
::SBSymbolContext
;