Package lldb :: Class SBCompileUnit
[hide private]
[frames] | no frames]

Class SBCompileUnit

source code



Represents a compilation unit, or compiled source file.

SBCompileUnit supports line entry iteration. For example,

    # Now get the SBSymbolContext from this frame.  We want everything. :-)
    context = frame0.GetSymbolContext(lldb.eSymbolContextEverything)
    ...

    compileUnit = context.GetCompileUnit()

    for lineEntry in compileUnit:
        print('line entry: %s:%d' % (str(lineEntry.GetFileSpec()),
                                    lineEntry.GetLine()))
        print('start addr: %s' % str(lineEntry.GetStartAddress()))
        print('end   addr: %s' % str(lineEntry.GetEndAddress()))

produces:

line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:20
start addr: a.out[0x100000d98]
end   addr: a.out[0x100000da3]
line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:21
start addr: a.out[0x100000da3]
end   addr: a.out[0x100000da9]
line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:22
start addr: a.out[0x100000da9]
end   addr: a.out[0x100000db6]
line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:23
start addr: a.out[0x100000db6]
end   addr: a.out[0x100000dbc]
...

See also SBSymbolContext and SBLineEntry

Instance Methods [hide private]
 
__repr__(self) source code
 
__init__(self, *args)
__init__(lldb::SBCompileUnit self) -> SBCompileUnit __init__(lldb::SBCompileUnit self, SBCompileUnit rhs) -> SBCompileUnit
source code
 
IsValid(self)
IsValid(SBCompileUnit self) -> bool
source code
 
__nonzero__(self) source code
 
__bool__(self) source code
 
GetFileSpec(self)
GetFileSpec(SBCompileUnit self) -> SBFileSpec
source code
 
GetNumLineEntries(self)
GetNumLineEntries(SBCompileUnit self) -> uint32_t
source code
 
GetLineEntryAtIndex(self, *args)
GetLineEntryAtIndex(SBCompileUnit self, uint32_t idx) -> SBLineEntry
source code
 
FindLineEntryIndex(self, *args)
FindLineEntryIndex(SBCompileUnit self, uint32_t start_idx, uint32_t line, SBFileSpec inline_file_spec) -> uint32_t FindLineEntryIndex(SBCompileUnit self, uint32_t start_idx, uint32_t line, SBFileSpec inline_file_spec, bool exact) -> uint32_t
source code
 
GetSupportFileAtIndex(self, *args)
GetSupportFileAtIndex(SBCompileUnit self, uint32_t idx) -> SBFileSpec
source code
 
GetNumSupportFiles(self)
GetNumSupportFiles(SBCompileUnit self) -> uint32_t
source code
 
FindSupportFileIndex(self, *args)
FindSupportFileIndex(SBCompileUnit self, uint32_t start_idx, SBFileSpec sb_file, bool full) -> uint32_t
source code
 
GetTypes(self, *args)
GetTypes(SBCompileUnit self, uint32_t type_mask=eTypeClassAny) -> SBTypeList GetTypes(SBCompileUnit self) -> SBTypeList
source code
 
GetLanguage(self)
GetLanguage(SBCompileUnit self) -> lldb::LanguageType
source code
 
GetDescription(self, *args)
GetDescription(SBCompileUnit self, SBStream description) -> bool
source code
 
__iter__(self)
Iterate over all line entries in a lldb.SBCompileUnit object.
source code
 
__len__(self)
Return the number of line entries in a lldb.SBCompileUnit object.
source code
 
__str__(self)
__str__(SBCompileUnit self) -> PyObject *
source code
 
__eq__(self, rhs) source code
 
__ne__(self, rhs) source code
Class Variables [hide private]
  __swig_setmethods__ = {}
  __setattr__ = lambda self, name, value:
  __swig_getmethods__ = {}
  __getattr__ = lambda self, name:
  __swig_destroy__ = _lldb.delete_SBCompileUnit
  __del__ = lambda self:
Method Details [hide private]

GetTypes(self, *args)

source code 

GetTypes(SBCompileUnit self, uint32_t type_mask=eTypeClassAny) -> SBTypeList
GetTypes(SBCompileUnit self) -> SBTypeList

Get all types matching type_mask from debug info in this
compile unit.

@param[in] type_mask
   A bitfield that consists of one or more bits logically OR'ed
   together from the lldb::TypeClass enumeration. This allows
   you to request only structure types, or only class, struct
   and union types. Passing in lldb::eTypeClassAny will return
   all types found in the debug information for this compile
   unit.

@return
   A list of types in this compile unit that match type_mask