Patch Enrico's changes from r150558 on 2012-02-14 to build even if Python

is not available (LLDB_DISABLE_PYTHON is defined).

Change build-swig-Python.sh to emit an empty LLDBPythonWrap.cpp file if 
this build is LLDB_DISABLE_PYTHON.

Change the "Copy to Xcode.app" shell script phase in the lldb.xcodeproj
to only do this copying for Mac native builds.

llvm-svn: 151035
This commit is contained in:
Jason Molenda 2012-02-21 05:33:55 +00:00
parent 021f73684b
commit cf7e2dc09a
17 changed files with 95 additions and 5 deletions

View File

@ -268,14 +268,18 @@ public:
SBTypeFormat
GetFormatForType (SBTypeNameSpecifier);
#ifndef LLDB_DISABLE_PYTHON
SBTypeSummary
GetSummaryForType (SBTypeNameSpecifier);
#endif
SBTypeFilter
GetFilterForType (SBTypeNameSpecifier);
#ifndef LLDB_DISABLE_PYTHON
SBTypeSynthetic
GetSyntheticForType (SBTypeNameSpecifier);
#endif
private:

View File

@ -64,7 +64,9 @@ class SBTypeFilter;
class SBTypeFormat;
class SBTypeNameSpecifier;
class SBTypeSummary;
#ifndef LLDB_DISABLE_PYTHON
class SBTypeSynthetic;
#endif
class SBTypeList;
class SBValue;
class SBValueList;

View File

