[Lldb-commits] [lldb] r157665 - in /lldb/branches/apple/python-GIL: ./ include/lldb/Core/ lib/ scripts/ source/ source/API/ source/Commands/ source/Core/ source/Expression/ source/Interpreter/ source/Plugins/Platform/MacOSX/ test/ test/functionalities/register/ tools/debugserver/scripts/ tools/driver/ tools/lldb-platform/

Filipe Cabecinhas me at filcab.net
Tue May 29 17:52:41 PDT 2012


Author: filcab
Date: Tue May 29 19:52:41 2012
New Revision: 157665

URL: http://llvm.org/viewvc/llvm-project?rev=157665&view=rev
Log:
Merge changes from ToT trunk.

Modified:
    lldb/branches/apple/python-GIL/   (props changed)
    lldb/branches/apple/python-GIL/include/lldb/Core/StreamString.h
    lldb/branches/apple/python-GIL/lib/Makefile
    lldb/branches/apple/python-GIL/scripts/disasm-gdb-remote.pl
    lldb/branches/apple/python-GIL/source/API/SBFrame.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp
    lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp
    lldb/branches/apple/python-GIL/source/Core/StreamString.cpp
    lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp
    lldb/branches/apple/python-GIL/source/Interpreter/CommandObject.cpp
    lldb/branches/apple/python-GIL/source/Interpreter/Makefile
    lldb/branches/apple/python-GIL/source/Makefile
    lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/branches/apple/python-GIL/test/Makefile
    lldb/branches/apple/python-GIL/test/functionalities/register/TestRegisters.py
    lldb/branches/apple/python-GIL/tools/debugserver/scripts/dbgnub-config.pl
    lldb/branches/apple/python-GIL/tools/driver/Makefile
    lldb/branches/apple/python-GIL/tools/lldb-platform/Makefile

Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 29 19:52:41 2012
@@ -1 +1 @@
-/lldb/trunk:156467-157562
+/lldb/trunk:156467-157664

Modified: lldb/branches/apple/python-GIL/include/lldb/Core/StreamString.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/StreamString.h?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/StreamString.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/StreamString.h Tue May 29 19:52:41 2012
@@ -37,6 +37,9 @@
     void
     Clear();
 
+    bool
+    Empty() const;
+
     const char *
     GetData () const;
 

Modified: lldb/branches/apple/python-GIL/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lib/Makefile?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lib/Makefile (original)
+++ lldb/branches/apple/python-GIL/lib/Makefile Tue May 29 19:52:41 2012
@@ -12,14 +12,14 @@
 
 LIBRARYNAME = lldb
 
-#EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/../resources/lldb-framework-exports
+#EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports
 NO_BUILD_ARCHIVE = 1
 LINK_LIBS_IN_SHARED = 1
 SHARED_LIBRARY = 1
 
 PYTHON_BUILD_FLAGS = $(shell python-config --ldflags)
 
-# Include all archives in liblldb.a files
+# Include all archives in liblldb.so file
 USEDLIBS = lldbAPI.a \
 	lldbBreakpoint.a \
 	lldbCommands.a \
@@ -33,6 +33,7 @@
 	lldbPluginABISysV_x86_64.a \
 	lldbPluginDisassemblerLLVM.a \
 	lldbPluginDynamicLoaderStatic.a \
+	lldbPluginDynamicLoaderPOSIX.a \
 	lldbPluginEmulateInstructionARM.a \
 	lldbPluginLanguageRuntimeCPlusPlusItaniumABI.a \
 	lldbPluginLanguageRuntimeObjCAppleObjCRuntime.a \
@@ -87,13 +88,11 @@
 ifeq ($(HOST_OS),Linux)
   USEDLIBS += lldbPluginProcessPOSIX.a \
               lldbPluginProcessLinux.a \
-              lldbPluginDynamicLoaderPOSIX.a \
               lldbHostLinux.a
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
   USEDLIBS += lldbHostFreeBSD.a \
-              lldbPluginDynamicLoaderPOSIX.a \
               lldbPluginProcessPOSIX.a \
               lldbPluginProcessFreeBSD.a
 endif
@@ -113,7 +112,9 @@
 	LLVMLibsOptions += -framework Foundation -framework CoreFoundation
 	LLVMLibsOptions += -framework CoreServices -framework Carbon -framework Security
 	LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc
