[Lldb-commits] [lldb] r157409 - in /lldb/branches/lldb-platform-work: ./ include/lldb/Target/Process.h lldb.xcodeproj/project.pbxproj scripts/Python/build-swig-Python.sh scripts/Python/finish-swig-Python-LLDB.sh source/Commands/CommandObjectProcess.cpp test/functionalities/completion/TestCompletion.py

Johnny Chen johnny.chen at apple.com
Thu May 24 11:35:12 PDT 2012


Author: johnny
Date: Thu May 24 13:35:11 2012
New Revision: 157409

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

Modified:
    lldb/branches/lldb-platform-work/   (props changed)
    lldb/branches/lldb-platform-work/include/lldb/Target/Process.h
    lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj
    lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh
    lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp
    lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py

Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 24 13:35:11 2012
@@ -1 +1 @@
-/lldb/trunk:154223-157353
+/lldb/trunk:154223-157405

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Process.h?rev=157409&r1=157408&r2=157409&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Process.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Process.h Thu May 24 13:35:11 2012
@@ -800,7 +800,8 @@
         ProcessInstanceInfo(),
         m_plugin_name (),
         m_resume_count (0),
-        m_wait_for_launch (false)
+        m_wait_for_launch (false),
+        m_continue_once_attached (false)
     {
     }
 
@@ -808,7 +809,8 @@
         ProcessInstanceInfo(),
         m_plugin_name (),
         m_resume_count (0),
-        m_wait_for_launch (false)
+        m_wait_for_launch (false),
+        m_continue_once_attached (false)
     {
         ProcessInfo::operator= (launch_info);
         SetProcessPluginName (launch_info.GetProcessPluginName());
@@ -827,6 +829,18 @@
         m_wait_for_launch = b;
     }
 
+    bool
+    GetContinueOnceAttached () const
+    {
+        return m_continue_once_attached;
+    }
+    
+    void
+    SetContinueOnceAttached (bool b)
+    {
+        m_continue_once_attached = b;
+    }
+
     uint32_t
     GetResumeCount () const
     {
@@ -880,6 +894,7 @@
     std::string m_plugin_name;
     uint32_t m_resume_count; // How many times do we resume after launching
     bool m_wait_for_launch;
+    bool m_continue_once_attached; // Supports the use-case scenario of immediately continuing the process once attached.
 };
 
 class ProcessLaunchCommandOptions : public Options

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj?rev=157409&r1=157408&r2=157409&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj Thu May 24 13:35:11 2012
@@ -4095,6 +4095,8 @@
 				GCC_WARN_UNUSED_LABEL = YES;
 				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
+				LLDB_DISABLE_PYTHON = 0;
+				"LLDB_DISABLE_PYTHON[sdk=iphoneos*]" = 1;
 				LLDB_FRAMEWORK_INSTALL_DIR = /Applications/Xcode.app/Contents/SharedFrameworks;
 				LLDB_TOOLS_INSTALL_DIR = /usr/bin;
 				LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
@@ -4106,6 +4108,7 @@
 					"-flimit-debug-info",
 					"-Wparentheses",
 				);
+				SDKROOT = macosx;
 				STRIP_INSTALLED_PRODUCT = NO;
 				STRIP_STYLE = debugging;
 				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -4148,6 +4151,8 @@
 				GCC_WARN_UNUSED_LABEL = YES;
 				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
+				LLDB_DISABLE_PYTHON = 0;
+				"LLDB_DISABLE_PYTHON[sdk=iphoneos*]" = 1;
 				LLDB_FRAMEWORK_INSTALL_DIR = /Applications/Xcode.app/Contents/SharedFrameworks;
 				LLDB_TOOLS_INSTALL_DIR = /usr/bin;
 				LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
@@ -4512,6 +4517,8 @@
 				GCC_WARN_UNUSED_LABEL = YES;
 				GCC_WARN_UNUSED_VALUE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
+				LLDB_DISABLE_PYTHON = 0;
+				"LLDB_DISABLE_PYTHON[sdk=iphoneos*]" = 1;
 				LLDB_FRAMEWORK_INSTALL_DIR = /Applications/Xcode.app/Contents/SharedFrameworks;
 				"LLDB_FRAMEWORK_INSTALL_DIR[sdk=iphoneos*]" = /System/Library/PrivateFrameworks;
 				LLDB_TOOLS_INSTALL_DIR = /Applications/Xcode.app/Contents/Developer/usr/bin;

Modified: lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh?rev=157409&r1=157408&r2=157409&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/build-swig-Python.sh Thu May 24 13:35:11 2012
@@ -24,7 +24,12 @@
 swig_python_wrapper=${SRC_ROOT}/scripts/Python/python-wrapper.swig
 swig_python_typemaps=${SRC_ROOT}/scripts/Python/python-typemaps.swig
 