@ -49,8 +49,10 @@ namespace lldb {
uint32_t
GetNumFilters ();
#ifndef LLDB_DISABLE_PYTHON
uint32_t
GetNumSynthetics ();
#endif
SBTypeNameSpecifier
GetTypeNameSpecifierForFilterAtIndex (uint32_t);
@ -61,8 +63,10 @@ namespace lldb {
SBTypeNameSpecifier
GetTypeNameSpecifierForSummaryAtIndex (uint32_t);
#ifndef LLDB_DISABLE_PYTHON
SBTypeNameSpecifier
GetTypeNameSpecifierForSyntheticAtIndex (uint32_t);
#endif
SBTypeFilter
GetFilterForType (SBTypeNameSpecifier);
@ -70,23 +74,33 @@ namespace lldb {
SBTypeFormat
GetFormatForType (SBTypeNameSpecifier);
#ifndef LLDB_DISABLE_PYTHON
SBTypeSummary
GetSummaryForType (SBTypeNameSpecifier);
#endif
#ifndef LLDB_DISABLE_PYTHON
SBTypeSynthetic
GetSyntheticForType (SBTypeNameSpecifier);
#endif
#ifndef LLDB_DISABLE_PYTHON
SBTypeFilter
GetFilterAtIndex (uint32_t);
#endif
SBTypeFormat
GetFormatAtIndex (uint32_t);
#ifndef LLDB_DISABLE_PYTHON
SBTypeSummary
GetSummaryAtIndex (uint32_t);
#endif
#ifndef LLDB_DISABLE_PYTHON
SBTypeSynthetic
GetSyntheticAtIndex (uint32_t);
#endif
bool
AddTypeFormat (SBTypeNameSpecifier,
@ -95,9 +109,11 @@ namespace lldb {
bool
DeleteTypeFormat (SBTypeNameSpecifier);
#ifndef LLDB_DISABLE_PYTHON
bool
AddTypeSummary (SBTypeNameSpecifier,
SBTypeSummary);
#endif
bool
DeleteTypeSummary (SBTypeNameSpecifier);
@ -109,12 +125,14 @@ namespace lldb {
bool
DeleteTypeFilter (SBTypeNameSpecifier);
#ifndef LLDB_DISABLE_PYTHON
bool
AddTypeSynthetic (SBTypeNameSpecifier,
SBTypeSynthetic);
bool
DeleteTypeSynthetic (SBTypeNameSpecifier);
#endif
lldb::SBTypeCategory &
operator = (const lldb::SBTypeCategory &rhs);

View File

@ -12,6 +12,8 @@
#include "lldb/API/SBDefines.h"
#ifndef LLDB_DISABLE_PYTHON
namespace lldb {
class SBTypeSummary
@ -108,4 +110,6 @@ namespace lldb {
} // namespace lldb
#endif // LLDB_DISABLE_PYTHON
#endif // LLDB_SBTypeSummary_h_

View File

@ -12,6 +12,8 @@
#include "lldb/API/SBDefines.h"
#ifndef LLDB_DISABLE_PYTHON
namespace lldb {
class SBTypeSynthetic
@ -95,4 +97,6 @@ namespace lldb {
} // namespace lldb
#endif // LLDB_DISABLE_PYTHON
#endif // LLDB_SBTypeSynthetic_h_

View File

@ -104,14 +104,18 @@ public:
lldb::SBTypeFormat
GetTypeFormat ();
#ifndef LLDB_DISABLE_PYTHON
lldb::SBTypeSummary
GetTypeSummary ();
#endif
lldb::SBTypeFilter
GetTypeFilter ();
#ifndef LLDB_DISABLE_PYTHON
lldb::SBTypeSynthetic
GetTypeSynthetic ();
#endif
lldb::SBValue
GetChildAtIndex (uint32_t idx);

View File

@ -692,9 +692,10 @@ private:
void
LoadSystemFormatters();
#ifndef LLDB_DISABLE_PYTHON
void
LoadObjCFormatters();
#endif
};
} // namespace lldb_private

View File

@ -291,7 +291,9 @@ namespace lldb {
typedef std::tr1::shared_ptr<lldb_private::SyntheticChildren> SyntheticChildrenSP;
typedef std::tr1::shared_ptr<lldb_private::SyntheticChildrenFrontEnd> SyntheticChildrenFrontEndSP;
typedef std::tr1::shared_ptr<lldb_private::TypeFilterImpl> TypeFilterImplSP;
#ifndef LLDB_DISABLE_PYTHON
typedef std::tr1::shared_ptr<lldb_private::TypeSyntheticImpl> TypeSyntheticImplSP;
#endif
typedef std::tr1::shared_ptr<lldb_private::Target> TargetSP;
typedef std::tr1::weak_ptr<lldb_private::Target> TargetWP;
typedef std::tr1::shared_ptr<lldb_private::Thread> ThreadSP;

View File

@ -3133,7 +3133,7 @@
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "xcode_dir=\"${DSTROOT}/Applications/Xcode.app/Contents/Developer/usr/bin\"\n\nif [ ! -d \"${xcode_dir}\" ]; then\n mkdir -p \"${xcode_dir}\"\nfi\n\nditto \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\" \"${xcode_dir}\"\nstrip -S \"${xcode_dir}/${EXECUTABLE_PATH}\"";
shellScript = "xcode_dir=\"${DSTROOT}/Applications/Xcode.app/Contents/Developer/usr/bin\"; if echo \"$SDKROOT\" | grep -vi iphoneos >/dev/null; then [ ! -d \"${xcode_dir}\" ] && mkdir -p \"${xcode_dir}\"; ditto \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\" \"${xcode_dir}\"; strip -S \"${xcode_dir}/${EXECUTABLE_PATH}\"; fi";
};
2613F2F2146880EE00BFE551 /* Copy to Xcode.app */ = {
isa = PBXShellScriptBuildPhase;
@ -3147,7 +3147,7 @@
);
runOnlyForDeploymentPostprocessing = 1;
shellPath = "/bin/sh -x";
shellScript = "xcode_dir=\"${DSTROOT}/Applications/Xcode.app/Contents/SharedFrameworks\"\n\nif [ ! -d \"${xcode_dir}\" ]; then\n mkdir -p \"${xcode_dir}\"\nfi\n\nditto \"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\" \"${xcode_dir}/${WRAPPER_NAME}\"\nstrip -S \"${xcode_dir}/${EXECUTABLE_PATH}\"";
shellScript = "xcode_dir=\"${DSTROOT}/Applications/Xcode.app/Contents/SharedFrameworks\"; if echo \"$SDKROOT\" | grep -vi iphoneos >/dev/null; then [ ! -d \"${xcode_dir}\" ] && mkdir -p \"${xcode_dir}\"; ditto \"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\" \"${xcode_dir}/${WRAPPER_NAME}\"; strip -S \"${xcode_dir}/${EXECUTABLE_PATH}\"; fi";
};
261B5A7511C3FA6F00AABD0A /* Fixup Framework Headers */ = {
isa = PBXShellScriptBuildPhase;

View File

@ -33,6 +33,15 @@ else
Debug=0
fi
# 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
HEADER_FILES="${SRC_ROOT}/include/lldb/lldb.h"\
" ${SRC_ROOT}/include/lldb/lldb-defines.h"\

View File

@ -1135,6 +1135,7 @@ SBDebugger::GetFormatForType (SBTypeNameSpecifier type_name)
return SBTypeFormat();
}
#ifndef LLDB_DISABLE_PYTHON
SBTypeSummary
SBDebugger::GetSummaryForType (SBTypeNameSpecifier type_name)
{
@ -1158,6 +1159,7 @@ SBDebugger::GetSummaryForType (SBTypeNameSpecifier type_name)
}
return summary_chosen;
}
#endif // LLDB_DISABLE_PYTHON
SBTypeFilter
SBDebugger::GetFilterForType (SBTypeNameSpecifier type_name)
@ -1183,6 +1185,7 @@ SBDebugger::GetFilterForType (SBTypeNameSpecifier type_name)
return filter_chosen;
}
#ifndef LLDB_DISABLE_PYTHON
SBTypeSynthetic
SBDebugger::GetSyntheticForType (SBTypeNameSpecifier type_name)
{
@ -1206,6 +1209,7 @@ SBDebugger::GetSyntheticForType (SBTypeNameSpecifier type_name)
}
return synth_chosen;
}
#endif // LLDB_DISABLE_PYTHON
bool
SBDebugger::EnableLog (const char *channel, const char **categories)

View File

@ -980,6 +980,7 @@ SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dyna
Host::SetCrashDescription (NULL);
}
#ifndef LLDB_DISABLE_PYTHON
if (expr_log)
expr_log->Printf("** [SBFrame::EvaluateExpression] Expression result is %s, summary %s **",
expr_result.GetValue(),
@ -991,6 +992,7 @@ SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dyna
expr,
expr_value_sp.get(),
exe_results);
#endif
return expr_result;
}

