Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | lldb.swig |
| 3 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 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. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
Johnny Chen | ee48178 | 2011-06-30 21:29:50 +0000 | [diff] [blame] | 9 | /* Define our module docstring. */ |
| 10 | %define DOCSTRING |
| 11 | "The lldb module contains the public APIs for Python binding. |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 12 | |
Jason Molenda | 8c71337 | 2013-11-05 11:00:35 +0000 | [diff] [blame] | 13 | Some of the important classes are described here: |
Johnny Chen | ee48178 | 2011-06-30 21:29:50 +0000 | [diff] [blame] | 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 |
Bruce Mitchener | 58ef391 | 2015-06-18 05:27:05 +0000 | [diff] [blame] | 23 | files. SBTarget contains SBModule(s). |
Johnny Chen | 4036b58 | 2011-07-14 21:32:11 +0000 | [diff] [blame] | 24 | o SBBreakpoint: Represents a logical breakpoint and its associated settings. |
Bruce Mitchener | 58ef391 | 2015-06-18 05:27:05 +0000 | [diff] [blame] | 25 | SBTarget contains SBBreakpoint(s). |
Johnny Chen | 993f2b6 | 2011-07-14 21:23:24 +0000 | [diff] [blame] | 26 | o SBSymbol: Represents the symbol possibly associated with a stack frame. |
Johnny Chen | ee48178 | 2011-06-30 21:29:50 +0000 | [diff] [blame] | 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 |
Johnny Chen | 61abb2a | 2011-07-01 18:39:47 +0000 | [diff] [blame] | 31 | and a source file location. SBCompileUnit contains SBLineEntry(s)." |
Johnny Chen | ee48178 | 2011-06-30 21:29:50 +0000 | [diff] [blame] | 32 | %enddef |
| 33 | |
Johnny Chen | 9ffc9f7 | 2011-07-16 21:27:36 +0000 | [diff] [blame] | 34 | // The name of the module to be created. |
Johnny Chen | ee48178 | 2011-06-30 21:29:50 +0000 | [diff] [blame] | 35 | %module(docstring=DOCSTRING) lldb |
| 36 | |
Johnny Chen | 9ffc9f7 | 2011-07-16 21:27:36 +0000 | [diff] [blame] | 37 | // Parameter types will be used in the autodoc string. |
| 38 | %feature("autodoc", "1"); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 39 | |
Greg Clayton | 6b2bd93 | 2012-02-01 08:09:32 +0000 | [diff] [blame] | 40 | %pythoncode%{ |
| 41 | import uuid |
| 42 | import re |
| 43 | import os |
Zachary Turner | d4870df | 2015-11-11 17:59:57 +0000 | [diff] [blame] | 44 | |
| 45 | import six |
Greg Clayton | 6b2bd93 | 2012-02-01 08:09:32 +0000 | [diff] [blame] | 46 | %} |
Johnny Chen | 11346d3 | 2011-07-26 19:09:03 +0000 | [diff] [blame] | 47 | %include "./Python/python-typemaps.swig" |
Greg Clayton | ca512b3 | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 48 | |
Sean Callanan | ecb2088 | 2012-08-09 00:53:54 +0000 | [diff] [blame] | 49 | /* C++ headers to be included. */ |
| 50 | %{ |
Zachary Turner | 02bf92d | 2015-11-12 17:01:48 +0000 | [diff] [blame] | 51 | #include <algorithm> |
Sean Callanan | ecb2088 | 2012-08-09 00:53:54 +0000 | [diff] [blame] | 52 | #include <string> |
| 53 | %} |
| 54 | |
Greg Clayton | c0cc73e | 2010-06-12 15:34:20 +0000 | [diff] [blame] | 55 | /* The liblldb header files to be included. */ |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 56 | %{ |
Greg Clayton | e0d378b | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 57 | #include "lldb/lldb-public.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 58 | #include "lldb/API/SBAddress.h" |
Oleksiy Vyalov | 71d08b3 | 2015-02-16 00:04:19 +0000 | [diff] [blame] | 59 | #include "lldb/API/SBAttachInfo.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 60 | #include "lldb/API/SBBlock.h" |
| 61 | #include "lldb/API/SBBreakpoint.h" |
| 62 | #include "lldb/API/SBBreakpointLocation.h" |
| 63 | #include "lldb/API/SBBroadcaster.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 64 | #include "lldb/API/SBCommandInterpreter.h" |
| 65 | #include "lldb/API/SBCommandReturnObject.h" |
Greg Clayton | 05faeb7 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 66 | #include "lldb/API/SBCommunication.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 67 | #include "lldb/API/SBCompileUnit.h" |
Enrico Granata | 9128ee2 | 2011-09-06 19:20:51 +0000 | [diff] [blame] | 68 | #include "lldb/API/SBData.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 69 | #include "lldb/API/SBDebugger.h" |
Enrico Granata | 10de090 | 2012-10-10 22:54:17 +0000 | [diff] [blame] | 70 | #include "lldb/API/SBDeclaration.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 71 | #include "lldb/API/SBError.h" |
| 72 | #include "lldb/API/SBEvent.h" |
Enrico Granata | e85e84a | 2014-10-01 20:43:45 +0000 | [diff] [blame] | 73 | #include "lldb/API/SBExecutionContext.h" |
Jim Ingham | 35e1bda | 2012-10-16 21:41:58 +0000 | [diff] [blame] | 74 | #include "lldb/API/SBExpressionOptions.h" |
Johnny Chen | 23fd10c | 2010-08-27 22:35:26 +0000 | [diff] [blame] | 75 | #include "lldb/API/SBFileSpec.h" |
Jim Ingham | 969795f | 2011-09-21 01:17:13 +0000 | [diff] [blame] | 76 | #include "lldb/API/SBFileSpecList.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 77 | #include "lldb/API/SBFrame.h" |
| 78 | #include "lldb/API/SBFunction.h" |
Greg Clayton | 05faeb7 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 79 | #include "lldb/API/SBHostOS.h" |
Greg Clayton | 1d27316 | 2010-10-06 03:09:58 +0000 | [diff] [blame] | 80 | #include "lldb/API/SBInstruction.h" |
| 81 | #include "lldb/API/SBInstructionList.h" |
Ilia K | 7f83624 | 2015-04-28 12:51:16 +0000 | [diff] [blame] | 82 | #include "lldb/API/SBLanguageRuntime.h" |
Oleksiy Vyalov | 1ef7b2c | 2015-02-04 23:19:15 +0000 | [diff] [blame] | 83 | #include "lldb/API/SBLaunchInfo.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 84 | #include "lldb/API/SBLineEntry.h" |
| 85 | #include "lldb/API/SBListener.h" |
| 86 | #include "lldb/API/SBModule.h" |
Greg Clayton | 226cce2 | 2013-07-08 22:22:41 +0000 | [diff] [blame] | 87 | #include "lldb/API/SBModuleSpec.h" |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 88 | #include "lldb/API/SBPlatform.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 89 | #include "lldb/API/SBProcess.h" |
Jason Molenda | 5e8dce4 | 2013-12-13 00:29:16 +0000 | [diff] [blame] | 90 | #include "lldb/API/SBQueue.h" |
| 91 | #include "lldb/API/SBQueueItem.h" |
Greg Clayton | cac9c5f | 2011-09-24 00:52:29 +0000 | [diff] [blame] | 92 | #include "lldb/API/SBSection.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 93 | #include "lldb/API/SBSourceManager.h" |
Caroline Tice | dde9cff | 2010-09-20 05:20:02 +0000 | [diff] [blame] | 94 | #include "lldb/API/SBStream.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 95 | #include "lldb/API/SBStringList.h" |
| 96 | #include "lldb/API/SBSymbol.h" |
| 97 | #include "lldb/API/SBSymbolContext.h" |
Greg Clayton | 05faeb7 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 98 | #include "lldb/API/SBSymbolContextList.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 99 | #include "lldb/API/SBTarget.h" |
| 100 | #include "lldb/API/SBThread.h" |
Kuba Brecka | a5ea1e2 | 2014-09-06 01:21:19 +0000 | [diff] [blame] | 101 | #include "lldb/API/SBThreadCollection.h" |
Jim Ingham | 2bdbfd5 | 2014-09-29 23:17:18 +0000 | [diff] [blame] | 102 | #include "lldb/API/SBThreadPlan.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 103 | #include "lldb/API/SBType.h" |
Enrico Granata | 061858c | 2012-02-15 02:34:21 +0000 | [diff] [blame] | 104 | #include "lldb/API/SBTypeCategory.h" |
Todd Fiala | 732215f | 2014-06-02 20:55:29 +0000 | [diff] [blame] | 105 | #include "lldb/API/SBTypeEnumMember.h" |
Enrico Granata | 061858c | 2012-02-15 02:34:21 +0000 | [diff] [blame] | 106 | #include "lldb/API/SBTypeFilter.h" |
| 107 | #include "lldb/API/SBTypeFormat.h" |
| 108 | #include "lldb/API/SBTypeNameSpecifier.h" |
| 109 | #include "lldb/API/SBTypeSummary.h" |
| 110 | #include "lldb/API/SBTypeSynthetic.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 111 | #include "lldb/API/SBValue.h" |
Caroline Tice | 7740412 | 2010-09-22 16:41:52 +0000 | [diff] [blame] | 112 | #include "lldb/API/SBValueList.h" |
Zachary Turner | 51f96ee | 2015-02-17 17:55:50 +0000 | [diff] [blame] | 113 | #include "lldb/API/SBVariablesOptions.h" |
Greg Clayton | 1b282f9 | 2011-10-13 18:08:26 +0000 | [diff] [blame] | 114 | #include "lldb/API/SBWatchpoint.h" |
Todd Fiala | 802dc402 | 2014-06-23 19:30:49 +0000 | [diff] [blame] | 115 | #include "lldb/API/SBUnixSignals.h" |
Enrico Granata | c972c70 | 2013-06-21 18:57:30 +0000 | [diff] [blame] | 116 | |
Zachary Turner | 60c24f7 | 2015-10-14 16:59:32 +0000 | [diff] [blame] | 117 | #include "../source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h" |
Enrico Granata | c972c70 | 2013-06-21 18:57:30 +0000 | [diff] [blame] | 118 | |
Zachary Turner | 60c24f7 | 2015-10-14 16:59:32 +0000 | [diff] [blame] | 119 | #include "../scripts/Python/python-swigsafecast.swig" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 120 | %} |
| 121 | |
| 122 | /* Various liblldb typedefs that SWIG needs to know about. */ |
Johnny Chen | 4b33209 | 2010-12-16 00:01:06 +0000 | [diff] [blame] | 123 | #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ |
Todd Fiala | 802dc402 | 2014-06-23 19:30:49 +0000 | [diff] [blame] | 124 | /* The ISO C99 standard specifies that in C++ implementations limit macros such |
| 125 | as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */ |
| 126 | #define __STDC_LIMIT_MACROS |
Filipe Cabecinhas | 3e6ff11 | 2012-09-19 15:22:05 +0000 | [diff] [blame] | 127 | %include "stdint.i" |
Zachary Turner | 60c24f7 | 2015-10-14 16:59:32 +0000 | [diff] [blame] | 128 | |
Greg Clayton | 05faeb7 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 129 | %include "lldb/lldb-defines.h" |
| 130 | %include "lldb/lldb-enumerations.h" |
| 131 | %include "lldb/lldb-forward.h" |
Greg Clayton | 05faeb7 | 2010-10-07 04:19:01 +0000 | [diff] [blame] | 132 | %include "lldb/lldb-types.h" |
Johnny Chen | 349f076 | 2011-07-19 01:07:06 +0000 | [diff] [blame] | 133 | |
Johnny Chen | fdc4a86 | 2011-07-19 22:41:47 +0000 | [diff] [blame] | 134 | /* Forward declaration of SB classes. */ |
Johnny Chen | 0f51968 | 2011-07-19 21:49:34 +0000 | [diff] [blame] | 135 | %include "lldb/API/SBDefines.h" |
Johnny Chen | 0f51968 | 2011-07-19 21:49:34 +0000 | [diff] [blame] | 136 | |
| 137 | /* Python interface files with docstrings. */ |
Bruce Mitchener | 17d2730 | 2015-04-24 00:38:53 +0000 | [diff] [blame] | 138 | %include "./interface/SBAddress.i" |
| 139 | %include "./interface/SBAttachInfo.i" |
| 140 | %include "./interface/SBBlock.i" |
| 141 | %include "./interface/SBBreakpoint.i" |
| 142 | %include "./interface/SBBreakpointLocation.i" |
| 143 | %include "./interface/SBBroadcaster.i" |
| 144 | %include "./interface/SBCommandInterpreter.i" |
| 145 | %include "./interface/SBCommandReturnObject.i" |
| 146 | %include "./interface/SBCommunication.i" |
| 147 | %include "./interface/SBCompileUnit.i" |
| 148 | %include "./interface/SBData.i" |
| 149 | %include "./interface/SBDebugger.i" |
| 150 | %include "./interface/SBDeclaration.i" |
| 151 | %include "./interface/SBError.i" |
| 152 | %include "./interface/SBEvent.i" |
| 153 | %include "./interface/SBExecutionContext.i" |
| 154 | %include "./interface/SBExpressionOptions.i" |
| 155 | %include "./interface/SBFileSpec.i" |
| 156 | %include "./interface/SBFileSpecList.i" |
| 157 | %include "./interface/SBFrame.i" |
| 158 | %include "./interface/SBFunction.i" |
| 159 | %include "./interface/SBHostOS.i" |
| 160 | %include "./interface/SBInstruction.i" |
| 161 | %include "./interface/SBInstructionList.i" |
Ilia K | 7f83624 | 2015-04-28 12:51:16 +0000 | [diff] [blame] | 162 | %include "./interface/SBLanguageRuntime.i" |
Bruce Mitchener | 17d2730 | 2015-04-24 00:38:53 +0000 | [diff] [blame] | 163 | %include "./interface/SBLaunchInfo.i" |
| 164 | %include "./interface/SBLineEntry.i" |
| 165 | %include "./interface/SBListener.i" |
| 166 | %include "./interface/SBModule.i" |
| 167 | %include "./interface/SBModuleSpec.i" |
| 168 | %include "./interface/SBPlatform.i" |
| 169 | %include "./interface/SBProcess.i" |
| 170 | %include "./interface/SBQueue.i" |
| 171 | %include "./interface/SBQueueItem.i" |
| 172 | %include "./interface/SBSection.i" |
| 173 | %include "./interface/SBSourceManager.i" |
| 174 | %include "./interface/SBStream.i" |
| 175 | %include "./interface/SBStringList.i" |
| 176 | %include "./interface/SBSymbol.i" |
| 177 | %include "./interface/SBSymbolContext.i" |
| 178 | %include "./interface/SBSymbolContextList.i" |
| 179 | %include "./interface/SBTarget.i" |
| 180 | %include "./interface/SBThread.i" |
| 181 | %include "./interface/SBThreadCollection.i" |
| 182 | %include "./interface/SBThreadPlan.i" |
| 183 | %include "./interface/SBType.i" |
| 184 | %include "./interface/SBTypeCategory.i" |
| 185 | %include "./interface/SBTypeEnumMember.i" |
| 186 | %include "./interface/SBTypeFilter.i" |
| 187 | %include "./interface/SBTypeFormat.i" |
| 188 | %include "./interface/SBTypeNameSpecifier.i" |
| 189 | %include "./interface/SBTypeSummary.i" |
| 190 | %include "./interface/SBTypeSynthetic.i" |
| 191 | %include "./interface/SBValue.i" |
| 192 | %include "./interface/SBValueList.i" |
| 193 | %include "./interface/SBVariablesOptions.i" |
| 194 | %include "./interface/SBWatchpoint.i" |
| 195 | %include "./interface/SBUnixSignals.i" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 196 | |
Caroline Tice | dac97f3 | 2010-09-22 23:01:29 +0000 | [diff] [blame] | 197 | %include "./Python/python-extensions.swig" |
Caroline Tice | 18474c9 | 2010-09-27 18:00:20 +0000 | [diff] [blame] | 198 | |
Johnny Chen | 11346d3 | 2011-07-26 19:09:03 +0000 | [diff] [blame] | 199 | %include "./Python/python-wrapper.swig" |