blob: 1d333540728cc344b70eadfca6ce75a7bf9f9d3b [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001/*
2 lldb.swig
3
Chris Lattner30fdc8d2010-06-08 16:52:24 +00004 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 Lattner30fdc8d2010-06-08 16:52:24 +00007*/
8
Johnny Chenee481782011-06-30 21:29:50 +00009/* Define our module docstring. */
10%define DOCSTRING
11"The lldb module contains the public APIs for Python binding.
Chris Lattner30fdc8d2010-06-08 16:52:24 +000012
Jason Molenda8c713372013-11-05 11:00:35 +000013Some of the important classes are described here:
Johnny Chenee481782011-06-30 21:29:50 +000014
15o SBTarget: Represents the target program running under the debugger.
16o SBProcess: Represents the process associated with the target program.
17o SBThread: Represents a thread of execution. SBProcess contains SBThread(s).
18o SBFrame: Represents one of the stack frames associated with a thread. SBThread
19 contains SBFrame(s).
20o SBSymbolContext: A container that stores various debugger related info.
21o SBValue: Represents the value of a variable, a register, or an expression.
22o SBModule: Represents an executable image and its associated object and symbol
Bruce Mitchener58ef3912015-06-18 05:27:05 +000023 files. SBTarget contains SBModule(s).
Johnny Chen4036b582011-07-14 21:32:11 +000024o SBBreakpoint: Represents a logical breakpoint and its associated settings.
Bruce Mitchener58ef3912015-06-18 05:27:05 +000025 SBTarget contains SBBreakpoint(s).
Johnny Chen993f2b62011-07-14 21:23:24 +000026o SBSymbol: Represents the symbol possibly associated with a stack frame.
Johnny Chenee481782011-06-30 21:29:50 +000027o SBCompileUnit: Represents a compilation unit, or compiled source file.
28o SBFunction: Represents a generic function, which can be inlined or not.
29o SBBlock: Represents a lexical block. SBFunction contains SBBlock(s).
30o SBLineEntry: Specifies an association with a contiguous range of instructions
Johnny Chen61abb2a2011-07-01 18:39:47 +000031 and a source file location. SBCompileUnit contains SBLineEntry(s)."
Johnny Chenee481782011-06-30 21:29:50 +000032%enddef
33
Johnny Chen9ffc9f72011-07-16 21:27:36 +000034// The name of the module to be created.
Johnny Chenee481782011-06-30 21:29:50 +000035%module(docstring=DOCSTRING) lldb
36
Johnny Chen9ffc9f72011-07-16 21:27:36 +000037// Parameter types will be used in the autodoc string.
38%feature("autodoc", "1");
Chris Lattner30fdc8d2010-06-08 16:52:24 +000039
Greg Clayton6b2bd932012-02-01 08:09:32 +000040%pythoncode%{
41import uuid
42import re
43import os
Zachary Turnerd4870df2015-11-11 17:59:57 +000044
45import six
Greg Clayton6b2bd932012-02-01 08:09:32 +000046%}
Johnny Chen11346d32011-07-26 19:09:03 +000047%include "./Python/python-typemaps.swig"
Greg Claytonca512b32011-01-14 04:54:56 +000048
Sean Callananecb20882012-08-09 00:53:54 +000049/* C++ headers to be included. */
50%{
Zachary Turner02bf92d2015-11-12 17:01:48 +000051#include <algorithm>
Sean Callananecb20882012-08-09 00:53:54 +000052#include <string>
53%}
54
Greg Claytonc0cc73e2010-06-12 15:34:20 +000055/* The liblldb header files to be included. */
Chris Lattner30fdc8d2010-06-08 16:52:24 +000056%{
Greg Claytone0d378b2011-03-24 21:19:54 +000057#include "lldb/lldb-public.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000058#include "lldb/API/SBAddress.h"
Oleksiy Vyalov71d08b32015-02-16 00:04:19 +000059#include "lldb/API/SBAttachInfo.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000060#include "lldb/API/SBBlock.h"
61#include "lldb/API/SBBreakpoint.h"
62#include "lldb/API/SBBreakpointLocation.h"
63#include "lldb/API/SBBroadcaster.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000064#include "lldb/API/SBCommandInterpreter.h"
65#include "lldb/API/SBCommandReturnObject.h"
Greg Clayton05faeb72010-10-07 04:19:01 +000066#include "lldb/API/SBCommunication.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000067#include "lldb/API/SBCompileUnit.h"
Enrico Granata9128ee22011-09-06 19:20:51 +000068#include "lldb/API/SBData.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000069#include "lldb/API/SBDebugger.h"
Enrico Granata10de0902012-10-10 22:54:17 +000070#include "lldb/API/SBDeclaration.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000071#include "lldb/API/SBError.h"
72#include "lldb/API/SBEvent.h"
Enrico Granatae85e84a2014-10-01 20:43:45 +000073#include "lldb/API/SBExecutionContext.h"
Jim Ingham35e1bda2012-10-16 21:41:58 +000074#include "lldb/API/SBExpressionOptions.h"
Johnny Chen23fd10c2010-08-27 22:35:26 +000075#include "lldb/API/SBFileSpec.h"
Jim Ingham969795f2011-09-21 01:17:13 +000076#include "lldb/API/SBFileSpecList.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000077#include "lldb/API/SBFrame.h"
78#include "lldb/API/SBFunction.h"
Greg Clayton05faeb72010-10-07 04:19:01 +000079#include "lldb/API/SBHostOS.h"
Greg Clayton1d273162010-10-06 03:09:58 +000080#include "lldb/API/SBInstruction.h"
81#include "lldb/API/SBInstructionList.h"
Ilia K7f836242015-04-28 12:51:16 +000082#include "lldb/API/SBLanguageRuntime.h"
Oleksiy Vyalov1ef7b2c2015-02-04 23:19:15 +000083#include "lldb/API/SBLaunchInfo.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000084#include "lldb/API/SBLineEntry.h"
85#include "lldb/API/SBListener.h"
86#include "lldb/API/SBModule.h"
Greg Clayton226cce22013-07-08 22:22:41 +000087#include "lldb/API/SBModuleSpec.h"
Greg Claytonfbb76342013-11-20 21:07:01 +000088#include "lldb/API/SBPlatform.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000089#include "lldb/API/SBProcess.h"
Jason Molenda5e8dce42013-12-13 00:29:16 +000090#include "lldb/API/SBQueue.h"
91#include "lldb/API/SBQueueItem.h"
Greg Claytoncac9c5f2011-09-24 00:52:29 +000092#include "lldb/API/SBSection.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000093#include "lldb/API/SBSourceManager.h"
Caroline Ticedde9cff2010-09-20 05:20:02 +000094#include "lldb/API/SBStream.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000095#include "lldb/API/SBStringList.h"
96#include "lldb/API/SBSymbol.h"
97#include "lldb/API/SBSymbolContext.h"
Greg Clayton05faeb72010-10-07 04:19:01 +000098#include "lldb/API/SBSymbolContextList.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000099#include "lldb/API/SBTarget.h"
100#include "lldb/API/SBThread.h"
Kuba Breckaa5ea1e22014-09-06 01:21:19 +0000101#include "lldb/API/SBThreadCollection.h"
Jim Ingham2bdbfd52014-09-29 23:17:18 +0000102#include "lldb/API/SBThreadPlan.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000103#include "lldb/API/SBType.h"
Enrico Granata061858c2012-02-15 02:34:21 +0000104#include "lldb/API/SBTypeCategory.h"
Todd Fiala732215f2014-06-02 20:55:29 +0000105#include "lldb/API/SBTypeEnumMember.h"
Enrico Granata061858c2012-02-15 02:34:21 +0000106#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 Lattner30fdc8d2010-06-08 16:52:24 +0000111#include "lldb/API/SBValue.h"
Caroline Tice77404122010-09-22 16:41:52 +0000112#include "lldb/API/SBValueList.h"
Zachary Turner51f96ee2015-02-17 17:55:50 +0000113#include "lldb/API/SBVariablesOptions.h"
Greg Clayton1b282f92011-10-13 18:08:26 +0000114#include "lldb/API/SBWatchpoint.h"
Todd Fiala802dc4022014-06-23 19:30:49 +0000115#include "lldb/API/SBUnixSignals.h"
Enrico Granatac972c702013-06-21 18:57:30 +0000116
Zachary Turner60c24f72015-10-14 16:59:32 +0000117#include "../source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h"
Enrico Granatac972c702013-06-21 18:57:30 +0000118
Zachary Turner60c24f72015-10-14 16:59:32 +0000119#include "../scripts/Python/python-swigsafecast.swig"
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000120%}
121
122/* Various liblldb typedefs that SWIG needs to know about. */
Johnny Chen4b332092010-12-16 00:01:06 +0000123#define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */
Todd Fiala802dc4022014-06-23 19:30:49 +0000124/* 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 Cabecinhas3e6ff112012-09-19 15:22:05 +0000127%include "stdint.i"
Zachary Turner60c24f72015-10-14 16:59:32 +0000128
Greg Clayton05faeb72010-10-07 04:19:01 +0000129%include "lldb/lldb-defines.h"
130%include "lldb/lldb-enumerations.h"
131%include "lldb/lldb-forward.h"
Greg Clayton05faeb72010-10-07 04:19:01 +0000132%include "lldb/lldb-types.h"
Johnny Chen349f0762011-07-19 01:07:06 +0000133
Johnny Chenfdc4a862011-07-19 22:41:47 +0000134/* Forward declaration of SB classes. */
Johnny Chen0f519682011-07-19 21:49:34 +0000135%include "lldb/API/SBDefines.h"
Johnny Chen0f519682011-07-19 21:49:34 +0000136
137/* Python interface files with docstrings. */
Bruce Mitchener17d27302015-04-24 00:38:53 +0000138%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 K7f836242015-04-28 12:51:16 +0000162%include "./interface/SBLanguageRuntime.i"
Bruce Mitchener17d27302015-04-24 00:38:53 +0000163%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 Lattner30fdc8d2010-06-08 16:52:24 +0000196
Caroline Ticedac97f32010-09-22 23:01:29 +0000197%include "./Python/python-extensions.swig"
Caroline Tice18474c92010-09-27 18:00:20 +0000198
Johnny Chen11346d32011-07-26 19:09:03 +0000199%include "./Python/python-wrapper.swig"