View File

@ -104,6 +104,7 @@ SBTypeCategory::GetNumFilters ()
return m_opaque_sp->GetFilterNavigator()->GetCount() + m_opaque_sp->GetRegexFilterNavigator()->GetCount();
}
#ifndef LLDB_DISABLE_PYTHON
uint32_t
SBTypeCategory::GetNumSynthetics ()
{
@ -111,6 +112,7 @@ SBTypeCategory::GetNumSynthetics ()
return 0;
return m_opaque_sp->GetSyntheticNavigator()->GetCount() + m_opaque_sp->GetRegexSyntheticNavigator()->GetCount();
}
#endif
lldb::SBTypeNameSpecifier
SBTypeCategory::GetTypeNameSpecifierForFilterAtIndex (uint32_t index)
@ -136,6 +138,7 @@ SBTypeCategory::GetTypeNameSpecifierForSummaryAtIndex (uint32_t index)
return SBTypeNameSpecifier(m_opaque_sp->GetTypeNameSpecifierForSummaryAtIndex(index));
}
#ifndef LLDB_DISABLE_PYTHON
lldb::SBTypeNameSpecifier
SBTypeCategory::GetTypeNameSpecifierForSyntheticAtIndex (uint32_t index)
{
@ -143,6 +146,7 @@ SBTypeCategory::GetTypeNameSpecifierForSyntheticAtIndex (uint32_t index)
return SBTypeNameSpecifier();
return SBTypeNameSpecifier(m_opaque_sp->GetTypeNameSpecifierForSyntheticAtIndex(index));
}
#endif
SBTypeFilter
SBTypeCategory::GetFilterForType (SBTypeNameSpecifier spec)
@ -183,6 +187,7 @@ SBTypeCategory::GetFormatForType (SBTypeNameSpecifier spec)
return SBTypeFormat(DataVisualization::ValueFormats::GetFormat(ConstString(spec.GetName())));
}
#ifndef LLDB_DISABLE_PYTHON
SBTypeSummary
SBTypeCategory::GetSummaryForType (SBTypeNameSpecifier spec)
{
@ -204,7 +209,9 @@ SBTypeCategory::GetSummaryForType (SBTypeNameSpecifier spec)
return lldb::SBTypeSummary(summary_sp);
}
#endif // LLDB_DISABLE_PYTHON
#ifndef LLDB_DISABLE_PYTHON
SBTypeSynthetic
SBTypeCategory::GetSyntheticForType (SBTypeNameSpecifier spec)
{
@ -228,7 +235,9 @@ SBTypeCategory::GetSyntheticForType (SBTypeNameSpecifier spec)
return lldb::SBTypeSynthetic(synth_sp);
}
#endif
#ifndef LLDB_DISABLE_PYTHON
SBTypeFilter
SBTypeCategory::GetFilterAtIndex (uint32_t index)
{
@ -243,6 +252,7 @@ SBTypeCategory::GetFilterAtIndex (uint32_t index)
return lldb::SBTypeFilter(filter_sp);
}
#endif
SBTypeFormat
SBTypeCategory::GetFormatAtIndex (uint32_t index)
@ -252,6 +262,7 @@ SBTypeCategory::GetFormatAtIndex (uint32_t index)
return SBTypeFormat(DataVisualization::ValueFormats::GetFormatAtIndex((index)));
}
#ifndef LLDB_DISABLE_PYTHON
SBTypeSummary
SBTypeCategory::GetSummaryAtIndex (uint32_t index)
{
@ -259,7 +270,9 @@ SBTypeCategory::GetSummaryAtIndex (uint32_t index)
return SBTypeSummary();
return SBTypeSummary(m_opaque_sp->GetSummaryAtIndex((index)));
}
#endif
#ifndef LLDB_DISABLE_PYTHON
SBTypeSynthetic
SBTypeCategory::GetSyntheticAtIndex (uint32_t index)
{
@ -274,6 +287,7 @@ SBTypeCategory::GetSyntheticAtIndex (uint32_t index)
return lldb::SBTypeSynthetic(synth_sp);
}
#endif
bool
SBTypeCategory::AddTypeFormat (SBTypeNameSpecifier type_name,
@ -311,6 +325,7 @@ SBTypeCategory::DeleteTypeFormat (SBTypeNameSpecifier type_name)
return DataVisualization::ValueFormats::Delete(ConstString(type_name.GetName()));
}
#ifndef LLDB_DISABLE_PYTHON
bool
SBTypeCategory::AddTypeSummary (SBTypeNameSpecifier type_name,
SBTypeSummary summary)
@ -365,6 +380,7 @@ SBTypeCategory::AddTypeSummary (SBTypeNameSpecifier type_name,
return true;
}
#endif
bool
SBTypeCategory::DeleteTypeSummary (SBTypeNameSpecifier type_name)
@ -417,6 +433,7 @@ SBTypeCategory::DeleteTypeFilter (SBTypeNameSpecifier type_name)
return m_opaque_sp->GetFilterNavigator()->Delete(ConstString(type_name.GetName()));
}
#ifndef LLDB_DISABLE_PYTHON
bool
SBTypeCategory::AddTypeSynthetic (SBTypeNameSpecifier type_name,
SBTypeSynthetic synth)
@ -486,6 +503,7 @@ SBTypeCategory::DeleteTypeSynthetic (SBTypeNameSpecifier type_name)
else
return m_opaque_sp->GetSyntheticNavigator()->Delete(ConstString(type_name.GetName()));
}
#endif // LLDB_DISABLE_PYTHON
bool
SBTypeCategory::GetDescription (lldb::SBStream &description,

View File

@ -16,6 +16,8 @@
using namespace lldb;
using namespace lldb_private;
#ifndef LLDB_DISABLE_PYTHON
SBTypeSummary::SBTypeSummary() :
m_opaque_sp()
{
@ -296,3 +298,5 @@ SBTypeSummary::ChangeSummaryType (bool want_script)
return true;
}
#endif // LLDB_DISABLE_PYTHON

View File

@ -16,6 +16,8 @@
using namespace lldb;
using namespace lldb_private;
#ifndef LLDB_DISABLE_PYTHON
SBTypeSynthetic::SBTypeSynthetic() :
m_opaque_sp()
{
@ -201,3 +203,5 @@ SBTypeSynthetic::CopyOnWrite_Impl()
return true;
}
#endif // LLDB_DISABLE_PYTHON

View File

@ -310,6 +310,7 @@ SBValue::GetValueDidChange ()
return result;
}
#ifndef LLDB_DISABLE_PYTHON
const char *
SBValue::GetSummary ()
{
@ -334,6 +335,7 @@ SBValue::GetSummary ()
}
return cstr;
}
#endif // LLDB_DISABLE_PYTHON
const char *
SBValue::GetLocation ()
@ -399,6 +401,7 @@ SBValue::GetTypeFormat ()
return format;
}
#ifndef LLDB_DISABLE_PYTHON
lldb::SBTypeSummary
SBValue::GetTypeSummary ()
{
@ -420,6 +423,7 @@ SBValue::GetTypeSummary ()
}
return summary;
}
#endif // LLDB_DISABLE_PYTHON
lldb::SBTypeFilter
SBValue::GetTypeFilter ()
@ -447,6 +451,7 @@ SBValue::GetTypeFilter ()
return filter;
}
#ifndef LLDB_DISABLE_PYTHON
lldb::SBTypeSynthetic
SBValue::GetTypeSynthetic ()
{
@ -472,6 +477,7 @@ SBValue::GetTypeSynthetic ()
}
return synthetic;
}
#endif
lldb::SBValue
SBValue::CreateChildAtOffset (const char *name, uint32_t offset, SBType type)

View File

@ -589,7 +589,9 @@ FormatManager::FormatManager() :
LoadSystemFormatters();
LoadSTLFormatters();
#ifndef LLDB_DISABLE_PYTHON
LoadObjCFormatters();
#endif
EnableCategory(m_objc_category_name,CategoryMap::Last);
//EnableCategory(m_corefoundation_category_name,CategoryMap::Last);
@ -684,6 +686,7 @@ AddSummary(TypeCategoryImpl::SharedPointer category_sp,
summary_sp);
}
#ifndef LLDB_DISABLE_PYTHON
void
FormatManager::LoadObjCFormatters()
{
@ -850,3 +853,4 @@ FormatManager::LoadObjCFormatters()
ConstString("vBool32"),
vector_flags);
}
#endif // LLDB_DISABLE_PYTHON