diff --git a/lldb/include/lldb/API/SBDebugger.h b/lldb/include/lldb/API/SBDebugger.h index cf9dc59ec7cb..708ad4bd36e9 100644 --- a/lldb/include/lldb/API/SBDebugger.h +++ b/lldb/include/lldb/API/SBDebugger.h @@ -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: diff --git a/lldb/include/lldb/API/SBDefines.h b/lldb/include/lldb/API/SBDefines.h index 82f34e0c17ed..82805d09568a 100644 --- a/lldb/include/lldb/API/SBDefines.h +++ b/lldb/include/lldb/API/SBDefines.h @@ -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; diff --git a/lldb/include/lldb/API/SBTypeCategory.h b/lldb/include/lldb/API/SBTypeCategory.h index cde5a2d02a98..f123e931e17d 100644 --- a/lldb/include/lldb/API/SBTypeCategory.h +++ b/lldb/include/lldb/API/SBTypeCategory.h @@ -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); diff --git a/lldb/include/lldb/API/SBTypeSummary.h b/lldb/include/lldb/API/SBTypeSummary.h index 47e04645e4c2..67a8607511cc 100644 --- a/lldb/include/lldb/API/SBTypeSummary.h +++ b/lldb/include/lldb/API/SBTypeSummary.h @@ -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_ diff --git a/lldb/include/lldb/API/SBTypeSynthetic.h b/lldb/include/lldb/API/SBTypeSynthetic.h index 742b9f843242..d5ba4f2134d3 100644 --- a/lldb/include/lldb/API/SBTypeSynthetic.h +++ b/lldb/include/lldb/API/SBTypeSynthetic.h @@ -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_ diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index 53fea356701c..249554340cd1 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -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); diff --git a/lldb/include/lldb/Core/FormatManager.h b/lldb/include/lldb/Core/FormatManager.h index 7f88d5fc17c7..b3578f8352d5 100644 --- a/lldb/include/lldb/Core/FormatManager.h +++ b/lldb/include/lldb/Core/FormatManager.h @@ -692,9 +692,10 @@ private: void LoadSystemFormatters(); +#ifndef LLDB_DISABLE_PYTHON void LoadObjCFormatters(); - +#endif }; } // namespace lldb_private diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h index 97ca12fb574d..49f7b642044e 100644 --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -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; diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index bd1c32be2426..bcd4a15e7956 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -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; diff --git a/lldb/scripts/Python/build-swig-Python.sh b/lldb/scripts/Python/build-swig-Python.sh index 5fcbe7a81f2e..76c538397240 100755 --- a/lldb/scripts/Python/build-swig-Python.sh +++ b/lldb/scripts/Python/build-swig-Python.sh @@ -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"\ diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index 8150cb04b933..6628c1aa1f59 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -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) diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index eaf4f8a01ca3..8931e70581ca 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -979,7 +979,8 @@ SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dyna expr_result.SetSP(expr_value_sp); 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; } diff --git a/lldb/source/API/SBTypeCategory.cpp b/lldb/source/API/SBTypeCategory.cpp index b76f84445873..1543b5efe815 100644 --- a/lldb/source/API/SBTypeCategory.cpp +++ b/lldb/source/API/SBTypeCategory.cpp @@ -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, diff --git a/lldb/source/API/SBTypeSummary.cpp b/lldb/source/API/SBTypeSummary.cpp index 5edff66e660a..86cb89b40b30 100644 --- a/lldb/source/API/SBTypeSummary.cpp +++ b/lldb/source/API/SBTypeSummary.cpp @@ -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 diff --git a/lldb/source/API/SBTypeSynthetic.cpp b/lldb/source/API/SBTypeSynthetic.cpp index 66e2d8b68b37..647f2d89bd93 100644 --- a/lldb/source/API/SBTypeSynthetic.cpp +++ b/lldb/source/API/SBTypeSynthetic.cpp @@ -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 diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index d4d2c06a4480..9818eb35e8bd 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -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) diff --git a/lldb/source/Core/FormatManager.cpp b/lldb/source/Core/FormatManager.cpp index 382af8677105..df2a81243b2e 100644 --- a/lldb/source/Core/FormatManager.cpp +++ b/lldb/source/Core/FormatManager.cpp @@ -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