-	LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports" 
+	ifneq ($(EXPORTED_SYMBOL_FILE),)
+		LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(EXPORTED_SYMBOL_FILE)"
+	endif
     # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
     DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
     ifneq ($(DARWIN_VERS),8)
@@ -129,7 +130,7 @@
     # Don't allow unresolved symbols.
     LLVMLibsOptions += -Wl,--no-undefined
     # Link in python
-    LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt
+    LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
@@ -139,5 +140,5 @@
     # Allow unresolved symbols.
     LLVMLibsOptions += -Wl,--allow-shlib-undefined
     # Link in python
-    LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo
+    LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo
 endif

Modified: lldb/branches/apple/python-GIL/scripts/disasm-gdb-remote.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/disasm-gdb-remote.pl?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/disasm-gdb-remote.pl (original)
+++ lldb/branches/apple/python-GIL/scripts/disasm-gdb-remote.pl Tue May 29 19:52:41 2012
@@ -554,6 +554,7 @@
     if ($reg_num >= @$registers_aref)
     {
         printf("\tinvalid register index %d\n", $reg_num);
+        return;
     }
     
     my $reg_href = $$registers_aref[$reg_num];

Modified: lldb/branches/apple/python-GIL/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBFrame.cpp?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBFrame.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBFrame.cpp Tue May 29 19:52:41 2012
@@ -1055,12 +1055,12 @@
         Process::StopLocker stop_locker;
         if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
         {
+#ifdef LLDB_CONFIGURATION_DEBUG
             StreamString frame_description;
             frame->DumpUsingSettingsFormat (&frame_description);
-
             Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
                                                  expr, fetch_dynamic_value, frame_description.GetString().c_str());
-
+#endif
             const bool coerce_to_id = false;
             const bool keep_in_memory = false;
 
@@ -1073,7 +1073,9 @@
                                                       fetch_dynamic_value, 
                                                       expr_value_sp);
             expr_result.SetSP(expr_value_sp);
+#ifdef LLDB_CONFIGURATION_DEBUG
             Host::SetCrashDescription (NULL);
+#endif
         }
         else
         {

Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectRegister.cpp Tue May 29 19:52:41 2012
@@ -124,7 +124,8 @@
     DumpRegisterSet (const ExecutionContext &exe_ctx,
                      Stream &strm,
                      RegisterContext *reg_ctx,
-                     uint32_t set_idx)
+                     uint32_t set_idx,
+                     bool primitive_only=false)
     {
         uint32_t unavailable_count = 0;
         uint32_t available_count = 0;
@@ -137,7 +138,11 @@
             for (uint32_t reg_idx = 0; reg_idx < num_registers; ++reg_idx)
             {
                 const uint32_t reg = reg_set->registers[reg_idx];
-                if (DumpRegister (exe_ctx, strm, reg_ctx, reg_ctx->GetRegisterInfoAtIndex(reg)))
+                const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg);
+                // Skip the dumping of derived register if primitive_only is true.
+                if (primitive_only && reg_info && reg_info->value_regs)
+                    continue;
+                if (DumpRegister (exe_ctx, strm, reg_ctx, reg_info))
                     ++available_count;
                 else
                     ++unavailable_count;
@@ -202,7 +207,8 @@
 
                     for (set_idx = 0; set_idx < num_register_sets; ++set_idx)
                     {
-                        DumpRegisterSet (exe_ctx, strm, reg_ctx, set_idx);
+                        // When dump_all_sets option is set, dump primitive as well as derived registers.
+                        DumpRegisterSet (exe_ctx, strm, reg_ctx, set_idx, !m_command_options.dump_all_sets.GetCurrentValue());
                     }
                 }
             }

Modified: lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp Tue May 29 19:52:41 2012
@@ -305,7 +305,9 @@
     bool
     SearchFilterForNonModuleSpecificSearches::ModulePasses (const lldb::ModuleSP &module_sp)
     {
-        if (m_target_sp->ModuleIsExcludedForNonModuleSpecificSearches (module_sp))
+        if (!module_sp)
+            return true;
+        else if (m_target_sp->ModuleIsExcludedForNonModuleSpecificSearches (module_sp))
             return false;
         else
             return true;

Modified: lldb/branches/apple/python-GIL/source/Core/StreamString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/StreamString.cpp?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/StreamString.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/StreamString.cpp Tue May 29 19:52:41 2012
@@ -47,6 +47,12 @@
     m_packet.clear();
 }
 
