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]

__setattr__(self, name, value) x.__setattr__('name', value) <==> x.name = value | source code

__getattr__(self, name) | source code

__repr__(self) repr(x) | source code

__iter__(self) | source code

__len__(self) | source code

__init__(self, *args) __init__(lldb::SBCompileUnit self) -> SBCompileUnit __init__(lldb::SBCompileUnit self, SBCompileUnit rhs) -> SBCompileUnit | source code

__swig_destroy__(...) delete_SBCompileUnit(SBCompileUnit self) |

__del__(self) | source code

__nonzero__(self) | source code

IsValid(self) IsValid(SBCompileUnit self) -> bool | 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

GetDescription(self, *args) GetDescription(SBCompileUnit self, SBStream description) -> bool | source code

__str__(self) __str__(SBCompileUnit self) -> PyObject * | source code

__eq__(self, rhs) | source code

__ne__(self, rhs) | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__subclasshook__`

Class Variables | [hide private]

| __swig_setmethods__ = ``{``}``
| __swig_getmethods__ = `{}`

Properties | [hide private]

| file A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.
| num_line_entries A read only property that returns the number of line entries in a compile unit as an integer.
Inherited from `object`: `__class__`

Method Details | [hide private]

### __setattr__(self, name, value)

source code

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
  (inherited documentation)

### __repr__(self)
(Representation operator)

source code

repr(x)

Overrides: object.__repr__
  (inherited documentation)

### __init__(self, *args)
(Constructor)

source code

__init__(lldb::SBCompileUnit self) -> SBCompileUnit __init__(lldb::SBCompileUnit self, SBCompileUnit rhs) -> SBCompileUnit

Overrides: object.__init__

### 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

### __str__(self)
(Informal representation operator)

source code

__str__(SBCompileUnit self) -> PyObject *

Overrides: object.__str__

Property Details | [hide private]

### file

A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.

Get Method:
  GetFileSpec(self) - GetFileSpec(SBCompileUnit self) -> SBFileSpec

### num_line_entries

A read only property that returns the number of line entries in a compile unit as an integer.

Get Method:
  GetNumLineEntries(self) - GetNumLineEntries(SBCompileUnit self) -> uint32_t