[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / bindings / interface / SBSymbolContextDocstrings.i
blob2fbcad0c813cfd616b9a8c967c0976393be61b0d
1 %feature("docstring",
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.
8 For example, ::
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)
29 # Get the module.
30 module = context.GetModule()
31 ...
33 # And the compile unit associated with the frame.
34 compileUnit = context.GetCompileUnit()
35 ...
37 ) lldb::SBSymbolContext;