1*fe013be4SDimitry Andric %feature("docstring",
2*fe013be4SDimitry Andric "Represents a central authority for displaying source code.
3*fe013be4SDimitry Andric 
4*fe013be4SDimitry Andric For example (from test/source-manager/TestSourceManager.py), ::
5*fe013be4SDimitry Andric 
6*fe013be4SDimitry Andric         # Create the filespec for 'main.c'.
7*fe013be4SDimitry Andric         filespec = lldb.SBFileSpec('main.c', False)
8*fe013be4SDimitry Andric         source_mgr = self.dbg.GetSourceManager()
9*fe013be4SDimitry Andric         # Use a string stream as the destination.
10*fe013be4SDimitry Andric         stream = lldb.SBStream()
11*fe013be4SDimitry Andric         source_mgr.DisplaySourceLinesWithLineNumbers(filespec,
12*fe013be4SDimitry Andric                                                      self.line,
13*fe013be4SDimitry Andric                                                      2, # context before
14*fe013be4SDimitry Andric                                                      2, # context after
15*fe013be4SDimitry Andric                                                      '=>', # prefix for current line
16*fe013be4SDimitry Andric                                                      stream)
17*fe013be4SDimitry Andric 
18*fe013be4SDimitry Andric         #    2
19*fe013be4SDimitry Andric         #    3    int main(int argc, char const *argv[]) {
20*fe013be4SDimitry Andric         # => 4        printf('Hello world.\\n'); // Set break point at this line.
21*fe013be4SDimitry Andric         #    5        return 0;
22*fe013be4SDimitry Andric         #    6    }
23*fe013be4SDimitry Andric         self.expect(stream.GetData(), 'Source code displayed correctly',
24*fe013be4SDimitry Andric                     exe=False,
25*fe013be4SDimitry Andric             patterns = ['=> %d.*Hello world' % self.line])"
26*fe013be4SDimitry Andric ) lldb::SBSourceManager;
27