xref: /freebsd-src/contrib/llvm-project/lldb/bindings/interface/SBCompileUnitDocstrings.i (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1*06c3fb27SDimitry Andric %feature("docstring",
2*06c3fb27SDimitry Andric "Represents a compilation unit, or compiled source file.
3*06c3fb27SDimitry Andric 
4*06c3fb27SDimitry Andric SBCompileUnit supports line entry iteration. For example,::
5*06c3fb27SDimitry Andric 
6*06c3fb27SDimitry Andric     # Now get the SBSymbolContext from this frame.  We want everything. :-)
7*06c3fb27SDimitry Andric     context = frame0.GetSymbolContext(lldb.eSymbolContextEverything)
8*06c3fb27SDimitry Andric     ...
9*06c3fb27SDimitry Andric 
10*06c3fb27SDimitry Andric     compileUnit = context.GetCompileUnit()
11*06c3fb27SDimitry Andric 
12*06c3fb27SDimitry Andric     for lineEntry in compileUnit:
13*06c3fb27SDimitry Andric         print('line entry: %s:%d' % (str(lineEntry.GetFileSpec()),
14*06c3fb27SDimitry Andric                                     lineEntry.GetLine()))
15*06c3fb27SDimitry Andric         print('start addr: %s' % str(lineEntry.GetStartAddress()))
16*06c3fb27SDimitry Andric         print('end   addr: %s' % str(lineEntry.GetEndAddress()))
17*06c3fb27SDimitry Andric 
18*06c3fb27SDimitry Andric produces: ::
19*06c3fb27SDimitry Andric 
20*06c3fb27SDimitry Andric   line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:20
21*06c3fb27SDimitry Andric   start addr: a.out[0x100000d98]
22*06c3fb27SDimitry Andric   end   addr: a.out[0x100000da3]
23*06c3fb27SDimitry Andric   line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:21
24*06c3fb27SDimitry Andric   start addr: a.out[0x100000da3]
25*06c3fb27SDimitry Andric   end   addr: a.out[0x100000da9]
26*06c3fb27SDimitry Andric   line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:22
27*06c3fb27SDimitry Andric   start addr: a.out[0x100000da9]
28*06c3fb27SDimitry Andric   end   addr: a.out[0x100000db6]
29*06c3fb27SDimitry Andric   line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:23
30*06c3fb27SDimitry Andric   start addr: a.out[0x100000db6]
31*06c3fb27SDimitry Andric   end   addr: a.out[0x100000dbc]
32*06c3fb27SDimitry Andric   ...
33*06c3fb27SDimitry Andric 
34*06c3fb27SDimitry Andric See also :py:class:`SBSymbolContext` and :py:class:`SBLineEntry`"
35*06c3fb27SDimitry Andric ) lldb::SBCompileUnit;
36*06c3fb27SDimitry Andric 
37*06c3fb27SDimitry Andric %feature("docstring", "
38*06c3fb27SDimitry Andric      Get the index for a provided line entry in this compile unit.
39*06c3fb27SDimitry Andric 
40*06c3fb27SDimitry Andric      @param[in] line_entry
41*06c3fb27SDimitry Andric         The SBLineEntry object for which we are looking for the index.
42*06c3fb27SDimitry Andric 
43*06c3fb27SDimitry Andric      @param[in] exact
44*06c3fb27SDimitry Andric         An optional boolean defaulting to false that ensures that the provided
45*06c3fb27SDimitry Andric         line entry has a perfect match in the compile unit.
46*06c3fb27SDimitry Andric 
47*06c3fb27SDimitry Andric      @return
48*06c3fb27SDimitry Andric         The index of the user-provided line entry. UINT32_MAX if the line entry
49*06c3fb27SDimitry Andric         was not found in the compile unit.") lldb::SBCompileUnit::FindLineEntryIndex;
50*06c3fb27SDimitry Andric 
51*06c3fb27SDimitry Andric %feature("docstring", "
52*06c3fb27SDimitry Andric      Get all types matching type_mask from debug info in this
53*06c3fb27SDimitry Andric      compile unit.
54*06c3fb27SDimitry Andric 
55*06c3fb27SDimitry Andric      @param[in] type_mask
56*06c3fb27SDimitry Andric         A bitfield that consists of one or more bits logically OR'ed
57*06c3fb27SDimitry Andric         together from the lldb::TypeClass enumeration. This allows
58*06c3fb27SDimitry Andric         you to request only structure types, or only class, struct
59*06c3fb27SDimitry Andric         and union types. Passing in lldb::eTypeClassAny will return
60*06c3fb27SDimitry Andric         all types found in the debug information for this compile
61*06c3fb27SDimitry Andric         unit.
62*06c3fb27SDimitry Andric 
63*06c3fb27SDimitry Andric      @return
64*06c3fb27SDimitry Andric         A list of types in this compile unit that match type_mask"
65*06c3fb27SDimitry Andric ) lldb::SBCompileUnit::GetTypes;
66