2010-06-09 00:52:24 +08:00
|
|
|
/*
|
|
|
|
lldb.swig
|
|
|
|
|
|
|
|
This is the input file for SWIG, to create the appropriate C++ wrappers and
|
|
|
|
functions for various scripting languages, to enable them to call the
|
|
|
|
liblldb Script Bridge functions.
|
|
|
|
*/
|
|
|
|
|
2011-07-01 05:29:50 +08:00
|
|
|
/* Define our module docstring. */
|
|
|
|
%define DOCSTRING
|
|
|
|
"The lldb module contains the public APIs for Python binding.
|
|
|
|
|
|
|
|
Some of the important classes are describe here:
|
|
|
|
|
|
|
|
o SBTarget: Represents the target program running under the debugger.
|
|
|
|
o SBProcess: Represents the process associated with the target program.
|
|
|
|
o SBThread: Represents a thread of execution. SBProcess contains SBThread(s).
|
|
|
|
o SBFrame: Represents one of the stack frames associated with a thread. SBThread
|
|
|
|
contains SBFrame(s).
|
|
|
|
o SBSymbolContext: A container that stores various debugger related info.
|
|
|
|
o SBValue: Represents the value of a variable, a register, or an expression.
|
|
|
|
o SBModule: Represents an executable image and its associated object and symbol
|
2011-07-15 05:32:11 +08:00
|
|
|
files. SBTarget conatins SBModule(s).
|
|
|
|
o SBBreakpoint: Represents a logical breakpoint and its associated settings.
|
|
|
|
SBTarget conatins SBBreakpoint(s).
|
2011-07-15 05:23:24 +08:00
|
|
|
o SBSymbol: Represents the symbol possibly associated with a stack frame.
|
2011-07-01 05:29:50 +08:00
|
|
|
o SBCompileUnit: Represents a compilation unit, or compiled source file.
|
|
|
|
o SBFunction: Represents a generic function, which can be inlined or not.
|
|
|
|
o SBBlock: Represents a lexical block. SBFunction contains SBBlock(s).
|
|
|
|
o SBLineEntry: Specifies an association with a contiguous range of instructions
|
2011-07-02 02:39:47 +08:00
|
|
|
and a source file location. SBCompileUnit contains SBLineEntry(s)."
|
2011-07-01 05:29:50 +08:00
|
|
|
%enddef
|
|
|
|
|
2011-07-17 05:27:36 +08:00
|
|
|
// The name of the module to be created.
|
2011-07-01 05:29:50 +08:00
|
|
|
%module(docstring=DOCSTRING) lldb
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2011-07-17 05:27:36 +08:00
|
|
|
// Parameter types will be used in the autodoc string.
|
|
|
|
%feature("autodoc", "1");
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2012-02-01 16:09:32 +08:00
|
|
|
%pythoncode%{
|
|
|
|
import uuid
|
|
|
|
import re
|
|
|
|
import os
|
|
|
|
%}
|
2011-07-27 03:09:03 +08:00
|
|
|
%include "./Python/python-typemaps.swig"
|
2011-01-14 12:54:56 +08:00
|
|
|
|
2012-08-09 08:53:54 +08:00
|
|
|
/* C++ headers to be included. */
|
|
|
|
%{
|
|
|
|
#include <string>
|
|
|
|
%}
|
|
|
|
|
2010-06-12 23:34:20 +08:00
|
|
|
/* The liblldb header files to be included. */
|
2010-06-09 00:52:24 +08:00
|
|
|
%{
|
2011-03-25 05:19:54 +08:00
|
|
|
#include "lldb/lldb-public.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBAddress.h"
|
|
|
|
#include "lldb/API/SBBlock.h"
|
|
|
|
#include "lldb/API/SBBreakpoint.h"
|
|
|
|
#include "lldb/API/SBBreakpointLocation.h"
|
|
|
|
#include "lldb/API/SBBroadcaster.h"
|
|
|
|
#include "lldb/API/SBCommandInterpreter.h"
|
|
|
|
#include "lldb/API/SBCommandReturnObject.h"
|
2010-10-07 12:19:01 +08:00
|
|
|
#include "lldb/API/SBCommunication.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBCompileUnit.h"
|
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
|
|
|
#include "lldb/API/SBData.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBDebugger.h"
|
2012-10-11 06:54:17 +08:00
|
|
|
#include "lldb/API/SBDeclaration.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBError.h"
|
|
|
|
#include "lldb/API/SBEvent.h"
|
2012-10-17 05:41:58 +08:00
|
|
|
#include "lldb/API/SBExpressionOptions.h"
|
2010-08-28 06:35:26 +08:00
|
|
|
#include "lldb/API/SBFileSpec.h"
|
2011-09-21 09:17:13 +08:00
|
|
|
#include "lldb/API/SBFileSpecList.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBFrame.h"
|
|
|
|
#include "lldb/API/SBFunction.h"
|
2010-10-07 12:19:01 +08:00
|
|
|
#include "lldb/API/SBHostOS.h"
|
|
|
|
#include "lldb/API/SBInputReader.h"
|
2010-10-06 11:09:58 +08:00
|
|
|
#include "lldb/API/SBInstruction.h"
|
|
|
|
#include "lldb/API/SBInstructionList.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBLineEntry.h"
|
|
|
|
#include "lldb/API/SBListener.h"
|
|
|
|
#include "lldb/API/SBModule.h"
|
|
|
|
#include "lldb/API/SBProcess.h"
|
2011-09-24 08:52:29 +08:00
|
|
|
#include "lldb/API/SBSection.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBSourceManager.h"
|
2010-09-20 13:20:02 +08:00
|
|
|
#include "lldb/API/SBStream.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBStringList.h"
|
|
|
|
#include "lldb/API/SBSymbol.h"
|
|
|
|
#include "lldb/API/SBSymbolContext.h"
|
2010-10-07 12:19:01 +08:00
|
|
|
#include "lldb/API/SBSymbolContextList.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBTarget.h"
|
|
|
|
#include "lldb/API/SBThread.h"
|
|
|
|
#include "lldb/API/SBType.h"
|
2012-02-15 10:34:21 +08:00
|
|
|
#include "lldb/API/SBTypeCategory.h"
|
|
|
|
#include "lldb/API/SBTypeFilter.h"
|
|
|
|
#include "lldb/API/SBTypeFormat.h"
|
|
|
|
#include "lldb/API/SBTypeNameSpecifier.h"
|
|
|
|
#include "lldb/API/SBTypeSummary.h"
|
|
|
|
#include "lldb/API/SBTypeSynthetic.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBValue.h"
|
2010-09-23 00:41:52 +08:00
|
|
|
#include "lldb/API/SBValueList.h"
|
2011-10-14 02:08:26 +08:00
|
|
|
#include "lldb/API/SBWatchpoint.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
%}
|
|
|
|
|
|
|
|
/* Various liblldb typedefs that SWIG needs to know about. */
|
2010-12-16 08:01:06 +08:00
|
|
|
#define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */
|
2012-09-19 23:22:05 +08:00
|
|
|
%include "stdint.i"
|
2010-10-07 12:19:01 +08:00
|
|
|
%include "lldb/lldb-defines.h"
|
|
|
|
%include "lldb/lldb-enumerations.h"
|
|
|
|
%include "lldb/lldb-forward.h"
|
|
|
|
%include "lldb/lldb-types.h"
|
2011-07-19 09:07:06 +08:00
|
|
|
|
2011-07-20 06:41:47 +08:00
|
|
|
/* Forward declaration of SB classes. */
|
2011-07-20 05:49:34 +08:00
|
|
|
%include "lldb/API/SBDefines.h"
|
|
|
|
|
|
|
|
/* Python interface files with docstrings. */
|
|
|
|
%include "./Python/interface/SBAddress.i"
|
|
|
|
%include "./Python/interface/SBBlock.i"
|
|
|
|
%include "./Python/interface/SBBreakpoint.i"
|
|
|
|
%include "./Python/interface/SBBreakpointLocation.i"
|
2011-07-20 06:41:47 +08:00
|
|
|
%include "./Python/interface/SBBroadcaster.i"
|
|
|
|
%include "./Python/interface/SBCommandInterpreter.i"
|
|
|
|
%include "./Python/interface/SBCommandReturnObject.i"
|
|
|
|
%include "./Python/interface/SBCommunication.i"
|
2011-07-20 05:49:34 +08:00
|
|
|
%include "./Python/interface/SBCompileUnit.i"
|
Redesign of the interaction between Python and frozen objects:
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
2011-09-07 03:20:51 +08:00
|
|
|
%include "./Python/interface/SBData.i"
|
2011-07-20 05:49:34 +08:00
|
|
|
%include "./Python/interface/SBDebugger.i"
|
2012-10-11 06:54:17 +08:00
|
|
|
%include "./Python/interface/SBDeclaration.i"
|
2011-07-20 06:41:47 +08:00
|
|
|
%include "./Python/interface/SBError.i"
|
2011-07-20 05:49:34 +08:00
|
|
|
%include "./Python/interface/SBEvent.i"
|
2012-10-17 05:41:58 +08:00
|
|
|
%include "./Python/interface/SBExpressionOptions.i"
|
2011-07-20 06:41:47 +08:00
|
|
|
%include "./Python/interface/SBFileSpec.i"
|
2011-09-21 09:17:13 +08:00
|
|
|
%include "./Python/interface/SBFileSpecList.i"
|
2011-07-20 05:49:34 +08:00
|
|
|
%include "./Python/interface/SBFrame.i"
|
|
|
|
%include "./Python/interface/SBFunction.i"
|
2011-07-20 06:41:47 +08:00
|
|
|
%include "./Python/interface/SBHostOS.i"
|
|
|
|
%include "./Python/interface/SBInputReader.i"
|
|
|
|
%include "./Python/interface/SBInstruction.i"
|
|
|
|
%include "./Python/interface/SBInstructionList.i"
|
2011-07-19 07:11:07 +08:00
|
|
|
%include "./Python/interface/SBLineEntry.i"
|
|
|
|
%include "./Python/interface/SBListener.i"
|
|
|
|
%include "./Python/interface/SBModule.i"
|
2011-07-19 04:13:38 +08:00
|
|
|
%include "./Python/interface/SBProcess.i"
|
2011-09-24 08:52:29 +08:00
|
|
|
%include "./Python/interface/SBSection.i"
|
2011-07-20 06:41:47 +08:00
|
|
|
%include "./Python/interface/SBSourceManager.i"
|
|
|
|
%include "./Python/interface/SBStream.i"
|
|
|
|
%include "./Python/interface/SBStringList.i"
|
2011-07-19 09:07:06 +08:00
|
|
|
%include "./Python/interface/SBSymbol.i"
|
|
|
|
%include "./Python/interface/SBSymbolContext.i"
|
|
|
|
%include "./Python/interface/SBSymbolContextList.i"
|
2011-07-17 05:15:39 +08:00
|
|
|
%include "./Python/interface/SBTarget.i"
|
2011-07-19 04:13:38 +08:00
|
|
|
%include "./Python/interface/SBThread.i"
|
2011-07-20 06:41:47 +08:00
|
|
|
%include "./Python/interface/SBType.i"
|
2012-02-15 10:34:21 +08:00
|
|
|
%include "./Python/interface/SBTypeCategory.i"
|
|
|
|
%include "./Python/interface/SBTypeFilter.i"
|
|
|
|
%include "./Python/interface/SBTypeFormat.i"
|
|
|
|
%include "./Python/interface/SBTypeNameSpecifier.i"
|
|
|
|
%include "./Python/interface/SBTypeSummary.i"
|
|
|
|
%include "./Python/interface/SBTypeSynthetic.i"
|
2011-07-19 03:08:30 +08:00
|
|
|
%include "./Python/interface/SBValue.i"
|
|
|
|
%include "./Python/interface/SBValueList.i"
|
2011-10-14 02:08:26 +08:00
|
|
|
%include "./Python/interface/SBWatchpoint.i"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2010-09-23 07:01:29 +08:00
|
|
|
%include "./Python/python-extensions.swig"
|
2010-09-28 02:00:20 +08:00
|
|
|
|
2011-07-27 03:09:03 +08:00
|
|
|
%include "./Python/python-wrapper.swig"
|