+bool
+StreamString::Empty() const
+{
+    return GetSize() == 0;
+}
+
 const char *
 StreamString::GetData () const
 {

Modified: lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp Tue May 29 19:52:41 2012
@@ -611,22 +611,28 @@
         return false;
     }
 
-    ValidPointerChecker vpc(M, m_checker_functions);
-    
-    if (!vpc.Inspect(*function))
-        return false;
-    
-    if (!vpc.Instrument())
-        return false;
-    
-    ObjcObjectChecker ooc(M, m_checker_functions);
-    
-    if (!ooc.Inspect(*function))
-        return false;
+    if (m_checker_functions.m_valid_pointer_check.get())
+    {
+        ValidPointerChecker vpc(M, m_checker_functions);
+        
+        if (!vpc.Inspect(*function))
+            return false;
+        
+        if (!vpc.Instrument())
+            return false;
+    }
     
-    if (!ooc.Instrument())
-        return false;
-
+    if (m_checker_functions.m_objc_object_check.get())
+    {
+        ObjcObjectChecker ooc(M, m_checker_functions);
+        
+        if (!ooc.Inspect(*function))
+            return false;
+        
+        if (!ooc.Instrument())
+            return false;
+    }
+        
     if (log && log->GetVerbose())
     {
         std::string s;

Modified: lldb/branches/apple/python-GIL/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/CommandObject.cpp?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/CommandObject.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/CommandObject.cpp Tue May 29 19:52:41 2012
@@ -850,12 +850,12 @@
 const char *arch_helper()
 {
     static StreamString g_archs_help;
-    if (g_archs_help.GetData() == NULL)
+    if (g_archs_help.Empty())
     {
         StringList archs;
         ArchSpec::AutoComplete(NULL, archs);
         g_archs_help.Printf("These are the supported architecture names:\n");
-        archs.Join("%s\n", g_archs_help);
+        archs.Join("\n", g_archs_help);
     }
     return g_archs_help.GetData();
 }

Modified: lldb/branches/apple/python-GIL/source/Interpreter/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/Makefile?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/Makefile (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/Makefile Tue May 29 19:52:41 2012
@@ -16,16 +16,96 @@
 include $(LLDB_LEVEL)/Makefile
 -include $(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.d
 
-PYTHON_DIR := $(ToolDir)
+PYTHON_DIR := $(LibDir)/python/lldb
 ifeq ($(HOST_OS),Darwin)
-PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,/Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages)
+PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,/Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages)/lldb
 else
-PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,$(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages)
+PYTHON_DEST_DIR := $(DESTDIR)/$(call realpath,$(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages)/lldb
 endif
 LLDB_SWIG_INCLUDE_DIRS:= -I"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include" -I./.
 LIBLLDB := $(LibDir)/liblldb$(SHLIBEXT)
 INST_LIBLLDB := $(PROJ_libdir)/liblldb$(SHLIBEXT)
 
+# Subpackages of the main LLDB package
+LLDB_SUBPACKAGES := FORMATTERS FORMATTERS_CPP FORMATTERS_OBJC RUNTIME RUNTIME_OBJC UTILS
+# lldb.formatters
+LLDB_PACKAGE_FORMATTERS := formatters
+LLDB_PACKAGE_FORMATTERS_FILES := $(addprefix \
+  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/, \
+  cache.py metrics.py attrib_fromdict.py Logger.py)
+# lldb.formatters.cpp
+LLDB_PACKAGE_FORMATTERS_CPP := formatters/cpp
+LLDB_PACKAGE_FORMATTERS_CPP_FILES := $(addprefix \
+  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/synthetic/,gnu_libstdcpp.py libcxx.py)
+# lldb.formatters.objc
+LLDB_PACKAGE_FORMATTERS_OBJC := formatters/objc
+LLDB_PACKAGE_FORMATTERS_OBJC_FILES := \
+  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/Selector.py \
+  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/objc.py \
+  $(addprefix $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/, \
+    Class.py CFArray.py CFBag.py CFBinaryHeap.py CFBitVector.py \
+    CFDictionary.py CFString.py NSBundle.py NSData.py NSDate.py \
+    NSException.py NSIndexSet.py NSMachPort.py NSNotification.py \
+    NSNumber.py NSSet.py NSURL.py \
+  )
+# lldb.runtime
+LLDB_PACKAGE_RUNTIME := runtime
+LLDB_PACKAGE_RUNTIME_FILES :=
+# lldb.runtime.objc
+LLDB_PACKAGE_RUNTIME_OBJC := runtime/objc
+LLDB_PACKAGE_RUNTIME_OBJC_FILES := \
+  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/summaries/cocoa/objc_runtime.py
+# lldb.utils
+LLDB_PACKAGE_UTILS := utils
+LLDB_PACKAGE_UTILS_FILES := \
+  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/python/symbolication.py
+
+ifeq ($(HOST_OS),Darwin)
+# Additional packages for Darwin/Mac OS X
+LLDB_SUBPACKAGES += MACOSX
+# lldb.macosx
+LLDB_PACKAGE_MACOSX := macosx
+LLDB_PACKAGE_MACOSX_FILES := $(addprefix \
+  $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/, python/crashlog.py darwin/heap_find/heap.py \
+)
+endif
+
+LLDB_ALL_SUBPACKAGE_FILES := $(foreach subpackage,$(LLDB_SUBPACKAGES),$(LLDB_PACKAGE_$(subpackage)_FILES))
+LLDB_ALL_INSTALLED_SUBPACKAGE_FILES := $(foreach subpackage,$(LLDB_SUBPACKAGES),$(addprefix $(LLDB_PACKAGE_$(subpackage))/,$(notdir $(LLDB_PACKAGE_$(subpackage)_FILES))))
+
+comma := ,
+LLDB_COPY_PACKAGE = $(Verb) \
+$(foreach subpackage,$(LLDB_SUBPACKAGES), \
+  init_file="$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py"; \
+  $(MKDIR) "$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))"; \
+  $(foreach file,$(LLDB_PACKAGE_$(subpackage)_FILES), \
+    $(CP) "$(file)" "$(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))"; \
+  ) \
+  echo "__all__ = [$(patsubst %,\"%\"$(comma),\
+    $(basename $(notdir $(LLDB_PACKAGE_$(subpackage)_FILES))))]" >$$init_file; \
+  echo "for x in __all__:" >>$$init_file; \
+  echo "    __import__('lldb.$(subst /,.,$(LLDB_PACKAGE_$(subpackage))).'+x)" >>$$init_file; \
+)
+
+LLDB_INSTALL_SUBPACKAGES = $(Verb) \
+$(foreach subpackage,$(LLDB_SUBPACKAGES), \
+  $(MKDIR) $(PYTHON_DEST_DIR)/$(LLDB_PACKAGE_$(subpackage)); \
+  $(DataInstall) $(PYTHON_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py \
+                 $(PYTHON_DEST_DIR)/$(LLDB_PACKAGE_$(subpackage))/__init__.py; \
+) \
+$(foreach file,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES), \
+  $(DataInstall) $(PYTHON_DIR)/$(file) $(PYTHON_DEST_DIR)/$(file); \
+)
+
+ifeq ($(HOST_OS),Darwin)
+# Install the heap_find sources, too.
+LLDB_INSTALL_SUBPACKAGES += $(MKDIR) $(PYTHON_DEST_DIR)/macosx/heap/; \
+$(DataInstall) $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/darwin/heap_find/heap/heap_find.cpp \
+               $(PYTHON_DEST_DIR)/macosx/heap/heap_find.cpp; \
+$(DataInstall) $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/examples/darwin/heap_find/heap/Makefile \
+			   $(PYTHON_DEST_DIR)/macosx/heap/Makefile;
+endif
+
 # We need Swig to process stdint.h, but by default it will not inspect system
 # include directories.  The following should cover the standard locations on
 # most platforms.
@@ -39,6 +119,8 @@
 LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include/gcc/darwin/4.2"
 endif
 
+ifndef DISABLE_AUTO_DEPENDENCIES
+
 SWIG_DEPEND_OPTIONS = -MMD -MF "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp"
 CPP_DEPEND_MOVEFILE = then $(MV) -f "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp" "$(PROJ_OBJ_DIR)/$*.cpp.d"; \
                       else $(RM) -f "$(PROJ_OBJ_DIR)/$*.cpp.d.tmp"; exit 1; fi
@@ -46,6 +128,7 @@
 LLDBWrapPython.cpp: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py \
                     $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py
 	$(Echo) Generating LLDBWrapPython.cpp
+	$(Verb) $(MKDIR) $(PYTHON_DIR)
 	$(Verb) if swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
           -D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)"   \
           $(SWIG_DEPEND_OPTIONS) \
@@ -56,20 +139,49 @@
 	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \
 		  "$(PROJ_OBJ_DIR)"
 	$(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \
-		  mv "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
-			 "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
-	$(Verb) cp "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
+		  $(MV) "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
+				"$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
+	$(Verb) $(MV) "$(PYTHON_DIR)/lldb.py" "$(PYTHON_DIR)/__init__.py"
+	$(Verb) $(CP) "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
+	$(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so
+	$(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so
+	$(LLDB_COPY_PACKAGE)
+
+else
+
+LLDBWrapPython.cpp: $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py \
+                    $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py
+	$(Echo) Generating LLDBWrapPython.cpp
+	$(Verb) $(MKDIR) $(PYTHON_DIR)
+	$(Verb) swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
+          -D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)"   \
+          -o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig"
+	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py" \
+		  "$(PYTHON_DIR)"
+	$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \
+		  "$(PROJ_OBJ_DIR)"
+	$(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \
+		  $(MV) "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
+				"$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
+	$(Verb) $(MV) "$(PYTHON_DIR)/lldb.py" "$(PYTHON_DIR)/__init__.py"
+	$(Verb) $(CP) "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
 	$(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so
 	$(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so
+	$(LLDB_COPY_PACKAGE)
+
+endif
 
-install-local:: $(PYTHON_DIR)/lldb.py $(PYTHON_DIR)/embedded_interpreter.py
+install-local:: $(PYTHON_DIR)/__init__.py $(PYTHON_DIR)/embedded_interpreter.py \
+                $(addprefix $(PYTHON_DIR)/,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES))
 	$(Echo) Installing $(BuildMode) LLDB python modules
-	$(Verb) $(MKDIR) $(PYTHON_DEST_DIR)/lib-dynload
-	$(Verb) $(DataInstall) $(PYTHON_DIR)/lldb.py $(PYTHON_DEST_DIR)/lldb.py
+	$(Verb) $(MKDIR) $(PYTHON_DEST_DIR)
+	$(Verb) $(DataInstall) $(PYTHON_DIR)/__init__.py $(PYTHON_DEST_DIR)/__init__.py
 	$(Verb) $(DataInstall) $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DEST_DIR)/embedded_interpreter.py
-	$(Verb) $(RM) -f $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so
-	$(Verb) $(AliasTool) $(INST_LIBLLDB) $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so
+	$(Verb) $(RM) -f $(PYTHON_DEST_DIR)/_lldb.so
+	$(Verb) $(AliasTool) $(INST_LIBLLDB) $(PYTHON_DEST_DIR)/_lldb.so
+	$(LLDB_INSTALL_SUBPACKAGES)
 
 clean-local::
 	$(Verb) $(RM) -f LLDBWrapPython.cpp $(PYTHON_DIR)/_lldb.so \
-	          $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DIR)/lldb.py
+	          $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DIR)/__init__.py \
+			  $(addprefix $(PYTHON_DIR)/,$(LLDB_ALL_INSTALLED_SUBPACKAGE_FILES))

Modified: lldb/branches/apple/python-GIL/source/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Makefile?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Makefile (original)
+++ lldb/branches/apple/python-GIL/source/Makefile Tue May 29 19:52:41 2012
@@ -13,6 +13,7 @@
 BUILD_ARCHIVE = 1
 
 BUILT_SOURCES = LLDB_vers.c
+SOURCES := lldb-log.cpp lldb.cpp
 
 include $(LLDB_LEVEL)/Makefile
 

Modified: lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Tue May 29 19:52:41 2012
@@ -563,6 +563,9 @@
 bool
 PlatformDarwin::ModuleIsExcludedForNonModuleSpecificSearches (lldb_private::Target &target, const lldb::ModuleSP &module_sp)
 {
+    if (!module_sp)
+        return false;
+        
     ObjectFile *obj_file = module_sp->GetObjectFile();
     if (!obj_file)
         return false;

Modified: lldb/branches/apple/python-GIL/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/Makefile?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/Makefile (original)
+++ lldb/branches/apple/python-GIL/test/Makefile Tue May 29 19:52:41 2012
@@ -31,7 +31,8 @@
 check-local::
 	rm -rf ../test-rdir
 	env PATH="$(ToolDir):$(PATH)" \
-	    PYTHONPATH=$(ToolDir) \
+	    PYTHONPATH=$(LibDir)/python \
 	    LLDB_EXEC=$(ToolDir)/lldb \
+		LLDB_BUILD_TYPE=Makefile \
 	    $(SHLIBPATH_VAR)=$(LibDir):$($(SHLIBPATH_VAR)) \
 	     python $(PROJ_SRC_DIR)/dotest.py -i -v -r ../test-rdir

Modified: lldb/branches/apple/python-GIL/test/functionalities/register/TestRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/register/TestRegisters.py?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/register/TestRegisters.py (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/register/TestRegisters.py Tue May 29 19:52:41 2012
@@ -71,6 +71,13 @@
         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
             substrs = ['stopped', 'stop reason = breakpoint'])
 
+        # The vanilla "register read" command does not output derived register like eax.
+        self.expect("register read", matching=False,
+            substrs = ['eax'])
+        # While "register read -a" does output derived register like eax.
+        self.expect("register read -a", matching=True,
+            substrs = ['eax'])
+        
         # Test reading of rax and eax.
         self.runCmd("register read rax eax")
 

Modified: lldb/branches/apple/python-GIL/tools/debugserver/scripts/dbgnub-config.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/scripts/dbgnub-config.pl?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/scripts/dbgnub-config.pl (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/scripts/dbgnub-config.pl Tue May 29 19:52:41 2012
@@ -33,6 +33,7 @@
 my $val;
 while (($key, $val) = each %ENV) 
 {
+	$val =~ s/\n/\n\/\/	/;
 	printf CONFIG "//	%s = %s\n", $key, $val;
 }
 print CONFIG "//" . "-" x 72 . "\n";

Modified: lldb/branches/apple/python-GIL/tools/driver/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/driver/Makefile?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/driver/Makefile (original)
+++ lldb/branches/apple/python-GIL/tools/driver/Makefile Tue May 29 19:52:41 2012
@@ -10,21 +10,21 @@
 
 TOOLNAME = lldb
 
-LD.Flags += -ledit -llldb -llldbUtility
+LLVMLibsOptions += -ledit -llldb -llldbUtility
 
 include $(LLDB_LEVEL)/Makefile
 
 ifeq ($(HOST_OS),Darwin)
-	LD.Flags += -Wl,-rpath, at loader_path/../lib/
-	LD.Flags += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist -Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
+	LLVMLibsOptions += -Wl,-rpath, at loader_path/../lib/
+	LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist -Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
 ifeq ($(HOST_OS),Linux)
-	LD.Flags += -Wl,-rpath,$(LibDir)
+	LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
 	CPP.Flags += -I/usr/include/edit #-v
-	LD.Flags += -Wl,-rpath,$(LibDir)
+	LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
 

Modified: lldb/branches/apple/python-GIL/tools/lldb-platform/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/lldb-platform/Makefile?rev=157665&r1=157664&r2=157665&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/lldb-platform/Makefile (original)
+++ lldb/branches/apple/python-GIL/tools/lldb-platform/Makefile Tue May 29 19:52:41 2012
@@ -10,14 +10,14 @@
 
 TOOLNAME = lldb-platform
 
-LD.Flags += -llldb -llldbUtility
+LLVMLibsOptions += -llldb -llldbUtility
 
 include $(LLDB_LEVEL)/Makefile
 
 ifeq ($(HOST_OS),Darwin)
-	LD.Flags += -Wl,-rpath, at loader_path/../lib/
+	LLVMLibsOptions += -Wl,-rpath, at loader_path/../lib/
 endif
 
 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD))
-	LD.Flags += -Wl,-rpath,$(LibDir)
+	LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif





More information about the lldb-commits mailing list