Johnny Chen | 6cf1bc3 | 2011-07-18 22:11:53 +0000 | [diff] [blame^] | 1 | //===-- SWIG Interface for SBCompileUnit ------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | namespace lldb { |
| 11 | |
| 12 | %feature("docstring", |
| 13 | "Represents a compilation unit, or compiled source file. |
| 14 | |
| 15 | SBCompileUnit supports line entry iteration. 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 | ") SBCompileUnit; |
| 39 | class SBCompileUnit |
| 40 | { |
| 41 | public: |
| 42 | |
| 43 | SBCompileUnit (); |
| 44 | |
| 45 | SBCompileUnit (const lldb::SBCompileUnit &rhs); |
| 46 | |
| 47 | ~SBCompileUnit (); |
| 48 | |
| 49 | bool |
| 50 | IsValid () const; |
| 51 | |
| 52 | lldb::SBFileSpec |
| 53 | GetFileSpec () const; |
| 54 | |
| 55 | uint32_t |
| 56 | GetNumLineEntries () const; |
| 57 | |
| 58 | lldb::SBLineEntry |
| 59 | GetLineEntryAtIndex (uint32_t idx) const; |
| 60 | |
| 61 | uint32_t |
| 62 | FindLineEntryIndex (uint32_t start_idx, |
| 63 | uint32_t line, |
| 64 | lldb::SBFileSpec *inline_file_spec) const; |
| 65 | |
| 66 | bool |
| 67 | GetDescription (lldb::SBStream &description); |
| 68 | }; |
| 69 | |
| 70 | } // namespace lldb |