1 //===-- SWIG Interface for SBCompileUnit ------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 "Represents a compilation unit, or compiled source file.
14 SBCompileUnit supports line entry iteration. For example,
16 # Now get the SBSymbolContext from this frame. We want everything. :-)
17 context = frame0.GetSymbolContext(lldb.eSymbolContextEverything)
20 compileUnit = context.GetCompileUnit()
22 for lineEntry in compileUnit:
23 print('line entry: %s:%d' % (str(lineEntry.GetFileSpec()),
25 print('start addr: %s' % str(lineEntry.GetStartAddress()))
26 print('end addr: %s' % str(lineEntry.GetEndAddress()))
30 line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:20
31 start addr: a.out[0x100000d98]
32 end addr: a.out[0x100000da3]
33 line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:21
34 start addr: a.out[0x100000da3]
35 end addr: a.out[0x100000da9]
36 line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:22
37 start addr: a.out[0x100000da9]
38 end addr: a.out[0x100000db6]
39 line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:23
40 start addr: a.out[0x100000db6]
41 end addr: a.out[0x100000dbc]
44 See also SBSymbolContext and SBLineEntry"
52 SBCompileUnit (const lldb::SBCompileUnit &rhs);
59 explicit operator bool() const;
65 GetNumLineEntries () const;
68 GetLineEntryAtIndex (uint32_t idx) const;
71 FindLineEntryIndex (uint32_t start_idx,
73 lldb::SBFileSpec *inline_file_spec) const;
76 FindLineEntryIndex (uint32_t start_idx,
78 lldb::SBFileSpec *inline_file_spec,
82 GetSupportFileAtIndex (uint32_t idx) const;
85 GetNumSupportFiles () const;
88 FindSupportFileIndex (uint32_t start_idx, const SBFileSpec &sb_file, bool full);
90 %feature("docstring", "
91 Get all types matching type_mask from debug info in this
95 A bitfield that consists of one or more bits logically OR'ed
96 together from the lldb::TypeClass enumeration. This allows
97 you to request only structure types, or only class, struct
98 and union types. Passing in lldb::eTypeClassAny will return
99 all types found in the debug information for this compile
103 A list of types in this compile unit that match type_mask") GetTypes;
105 GetTypes (uint32_t type_mask = lldb::eTypeClassAny);
111 GetDescription (lldb::SBStream &description);
114 operator == (const lldb::SBCompileUnit &rhs) const;
117 operator != (const lldb::SBCompileUnit &rhs) const;
119 STRING_EXTENSION(SBCompileUnit)
124 '''Iterate over all line entries in a lldb.SBCompileUnit object.'''
125 return lldb_iter(self, 'GetNumLineEntries', 'GetLineEntryAtIndex')
128 '''Return the number of line entries in a lldb.SBCompileUnit
130 return self.GetNumLineEntries()
132 file = property(GetFileSpec, None, doc='''A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.''')
133 num_line_entries = property(GetNumLineEntries, None, doc='''A read only property that returns the number of line entries in a compile unit as an integer.''')