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.
|
|
|
|
|
2013-11-05 19:00:35 +08:00
|
|
|
Some of the important classes are described here:
|
2011-07-01 05:29:50 +08:00
|
|
|
|
|
|
|
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"
|
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"
|
Added a way to extract the module specifications from a file. A module specification is information that is required to describe a module (executable, shared library, object file, ect). This information includes host path, platform path (remote path), symbol file path, UUID, object name (for objects in .a files for example you could have an object name of "foo.o"), and target triple. Module specification can be used to create a module, or used to add a module to a target. A list of module specifications can be used to enumerate objects in container objects (like universal mach files and BSD archive files).
There are two new classes:
lldb::SBModuleSpec
lldb::SBModuleSpecList
The SBModuleSpec wraps up a lldb_private::ModuleSpec, and SBModuleSpecList wraps up a lldb_private::ModuleSpecList.
llvm-svn: 185877
2013-07-09 06:22:41 +08:00
|
|
|
#include "lldb/API/SBModuleSpec.h"
|
2013-11-21 05:07:01 +08:00
|
|
|
#include "lldb/API/SBPlatform.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/API/SBProcess.h"
|
2013-12-13 08:29:16 +08:00
|
|
|
#include "lldb/API/SBQueue.h"
|
|
|
|
#include "lldb/API/SBQueueItem.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"
|
2014-06-03 04:55:29 +08:00
|
|
|
#include "lldb/API/SBTypeEnumMember.h"
|
2012-02-15 10:34:21 +08:00
|
|
|
#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"
|
2014-06-24 03:30:49 +08:00
|
|
|
#include "lldb/API/SBUnixSignals.h"
|
2013-06-22 02:57:30 +08:00
|
|
|
|
|
|
|
#include "../scripts/Python/python-swigsafecast.swig"
|
|
|
|
|
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. */
|
2014-06-24 03:30:49 +08:00
|
|
|
/* The ISO C99 standard specifies that in C++ implementations limit macros such
|
|
|
|
as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */
|
|
|
|
#define __STDC_LIMIT_MACROS
|
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/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"
|
Added a way to extract the module specifications from a file. A module specification is information that is required to describe a module (executable, shared library, object file, ect). This information includes host path, platform path (remote path), symbol file path, UUID, object name (for objects in .a files for example you could have an object name of "foo.o"), and target triple. Module specification can be used to create a module, or used to add a module to a target. A list of module specifications can be used to enumerate objects in container objects (like universal mach files and BSD archive files).
There are two new classes:
lldb::SBModuleSpec
lldb::SBModuleSpecList
The SBModuleSpec wraps up a lldb_private::ModuleSpec, and SBModuleSpecList wraps up a lldb_private::ModuleSpecList.
llvm-svn: 185877
2013-07-09 06:22:41 +08:00
|
|
|
%include "./Python/interface/SBModuleSpec.i"
|
2013-11-21 05:07:01 +08:00
|
|
|
%include "./Python/interface/SBPlatform.i"
|
2011-07-19 04:13:38 +08:00
|
|
|
%include "./Python/interface/SBProcess.i"
|
2013-12-13 08:29:16 +08:00
|
|
|
%include "./Python/interface/SBQueue.i"
|
|
|
|
%include "./Python/interface/SBQueueItem.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"
|
2014-06-03 04:55:29 +08:00
|
|
|
%include "./Python/interface/SBTypeEnumMember.i"
|
2012-02-15 10:34:21 +08:00
|
|
|
%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"
|
2014-06-24 03:30:49 +08:00
|
|
|
%include "./Python/interface/SBUnixSignals.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"
|