Home | History | Annotate | Download | only in scripts
      1 /*
      2    lldb.swig
      3 
      4    This is the input file for SWIG, to create the appropriate C++ wrappers and
      5    functions for various scripting languages, to enable them to call the
      6    liblldb Script Bridge functions.
      7 */
      8 
      9 /* Define our module docstring. */
     10 %define DOCSTRING
     11 "The lldb module contains the public APIs for Python binding.
     12 
     13 Some of the important classes are describe here:
     14 
     15 o SBTarget: Represents the target program running under the debugger.
     16 o SBProcess: Represents the process associated with the target program.
     17 o SBThread: Represents a thread of execution. SBProcess contains SBThread(s).
     18 o SBFrame: Represents one of the stack frames associated with a thread. SBThread
     19       contains SBFrame(s).
     20 o SBSymbolContext: A container that stores various debugger related info.
     21 o SBValue: Represents the value of a variable, a register, or an expression.
     22 o SBModule: Represents an executable image and its associated object and symbol
     23       files.  SBTarget conatins SBModule(s).
     24 o SBBreakpoint: Represents a logical breakpoint and its associated settings.
     25       SBTarget conatins SBBreakpoint(s).
     26 o SBSymbol: Represents the symbol possibly associated with a stack frame.
     27 o SBCompileUnit: Represents a compilation unit, or compiled source file.
     28 o SBFunction: Represents a generic function, which can be inlined or not.
     29 o SBBlock: Represents a lexical block. SBFunction contains SBBlock(s).
     30 o SBLineEntry: Specifies an association with a contiguous range of instructions
     31       and a source file location. SBCompileUnit contains SBLineEntry(s)."
     32 %enddef
     33 
     34 // The name of the module to be created.
     35 %module(docstring=DOCSTRING) lldb
     36 
     37 // Parameter types will be used in the autodoc string.
     38 %feature("autodoc", "1");
     39 
     40 %pythoncode%{
     41 import uuid
     42 import re
     43 import os
     44 %}
     45 %include "./Python/python-typemaps.swig"
     46 
     47 /* C++ headers to be included. */
     48 %{
     49 #include <string>
     50 %}
     51 
     52 /* The liblldb header files to be included. */
     53 %{
     54 #include "lldb/lldb-public.h"
     55 #include "lldb/API/SBAddress.h"
     56 #include "lldb/API/SBBlock.h"
     57 #include "lldb/API/SBBreakpoint.h"
     58 #include "lldb/API/SBBreakpointLocation.h"
     59 #include "lldb/API/SBBroadcaster.h"
     60 #include "lldb/API/SBCommandInterpreter.h"
     61 #include "lldb/API/SBCommandReturnObject.h"
     62 #include "lldb/API/SBCommunication.h"
     63 #include "lldb/API/SBCompileUnit.h"
     64 #include "lldb/API/SBData.h"
     65 #include "lldb/API/SBDebugger.h"
     66 #include "lldb/API/SBDeclaration.h"
     67 #include "lldb/API/SBError.h"
     68 #include "lldb/API/SBEvent.h"
     69 #include "lldb/API/SBExpressionOptions.h"
     70 #include "lldb/API/SBFileSpec.h"
     71 #include "lldb/API/SBFileSpecList.h"
     72 #include "lldb/API/SBFrame.h"
     73 #include "lldb/API/SBFunction.h"
     74 #include "lldb/API/SBHostOS.h"
     75 #include "lldb/API/SBInputReader.h"
     76 #include "lldb/API/SBInstruction.h"
     77 #include "lldb/API/SBInstructionList.h"
     78 #include "lldb/API/SBLineEntry.h"
     79 #include "lldb/API/SBListener.h"
     80 #include "lldb/API/SBModule.h"
     81 #include "lldb/API/SBModuleSpec.h"
     82 #include "lldb/API/SBProcess.h"
     83 #include "lldb/API/SBSection.h"
     84 #include "lldb/API/SBSourceManager.h"
     85 #include "lldb/API/SBStream.h"
     86 #include "lldb/API/SBStringList.h"
     87 #include "lldb/API/SBSymbol.h"
     88 #include "lldb/API/SBSymbolContext.h"
     89 #include "lldb/API/SBSymbolContextList.h"
     90 #include "lldb/API/SBTarget.h"
     91 #include "lldb/API/SBThread.h"
     92 #include "lldb/API/SBType.h"
     93 #include "lldb/API/SBTypeCategory.h"
     94 #include "lldb/API/SBTypeFilter.h"
     95 #include "lldb/API/SBTypeFormat.h"
     96 #include "lldb/API/SBTypeNameSpecifier.h"
     97 #include "lldb/API/SBTypeSummary.h"
     98 #include "lldb/API/SBTypeSynthetic.h"
     99 #include "lldb/API/SBValue.h"
    100 #include "lldb/API/SBValueList.h"
    101 #include "lldb/API/SBWatchpoint.h"
    102 
    103 #include "../scripts/Python/python-swigsafecast.swig"
    104 
    105 %}
    106 
    107 /* Various liblldb typedefs that SWIG needs to know about.  */
    108 #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */
    109 %include "stdint.i"
    110 %include "lldb/lldb-defines.h"
    111 %include "lldb/lldb-enumerations.h"
    112 %include "lldb/lldb-forward.h"
    113 %include "lldb/lldb-types.h"
    114 
    115 /* Forward declaration of SB classes. */
    116 %include "lldb/API/SBDefines.h"
    117 
    118 /* Python interface files with docstrings. */
    119 %include "./Python/interface/SBAddress.i"
    120 %include "./Python/interface/SBBlock.i"
    121 %include "./Python/interface/SBBreakpoint.i"
    122 %include "./Python/interface/SBBreakpointLocation.i"
    123 %include "./Python/interface/SBBroadcaster.i"
    124 %include "./Python/interface/SBCommandInterpreter.i"
    125 %include "./Python/interface/SBCommandReturnObject.i"
    126 %include "./Python/interface/SBCommunication.i"
    127 %include "./Python/interface/SBCompileUnit.i"
    128 %include "./Python/interface/SBData.i"
    129 %include "./Python/interface/SBDebugger.i"
    130 %include "./Python/interface/SBDeclaration.i"
    131 %include "./Python/interface/SBError.i"
    132 %include "./Python/interface/SBEvent.i"
    133 %include "./Python/interface/SBExpressionOptions.i"
    134 %include "./Python/interface/SBFileSpec.i"
    135 %include "./Python/interface/SBFileSpecList.i"
    136 %include "./Python/interface/SBFrame.i"
    137 %include "./Python/interface/SBFunction.i"
    138 %include "./Python/interface/SBHostOS.i"
    139 %include "./Python/interface/SBInputReader.i"
    140 %include "./Python/interface/SBInstruction.i"
    141 %include "./Python/interface/SBInstructionList.i"
    142 %include "./Python/interface/SBLineEntry.i"
    143 %include "./Python/interface/SBListener.i"
    144 %include "./Python/interface/SBModule.i"
    145 %include "./Python/interface/SBModuleSpec.i"
    146 %include "./Python/interface/SBProcess.i"
    147 %include "./Python/interface/SBSection.i"
    148 %include "./Python/interface/SBSourceManager.i"
    149 %include "./Python/interface/SBStream.i"
    150 %include "./Python/interface/SBStringList.i"
    151 %include "./Python/interface/SBSymbol.i"
    152 %include "./Python/interface/SBSymbolContext.i"
    153 %include "./Python/interface/SBSymbolContextList.i"
    154 %include "./Python/interface/SBTarget.i"
    155 %include "./Python/interface/SBThread.i"
    156 %include "./Python/interface/SBType.i"
    157 %include "./Python/interface/SBTypeCategory.i"
    158 %include "./Python/interface/SBTypeFilter.i"
    159 %include "./Python/interface/SBTypeFormat.i"
    160 %include "./Python/interface/SBTypeNameSpecifier.i"
    161 %include "./Python/interface/SBTypeSummary.i"
    162 %include "./Python/interface/SBTypeSynthetic.i"
    163 %include "./Python/interface/SBValue.i"
    164 %include "./Python/interface/SBValueList.i"
    165 %include "./Python/interface/SBWatchpoint.i"
    166 
    167 %include "./Python/python-extensions.swig"
    168 
    169 %include "./Python/python-wrapper.swig"
    170