-if [ "x$SDKROOT" = "x" ] ; then
+if [ $LLDB_DISABLE_PYTHON = "1" ] ; then
+    # LLDB_DISABLE_PYTHON is set, which currently means iOS cross build where python is disabled
+    rm -rf ${swig_output_file}
+    touch ${swig_output_file}
+
+else
 
 if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
 then
@@ -303,8 +308,4 @@
     fi
 fi
 
-else
-    # SDKROOT was not empty, which currently means iOS cross build where python is disabled
-    rm -rf ${swig_output_file}
-    touch ${swig_output_file}
 fi

Modified: lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh?rev=157409&r1=157408&r2=157409&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/finish-swig-Python-LLDB.sh Thu May 24 13:35:11 2012
@@ -33,9 +33,9 @@
 PYTHON_INSTALL_DIR=$4
 debug_flag=$5
 
-# Make sure SDKROOT is not set, since if it is this is an iOS build where python
+# Make sure LLDB_DISABLE_PYTHON is not set, since if it is this is an iOS build where python
 # is disabled
-if [ "x$SDKROOT" = "x" ] ; then
+if [ ! $LLDB_DISABLE_PYTHON = "1" ] ; then
 
 if [ -n "$debug_flag" -a "$debug_flag" == "-debug" ]
 then

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp?rev=157409&r1=157408&r2=157409&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp Thu May 24 13:35:11 2012
@@ -320,6 +320,10 @@
             bool success = false;
             switch (short_option)
             {
+                case 'c':
+                    attach_info.SetContinueOnceAttached(true);
+                    break;
+
                 case 'p':   
                     {
                         lldb::pid_t pid = Args::StringToUInt32 (option_arg, LLDB_INVALID_PROCESS_ID, 0, &success);
@@ -591,6 +595,10 @@
                 result.AppendWarningWithFormat("Architecture changed from %s to %s.\n", 
                                                 old_arch_spec.GetArchitectureName(), target->GetArchitecture().GetArchitectureName());
             }
+
+            // This supports the use-case scenario of immediately continuing the process once attached.
+            if (m_options.attach_info.GetContinueOnceAttached())
+                m_interpreter.HandleCommand("process continue", false, result);
         }
         return result.Succeeded();
     }
@@ -610,10 +618,11 @@
 OptionDefinition
 CommandObjectProcessAttach::CommandOptions::g_option_table[] =
 {
-{ LLDB_OPT_SET_ALL, false, "plugin", 'P', required_argument, NULL, 0, eArgTypePlugin,        "Name of the process plugin you want to use."},
-{ LLDB_OPT_SET_1,   false, "pid",    'p', required_argument, NULL, 0, eArgTypePid,           "The process ID of an existing process to attach to."},
-{ LLDB_OPT_SET_2,   false, "name",   'n', required_argument, NULL, 0, eArgTypeProcessName,  "The name of the process to attach to."},
-{ LLDB_OPT_SET_2,   false, "waitfor",'w', no_argument,       NULL, 0, eArgTypeNone,              "Wait for the the process with <process-name> to launch."},
+{ LLDB_OPT_SET_ALL, false, "continue",'c', no_argument,       NULL, 0, eArgTypeNone,         "Immediately continue the process once attached."},
+{ LLDB_OPT_SET_ALL, false, "plugin",  'P', required_argument, NULL, 0, eArgTypePlugin,       "Name of the process plugin you want to use."},
+{ LLDB_OPT_SET_1,   false, "pid",     'p', required_argument, NULL, 0, eArgTypePid,          "The process ID of an existing process to attach to."},
+{ LLDB_OPT_SET_2,   false, "name",    'n', required_argument, NULL, 0, eArgTypeProcessName,  "The name of the process to attach to."},
+{ LLDB_OPT_SET_2,   false, "waitfor", 'w', no_argument,       NULL, 0, eArgTypeNone,         "Wait for the the process with <process-name> to launch."},
 { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 

Modified: lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py?rev=157409&r1=157408&r2=157409&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py Thu May 24 13:35:11 2012
@@ -18,6 +18,10 @@
         system(["/bin/sh", "-c", "rm -f child_send.txt"])
         system(["/bin/sh", "-c", "rm -f child_read.txt"])
 
+    def test_process_attach_dash_dash_con(self):
+        """Test that 'process attach --con' completes to 'process attach --continue '."""
+        self.complete_from_to('process attach --con', 'process attach --continue ')
+
     # <rdar://problem/11052829>
     def test_infinite_loop_while_completing(self):
         """Test that 'process print hello\' completes to itself and does not infinite loop."""





More information about the lldb-commits mailing list