1 //===-- SWIG Interface for SBLineEntry --------------------------*- C++ -*-===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 9 namespace lldb { 10 11 %feature("docstring", 12 "Specifies an association with a contiguous range of instructions and 13 a source file location. 14 15 :py:class:`SBCompileUnit` contains SBLineEntry(s). For example, :: 16 17 for lineEntry in compileUnit: 18 print('line entry: %s:%d' % (str(lineEntry.GetFileSpec()), 19 lineEntry.GetLine())) 20 print('start addr: %s' % str(lineEntry.GetStartAddress())) 21 print('end addr: %s' % str(lineEntry.GetEndAddress())) 22 23 produces: :: 24 25 line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:20 26 start addr: a.out[0x100000d98] 27 end addr: a.out[0x100000da3] 28 line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:21 29 start addr: a.out[0x100000da3] 30 end addr: a.out[0x100000da9] 31 line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:22 32 start addr: a.out[0x100000da9] 33 end addr: a.out[0x100000db6] 34 line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:23 35 start addr: a.out[0x100000db6] 36 end addr: a.out[0x100000dbc] 37 ... 38 39 See also :py:class:`SBCompileUnit` ." 40 ) SBLineEntry; 41 class SBLineEntry 42 { 43 public: 44 45 SBLineEntry (); 46 47 SBLineEntry (const lldb::SBLineEntry &rhs); 48 49 ~SBLineEntry (); 50 51 lldb::SBAddress 52 GetStartAddress () const; 53 54 lldb::SBAddress 55 GetEndAddress () const; 56 57 bool 58 IsValid () const; 59 60 explicit operator bool() const; 61 62 lldb::SBFileSpec 63 GetFileSpec () const; 64 65 uint32_t 66 GetLine () const; 67 68 uint32_t 69 GetColumn () const; 70 71 bool 72 GetDescription (lldb::SBStream &description); 73 74 void 75 SetFileSpec (lldb::SBFileSpec filespec); 76 77 void 78 SetLine (uint32_t line); 79 80 void 81 SetColumn (uint32_t column); 82 83 bool 84 operator == (const lldb::SBLineEntry &rhs) const; 85 86 bool 87 operator != (const lldb::SBLineEntry &rhs) const; 88 89 STRING_EXTENSION(SBLineEntry) 90 91 #ifdef SWIGPYTHON 92 %pythoncode %{ 93 file = property(GetFileSpec, None, doc='''A read only property that returns an lldb object that represents the file (lldb.SBFileSpec) for this line entry.''') 94 line = property(GetLine, None, doc='''A read only property that returns the 1 based line number for this line entry, a return value of zero indicates that no line information is available.''') 95 column = property(GetColumn, None, doc='''A read only property that returns the 1 based column number for this line entry, a return value of zero indicates that no column information is available.''') 96 addr = property(GetStartAddress, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this line entry.''') 97 end_addr = property(GetEndAddress, None, doc='''A read only property that returns an lldb object that represents the end address (lldb.SBAddress) for this line entry.''') 98 %} 99 #endif 100 }; 101 102 } // namespace lldb 103