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

Class SBStream

source code



    Represents a destination for streaming data output to. By default, a string
    stream is created.

    For example (from test/source-manager/TestSourceManager.py),

            # Create the filespec for 'main.c'.
            filespec = lldb.SBFileSpec('main.c', False)
            source_mgr = self.dbg.GetSourceManager()
            # Use a string stream as the destination.
            stream = lldb.SBStream()
            source_mgr.DisplaySourceLinesWithLineNumbers(filespec,
                                                         self.line,
                                                         2, # context before
                                                         2, # context after
                                                         '=>', # prefix for current line
                                                         stream)

            #    2
            #    3    int main(int argc, char const *argv[]) {
            # => 4        printf('Hello world.
'); // Set break point at this line.
            #    5        return 0;
            #    6    }
            self.expect(stream.GetData(), 'Source code displayed correctly',
                        exe=False,
                patterns = ['=> %d.*Hello world' % self.line])
    

Instance Methods [hide private]
 
__repr__(self) source code
 
__init__(self)
__init__(lldb::SBStream self) -> SBStream
source code
 
IsValid(self)
IsValid(SBStream self) -> bool
source code
 
__nonzero__(self) source code
 
__bool__(self) source code
 
GetData(self)
GetData(SBStream self) -> char const *
source code
 
GetSize(self)
GetSize(SBStream self) -> size_t
source code
 
Print(self, *args)
Print(SBStream self, char const * str)
source code
 
RedirectToFile(self, *args)
RedirectToFile(SBStream self, char const * path, bool append)
source code
 
RedirectToFileHandle(self, *args)
RedirectToFileHandle(SBStream self, FILE * fh, bool transfer_fh_ownership)
source code
 
RedirectToFileDescriptor(self, *args)
RedirectToFileDescriptor(SBStream self, int fd, bool transfer_fh_ownership)
source code
 
Clear(self)
Clear(SBStream self)
source code
 
write(self, *args)
write(SBStream self, char const * str)
source code
 
flush(self)
flush(SBStream self)
source code
Class Variables [hide private]
  __swig_setmethods__ = {}
  __setattr__ = lambda self, name, value:
  __swig_getmethods__ = {}
  __getattr__ = lambda self, name:
  __swig_destroy__ = _lldb.delete_SBStream
  __del__ = lambda self:
Method Details [hide private]

GetData(self)

source code 

GetData(SBStream self) -> char const *

If this stream is not redirected to a file, it will maintain a local cache for the stream data which can be accessed using this accessor.

GetSize(self)

source code 

GetSize(SBStream self) -> size_t

If this stream is not redirected to a file, it will maintain a local cache for the stream output whose length can be accessed using this accessor.

Clear(self)

source code 

Clear(SBStream self)

If the stream is redirected to a file, forget about the file and if ownership of the file was transferred to this object, close the file. If the stream is backed by a local cache, clear this cache.