[Lldb-commits] [lldb] r355575 - Repair the build when LLDB_DISABLE_PYTHON is set

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 6 17:02:56 PST 2019


Author: xiaobai
Date: Wed Mar  6 17:02:55 2019
New Revision: 355575

URL: http://llvm.org/viewvc/llvm-project?rev=355575&view=rev
Log:
Repair the build when LLDB_DISABLE_PYTHON is set

Summary:
If LLDB_DISABLE_PYTHON is set, some functions are unavailable but
SBReproducer assumes they are. Let's conditionally register those functions
since they are conditionally declared.

Differential Revision: https://reviews.llvm.org/D59056

Modified:
    lldb/trunk/source/API/SBReproducer.cpp

Modified: lldb/trunk/source/API/SBReproducer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBReproducer.cpp?rev=355575&r1=355574&r2=355575&view=diff
==============================================================================
--- lldb/trunk/source/API/SBReproducer.cpp (original)
+++ lldb/trunk/source/API/SBReproducer.cpp Wed Mar  6 17:02:55 2019
@@ -818,12 +818,14 @@ SBRegistry::SBRegistry() {
                          ());
     LLDB_REGISTER_METHOD(lldb::SBTypeFormat, SBDebugger, GetFormatForType,
                          (lldb::SBTypeNameSpecifier));
+#ifndef LLDB_DISABLE_PYTHON
     LLDB_REGISTER_METHOD(lldb::SBTypeSummary, SBDebugger, GetSummaryForType,
                          (lldb::SBTypeNameSpecifier));
-    LLDB_REGISTER_METHOD(lldb::SBTypeFilter, SBDebugger, GetFilterForType,
-                         (lldb::SBTypeNameSpecifier));
     LLDB_REGISTER_METHOD(lldb::SBTypeSynthetic, SBDebugger, GetSyntheticForType,
                          (lldb::SBTypeNameSpecifier));
+#endif
+    LLDB_REGISTER_METHOD(lldb::SBTypeFilter, SBDebugger, GetFilterForType,
+                         (lldb::SBTypeNameSpecifier));
     LLDB_REGISTER_METHOD(bool, SBDebugger, EnableLog,
                          (const char *, const char **));
   }
