2010-06-09 00:52:24 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# build-swig-Python.sh
|
|
|
|
|
2010-06-17 03:26:52 +08:00
|
|
|
# SRC_ROOT is the root of the lldb source tree.
|
|
|
|
# TARGET_DIR is where the lldb framework/shared library gets put.
|
|
|
|
# CONFIG_BUILD_DIR is where the build-swig-Python-LLDB.sh shell script
|
|
|
|
# put the lldb.py file it was generated from running SWIG.
|
|
|
|
# PREFIX is the root directory used to determine where third-party modules
|
|
|
|
# for scripting languages should be installed.
|
|
|
|
# debug_flag (optional) determines whether or not this script outputs
|
|
|
|
# additional information when running.
|
|
|
|
|
|
|
|
SRC_ROOT=$1
|
|
|
|
TARGET_DIR=$2
|
|
|
|
CONFIG_BUILD_DIR=$3
|
|
|
|
PYTHON_INSTALL_DIR=$4
|
|
|
|
debug_flag=$5
|
2011-03-01 09:39:04 +08:00
|
|
|
SWIG=$6
|
2010-06-17 03:26:52 +08:00
|
|
|
|
2012-09-15 01:09:15 +08:00
|
|
|
os_name=`uname -s`
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ "$os_name" = "Darwin" ]
|
2012-09-15 01:09:15 +08:00
|
|
|
then
|
|
|
|
swig_output_file=${SRC_ROOT}/source/LLDBWrapPython.cpp
|
|
|
|
else
|
|
|
|
swig_output_file=${TARGET_DIR}/LLDBWrapPython.cpp
|
|
|
|
fi
|
2010-06-17 03:26:52 +08:00
|
|
|
swig_input_file=${SRC_ROOT}/scripts/lldb.swig
|
2011-08-23 06:10:57 +08:00
|
|
|
swig_python_extensions=${SRC_ROOT}/scripts/Python/python-extensions.swig
|
|
|
|
swig_python_wrapper=${SRC_ROOT}/scripts/Python/python-wrapper.swig
|
2012-02-03 01:26:00 +08:00
|
|
|
swig_python_typemaps=${SRC_ROOT}/scripts/Python/python-typemaps.swig
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2012-09-15 01:09:15 +08:00
|
|
|
if [ "$LLDB_DISABLE_PYTHON" = "1" ] ; then
|
2012-05-26 08:23:52 +08:00
|
|
|
# We don't want Python for this build, but touch the output file so we don't have to
|
|
|
|
# conditionalize the build on this as well.
|
|
|
|
# Note, at present iOS doesn't have Python, so if you're building for iOS be sure to
|
|
|
|
# set LLDB_DISABLE_PYTHON to 1.
|
2012-05-24 09:16:09 +08:00
|
|
|
rm -rf ${swig_output_file}
|
|
|
|
touch ${swig_output_file}
|
|
|
|
|
|
|
|
else
|
2011-11-04 11:34:56 +08:00
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ -n "$debug_flag" -a "$debug_flag" = "-debug" ]
|
2010-06-09 00:52:24 +08:00
|
|
|
then
|
|
|
|
Debug=1
|
|
|
|
else
|
|
|
|
Debug=0
|
|
|
|
fi
|
|
|
|
|
2012-02-21 13:33:55 +08:00
|
|
|
# If this project is being built with LLDB_DISABLE_PYTHON defined,
|
|
|
|
# don't bother generating Python swig bindings -- we don't have
|
|
|
|
# Python available.
|
|
|
|
|
|
|
|
if echo $GCC_PREPROCESSOR_DEFINITIONS | grep LLDB_DISABLE_PYTHON
|
|
|
|
then
|
|
|
|
echo "" > "${swig_output_file}"
|
|
|
|
exit 0
|
|
|
|
fi
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2011-03-25 05:19:54 +08:00
|
|
|
HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
|
2010-10-19 07:00:51 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/lldb-defines.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/lldb-enumerations.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/lldb-forward.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/lldb-forward-rtti.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/lldb-types.h"\
|
2010-06-17 03:26:52 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBAddress.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBBlock.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBBreakpoint.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBBreakpointLocation.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBBroadcaster.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBCommandInterpreter.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBCommandReturnObject.h"\
|
2010-10-07 12:19:01 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBCommunication.h"\
|
2010-06-17 03:26:52 +08:00
|
|
|
" ${SRC_ROOT}/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
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBData.h"\
|
2010-06-17 03:26:52 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBDebugger.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBError.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBEvent.h"\
|
2010-08-28 06:35:26 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBFileSpec.h"\
|
2010-06-17 03:26:52 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBFrame.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBFunction.h"\
|
2010-10-07 12:19:01 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBHostOS.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBInputReader.h"\
|
2010-10-06 11:09:58 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBInstruction.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBInstructionList.h"\
|
2010-06-17 03:26:52 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBLineEntry.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBListener.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBModule.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBProcess.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBSourceManager.h"\
|
2010-09-23 00:41:52 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBStream.h"\
|
2010-06-17 03:26:52 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBStringList.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBSymbol.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBSymbolContext.h"\
|
2010-10-07 12:19:01 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBSymbolContextList.h"\
|
2010-06-17 03:26:52 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBTarget.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBThread.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBType.h"\
|
2012-02-15 10:34:21 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBTypeCategory.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBTypeFilter.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBTypeFormat.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBTypeNameSpecifier.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBTypeSummary.h"\
|
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBTypeSynthetic.h"\
|
2010-09-23 00:41:52 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBValue.h"\
|
2011-09-27 09:19:20 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBValueList.h"\
|
2012-09-29 07:57:51 +08:00
|
|
|
" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2011-09-10 01:37:06 +08:00
|
|
|
INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBBlock.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBBreakpoint.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBBreakpointLocation.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBBroadcaster.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBCommandInterpreter.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBCommandReturnObject.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBCommunication.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBCompileUnit.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBData.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBDebugger.i"\
|
2012-10-11 06:54:17 +08:00
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBDeclaration.i"\
|
2011-09-10 01:37:06 +08:00
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBError.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBEvent.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBFileSpec.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBFrame.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBFunction.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBHostOS.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBInputReader.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBInstruction.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBInstructionList.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBLineEntry.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBListener.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBModule.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBProcess.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBSourceManager.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBStream.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBStringList.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBSymbol.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBSymbolContext.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBTarget.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBThread.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBType.i"\
|
2012-02-15 10:34:21 +08:00
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBTypeCategory.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBTypeFilter.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBTypeFormat.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBTypeNameSpecifier.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBTypeSummary.i"\
|
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBTypeSynthetic.i"\
|
2011-09-10 01:37:06 +08:00
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBValue.i"\
|
2011-09-27 09:19:20 +08:00
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBValueList.i"\
|
2011-10-14 02:08:26 +08:00
|
|
|
" ${SRC_ROOT}/scripts/Python/interface/SBWatchpoint.i"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
2010-06-09 00:52:24 +08:00
|
|
|
then
|
|
|
|
echo "Header files are:"
|
|
|
|
echo ${HEADER_FILES}
|
|
|
|
fi
|
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
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
|
|
|
then
|
|
|
|
echo "SWIG interface files are:"
|
|
|
|
echo ${INTERFACE_FILES}
|
|
|
|
fi
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
NeedToUpdate=0
|
|
|
|
|
|
|
|
|
2010-08-27 04:04:17 +08:00
|
|
|
if [ ! -f ${swig_output_file} ]
|
2010-06-09 00:52:24 +08:00
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
2010-06-09 00:52:24 +08:00
|
|
|
then
|
|
|
|
echo "Failed to find LLDBWrapPython.cpp"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $NeedToUpdate -eq 0 ]
|
2010-06-09 00:52:24 +08:00
|
|
|
then
|
|
|
|
for hdrfile in ${HEADER_FILES}
|
|
|
|
do
|
2010-08-27 04:04:17 +08:00
|
|
|
if [ $hdrfile -nt ${swig_output_file} ]
|
2010-06-09 00:52:24 +08:00
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
2010-06-09 00:52:24 +08:00
|
|
|
then
|
|
|
|
echo "${hdrfile} is newer than ${swig_output_file}"
|
|
|
|
echo "swig file will need to be re-built."
|
|
|
|
fi
|
2010-08-27 04:04:17 +08:00
|
|
|
break
|
2010-06-09 00:52:24 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $NeedToUpdate -eq 0 ]
|
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
|
|
|
then
|
|
|
|
for intffile in ${INTERFACE_FILES}
|
|
|
|
do
|
|
|
|
if [ $intffile -nt ${swig_output_file} ]
|
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
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
|
|
|
then
|
|
|
|
echo "${intffile} is newer than ${swig_output_file}"
|
|
|
|
echo "swig file will need to be re-built."
|
|
|
|
fi
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $NeedToUpdate -eq 0 ]
|
2010-08-27 04:04:17 +08:00
|
|
|
then
|
|
|
|
if [ ${swig_input_file} -nt ${swig_output_file} ]
|
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
2010-08-27 04:04:17 +08:00
|
|
|
then
|
|
|
|
echo "${swig_input_file} is newer than ${swig_output_file}"
|
|
|
|
echo "swig file will need to be re-built."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $NeedToUpdate -eq 0 ]
|
2010-10-26 11:11:13 +08:00
|
|
|
then
|
2011-08-23 06:10:57 +08:00
|
|
|
if [ ${swig_python_extensions} -nt ${swig_output_file} ]
|
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
2011-08-23 06:10:57 +08:00
|
|
|
then
|
|
|
|
echo "${swig_python_extensions} is newer than ${swig_output_file}"
|
|
|
|
echo "swig file will need to be re-built."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $NeedToUpdate -eq 0 ]
|
2011-08-23 06:10:57 +08:00
|
|
|
then
|
|
|
|
if [ ${swig_python_wrapper} -nt ${swig_output_file} ]
|
2010-10-26 11:11:13 +08:00
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
2010-10-26 11:11:13 +08:00
|
|
|
then
|
2011-08-23 06:10:57 +08:00
|
|
|
echo "${swig_python_wrapper} is newer than ${swig_output_file}"
|
2010-10-26 11:11:13 +08:00
|
|
|
echo "swig file will need to be re-built."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $NeedToUpdate -eq 0 ]
|
2012-02-03 01:26:00 +08:00
|
|
|
then
|
|
|
|
if [ ${swig_python_typemaps} -nt ${swig_output_file} ]
|
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $Debug -eq 1 ]
|
2012-02-03 01:26:00 +08:00
|
|
|
then
|
|
|
|
echo "${swig_python_typemaps} is newer than ${swig_output_file}"
|
|
|
|
echo "swig file will need to be re-built."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-09-15 01:09:15 +08:00
|
|
|
python_version=`/usr/bin/env python --version 2>&1 | sed -e 's,Python ,,' -e 's,[.][0-9],,2' -e 's,[a-z][a-z][0-9],,'`
|
2010-06-17 03:26:52 +08:00
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ "$os_name" = "Darwin" ]
|
2010-06-17 03:26:52 +08:00
|
|
|
then
|
|
|
|
framework_python_dir="${TARGET_DIR}/LLDB.framework/Resources/Python"
|
|
|
|
else
|
|
|
|
framework_python_dir="${PYTHON_INSTALL_DIR}/python${python_version}"
|
|
|
|
fi
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
if [ ! -L "${framework_python_dir}/_lldb.so" ]
|
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "${framework_python_dir}/lldb.py" ]
|
|
|
|
then
|
|
|
|
NeedToUpdate=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2012-09-28 05:26:57 +08:00
|
|
|
if [ $NeedToUpdate -eq 0 ]
|
2010-06-09 00:52:24 +08:00
|
|
|
then
|
|
|
|
echo "Everything is up-to-date."
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "SWIG needs to be re-run."
|
2010-10-26 11:11:13 +08:00
|
|
|
if [ -f ${swig_output_file} ]
|
|
|
|
then
|
|
|
|
rm ${swig_output_file}
|
|
|
|
fi
|
2010-06-09 00:52:24 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Build the SWIG C++ wrapper file for Python.
|
|
|
|
|
2012-08-18 12:14:54 +08:00
|
|
|
$SWIG -c++ -shadow -python -threads -I"/usr/include" -I"${SRC_ROOT}/include" -I./. -outdir "${CONFIG_BUILD_DIR}" -o "${swig_output_file}" "${swig_input_file}"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2011-04-30 03:22:24 +08:00
|
|
|
# Implement the iterator protocol and/or eq/ne operators for some lldb objects.
|
2010-07-01 00:22:25 +08:00
|
|
|
# Append global variable to lldb Python module.
|
2011-04-29 05:31:18 +08:00
|
|
|
# And initialize the lldb debugger subsystem.
|
2010-07-01 00:22:25 +08:00
|
|
|
current_dir=`pwd`
|
2011-04-29 05:31:18 +08:00
|
|
|
if [ -f "${current_dir}/modify-python-lldb.py" ]
|
2010-07-01 00:22:25 +08:00
|
|
|
then
|
2011-04-29 05:31:18 +08:00
|
|
|
python ${current_dir}/modify-python-lldb.py ${CONFIG_BUILD_DIR}
|
2010-07-01 00:22:25 +08:00
|
|
|
fi
|
2010-10-29 05:51:20 +08:00
|
|
|
|
|
|
|
# Fix the "#include" statement in the swig output file
|
|
|
|
|
|
|
|
if [ -f "${current_dir}/edit-swig-python-wrapper-file.py" ]
|
|
|
|
then
|
|
|
|
python ${current_dir}/edit-swig-python-wrapper-file.py
|
|
|
|
if [ -f "${swig_output_file}.edited" ]
|
|
|
|
then
|
|
|
|
mv "${swig_output_file}.edited" ${swig_output_file}
|
|
|
|
fi
|
|
|
|
fi
|
2011-11-04 11:34:56 +08:00
|
|
|
|
|
|
|
fi
|