1 //===-- SWIG Interface for SBSourceManager ----------------------*- 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 central authority for displaying source code.
14 For example (from test/source-manager/TestSourceManager.py),
16 # Create the filespec for 'main.c'.
17 filespec = lldb.SBFileSpec('main.c', False)
18 source_mgr = self.dbg.GetSourceManager()
19 # Use a string stream as the destination.
20 stream = lldb.SBStream()
21 source_mgr.DisplaySourceLinesWithLineNumbers(filespec,
25 '=>', # prefix for current line
29 # 3 int main(int argc, char const *argv[]) {
30 # => 4 printf('Hello world.\\n'); // Set break point at this line.
33 self.expect(stream.GetData(), 'Source code displayed correctly',
35 patterns = ['=> %d.*Hello world' % self.line])") SBSourceManager;
39 SBSourceManager (const lldb::SBSourceManager &rhs);
44 DisplaySourceLinesWithLineNumbers (const lldb::SBFileSpec &file,
46 uint32_t context_before,
47 uint32_t context_after,
48 const char* current_line_cstr,
51 DisplaySourceLinesWithLineNumbersAndColumn (const lldb::SBFileSpec &file,
52 uint32_t line, uint32_t column,
53 uint32_t context_before,
54 uint32_t context_after,
55 const char* current_line_cstr,