@@ -2436,47 +2438,49 @@ SBRegistry::SBRegistry() {
     LLDB_REGISTER_METHOD(uint32_t, SBTypeCategory, GetNumFormats, ());
     LLDB_REGISTER_METHOD(uint32_t, SBTypeCategory, GetNumSummaries, ());
     LLDB_REGISTER_METHOD(uint32_t, SBTypeCategory, GetNumFilters, ());
+#ifndef LLDB_DISABLE_PYTHON
     LLDB_REGISTER_METHOD(uint32_t, SBTypeCategory, GetNumSynthetics, ());
     LLDB_REGISTER_METHOD(lldb::SBTypeNameSpecifier, SBTypeCategory,
-                         GetTypeNameSpecifierForFilterAtIndex, (uint32_t));
-    LLDB_REGISTER_METHOD(lldb::SBTypeNameSpecifier, SBTypeCategory,
-                         GetTypeNameSpecifierForFormatAtIndex, (uint32_t));
-    LLDB_REGISTER_METHOD(lldb::SBTypeNameSpecifier, SBTypeCategory,
-                         GetTypeNameSpecifierForSummaryAtIndex, (uint32_t));
-    LLDB_REGISTER_METHOD(lldb::SBTypeNameSpecifier, SBTypeCategory,
                          GetTypeNameSpecifierForSyntheticAtIndex, (uint32_t));
-    LLDB_REGISTER_METHOD(lldb::SBTypeFilter, SBTypeCategory, GetFilterForType,
-                         (lldb::SBTypeNameSpecifier));
-    LLDB_REGISTER_METHOD(lldb::SBTypeFormat, SBTypeCategory, GetFormatForType,
-                         (lldb::SBTypeNameSpecifier));
     LLDB_REGISTER_METHOD(lldb::SBTypeSummary, SBTypeCategory, GetSummaryForType,
                          (lldb::SBTypeNameSpecifier));
     LLDB_REGISTER_METHOD(lldb::SBTypeSynthetic, SBTypeCategory,
                          GetSyntheticForType, (lldb::SBTypeNameSpecifier));
     LLDB_REGISTER_METHOD(lldb::SBTypeFilter, SBTypeCategory, GetFilterAtIndex,
                          (uint32_t));
-    LLDB_REGISTER_METHOD(lldb::SBTypeFormat, SBTypeCategory, GetFormatAtIndex,
-                         (uint32_t));
     LLDB_REGISTER_METHOD(lldb::SBTypeSummary, SBTypeCategory, GetSummaryAtIndex,
                          (uint32_t));
     LLDB_REGISTER_METHOD(lldb::SBTypeSynthetic, SBTypeCategory,
                          GetSyntheticAtIndex, (uint32_t));
+    LLDB_REGISTER_METHOD(bool, SBTypeCategory, AddTypeSummary,
+                         (lldb::SBTypeNameSpecifier, lldb::SBTypeSummary));
+    LLDB_REGISTER_METHOD(bool, SBTypeCategory, AddTypeSynthetic,
+                         (lldb::SBTypeNameSpecifier, lldb::SBTypeSynthetic));
+    LLDB_REGISTER_METHOD(bool, SBTypeCategory, DeleteTypeSynthetic,
+                         (lldb::SBTypeNameSpecifier));
+#endif
+    LLDB_REGISTER_METHOD(lldb::SBTypeNameSpecifier, SBTypeCategory,
+                         GetTypeNameSpecifierForFilterAtIndex, (uint32_t));
+    LLDB_REGISTER_METHOD(lldb::SBTypeNameSpecifier, SBTypeCategory,
+                         GetTypeNameSpecifierForFormatAtIndex, (uint32_t));
+    LLDB_REGISTER_METHOD(lldb::SBTypeNameSpecifier, SBTypeCategory,
+                         GetTypeNameSpecifierForSummaryAtIndex, (uint32_t));
+    LLDB_REGISTER_METHOD(lldb::SBTypeFilter, SBTypeCategory, GetFilterForType,
+                         (lldb::SBTypeNameSpecifier));
+    LLDB_REGISTER_METHOD(lldb::SBTypeFormat, SBTypeCategory, GetFormatForType,
+                         (lldb::SBTypeNameSpecifier));
+    LLDB_REGISTER_METHOD(lldb::SBTypeFormat, SBTypeCategory, GetFormatAtIndex,
+                         (uint32_t));
     LLDB_REGISTER_METHOD(bool, SBTypeCategory, AddTypeFormat,
                          (lldb::SBTypeNameSpecifier, lldb::SBTypeFormat));
     LLDB_REGISTER_METHOD(bool, SBTypeCategory, DeleteTypeFormat,
                          (lldb::SBTypeNameSpecifier));
-    LLDB_REGISTER_METHOD(bool, SBTypeCategory, AddTypeSummary,
-                         (lldb::SBTypeNameSpecifier, lldb::SBTypeSummary));
     LLDB_REGISTER_METHOD(bool, SBTypeCategory, DeleteTypeSummary,
                          (lldb::SBTypeNameSpecifier));
     LLDB_REGISTER_METHOD(bool, SBTypeCategory, AddTypeFilter,
                          (lldb::SBTypeNameSpecifier, lldb::SBTypeFilter));
     LLDB_REGISTER_METHOD(bool, SBTypeCategory, DeleteTypeFilter,
                          (lldb::SBTypeNameSpecifier));
-    LLDB_REGISTER_METHOD(bool, SBTypeCategory, AddTypeSynthetic,
-                         (lldb::SBTypeNameSpecifier, lldb::SBTypeSynthetic));
-    LLDB_REGISTER_METHOD(bool, SBTypeCategory, DeleteTypeSynthetic,
-                         (lldb::SBTypeNameSpecifier));
     LLDB_REGISTER_METHOD(bool, SBTypeCategory, GetDescription,
                          (lldb::SBStream &, lldb::DescriptionLevel));
     LLDB_REGISTER_METHOD(
@@ -2628,6 +2632,7 @@ SBRegistry::SBRegistry() {
     LLDB_REGISTER_METHOD(bool,
                          SBTypeSummary, operator!=,(lldb::SBTypeSummary &));
   }
+#ifndef LLDB_DISABLE_PYTHON
   {
     LLDB_REGISTER_CONSTRUCTOR(SBTypeSynthetic, ());
     LLDB_REGISTER_STATIC_METHOD(lldb::SBTypeSynthetic, SBTypeSynthetic,
@@ -2655,6 +2660,7 @@ SBRegistry::SBRegistry() {
     LLDB_REGISTER_METHOD(bool,
                          SBTypeSynthetic, operator!=,(lldb::SBTypeSynthetic &));
   }
+#endif
   {
     LLDB_REGISTER_CONSTRUCTOR(SBUnixSignals, ());
     LLDB_REGISTER_CONSTRUCTOR(SBUnixSignals, (const lldb::SBUnixSignals &));
@@ -2710,7 +2716,9 @@ SBRegistry::SBRegistry() {
     LLDB_REGISTER_METHOD(lldb::SBTypeFormat, SBValue, GetTypeFormat, ());
     LLDB_REGISTER_METHOD(lldb::SBTypeSummary, SBValue, GetTypeSummary, ());
     LLDB_REGISTER_METHOD(lldb::SBTypeFilter, SBValue, GetTypeFilter, ());
+#ifndef LLDB_DISABLE_PYTHON
     LLDB_REGISTER_METHOD(lldb::SBTypeSynthetic, SBValue, GetTypeSynthetic, ());
+#endif
     LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, CreateChildAtOffset,
                          (const char *, uint32_t, lldb::SBType));
     LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, Cast, (lldb::SBType));




More information about the lldb-commits mailing list