[Lldb-commits] [lldb] r160960 - in /lldb/branches/apple/python-GIL: ./ examples/summaries/ include/lldb/API/ include/lldb/Target/ lldb.xcodeproj/ resources/ scripts/ scripts/Python/interface/ source/API/ source/Commands/ source/Expression/ source/Host/macosx/launcherXPCService/ source/Plugins/Process/gdb-remote/ source/Target/ test/functionalities/load_unload/hidden/ test/functionalities/single-quote-in-filename-to-lldb/path with '09/ test/source-manager/hidden/ tools/debugserver/debugserver.xcodeproj/ tools/debugserve...

Filipe Cabecinhas me at filcab.net
Mon Jul 30 07:29:39 PDT 2012


Author: filcab
Date: Mon Jul 30 09:29:39 2012
New Revision: 160960

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

Added:
    lldb/branches/apple/python-GIL/test/functionalities/load_unload/hidden/.keep
      - copied unchanged from r160909, lldb/trunk/test/functionalities/load_unload/hidden/.keep
    lldb/branches/apple/python-GIL/test/functionalities/single-quote-in-filename-to-lldb/path with '09/.keep
      - copied unchanged from r160909, lldb/trunk/test/functionalities/single-quote-in-filename-to-lldb/path with '09/.keep
    lldb/branches/apple/python-GIL/test/source-manager/hidden/.keep
      - copied unchanged from r160909, lldb/trunk/test/source-manager/hidden/.keep
Modified:
    lldb/branches/apple/python-GIL/   (props changed)
    lldb/branches/apple/python-GIL/examples/summaries/lldb
    lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h
    lldb/branches/apple/python-GIL/include/lldb/Target/Process.h
    lldb/branches/apple/python-GIL/include/lldb/Target/RegisterContext.h
    lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj
    lldb/branches/apple/python-GIL/llvm.zip
    lldb/branches/apple/python-GIL/resources/LLDB-Info.plist
    lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i
    lldb/branches/apple/python-GIL/scripts/llvm.amalgamated.diff
    lldb/branches/apple/python-GIL/source/API/SBProcess.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp
    lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp
    lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp
    lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
    lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
    lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp
    lldb/branches/apple/python-GIL/source/Target/Process.cpp
    lldb/branches/apple/python-GIL/source/Target/TargetList.cpp
    lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOut.cpp
    lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOverRange.cpp
    lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj
    lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp
    lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.h
    lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp
    lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.h
    lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
    lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp
    lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.h
    lldb/branches/apple/python-GIL/tools/driver/Driver.cpp
    lldb/branches/apple/python-GIL/tools/driver/IOChannel.cpp

Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jul 30 09:29:39 2012
@@ -1 +1 @@
-/lldb/trunk:156467-160656
+/lldb/trunk:156467-160909

Modified: lldb/branches/apple/python-GIL/examples/summaries/lldb
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/summaries/lldb?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/summaries/lldb (original)
+++ lldb/branches/apple/python-GIL/examples/summaries/lldb Mon Jul 30 09:29:39 2012
@@ -1,15 +1,28 @@
-type summary add -w lldb lldb_private::Error               -s "Type: ${var.m_type%E}, Code: ${var.m_code}, Message: ${var.m_string}" 
-type summary add -w lldb lldb_private::ConstString         -s "${var.m_string}" 
-type summary add -w lldb lldb_private::Language            -s "${var.m_language%E}" 
-type summary add -w lldb lldb_private::RegularExpression   -s "${var.m_re}" 
-type summary add -w lldb lldb_private::UserID              -s "UserID(${var.m_uid})" 
-type summary add -w lldb lldb_private::ValueObject         -s "${var.m_name}" 
-type summary add -w lldb lldb_private::ValueObjectSP       -s "${var.ptr_.m_name}"
-type summary add -w lldb lldb_private::ValueObjectRegister -s "${var.m_reg_info.name}"
-type summary add -w lldb lldb_private::ClangExpression     -s "{${var.m_expr_text}}"
-type summary add -w lldb lldb_private::CommandObject       -s "Command name: ${var.m_cmd_name}"
-type summary add -w lldb lldb_private::Variable            -s "${var.m_type.m_name} ${var.m_name}"
-type summary add -w lldb lldb_private::StopInfo            -s "ID: ${var.m_stop_id}, ${var.m_description}"
-type summary add -w lldb lldb_private::FileSpec            -s "file: ${var.m_filename} dir: ${var.m_directory}"
-type summary add -w lldb -v lldb::ConnectionStatus         -s "[enum=${var%E} val=${var%i}]"
+type summary add -w lldb lldb_private::Error                                   -s "Type: ${var.m_type%E}, Code: ${var.m_code}, Message: ${var.m_string}" 
+type summary add -w lldb lldb_private::ConstString                             -s "${var.m_string}" 
+type summary add -w lldb lldb_private::Language                                -s "${var.m_language%E}" 
+type summary add -w lldb lldb_private::RegularExpression                       -s "${var.m_re}" 
+type summary add -w lldb lldb_private::UserID                                  -s "UserID(${var.m_uid})" 
+type summary add -w lldb lldb_private::ValueObject                             -s "${var.m_name}" 
+type summary add -w lldb lldb_private::ValueObjectSP                           -s "${var.ptr_.m_name}"
+type summary add -w lldb lldb_private::ValueObjectRegister                     -s "${var.m_reg_info.name}"
+type summary add -w lldb lldb_private::ClangExpression                         -s "{${var.m_expr_text}}"
+type summary add -w lldb lldb_private::CommandObject                           -s "Command name: ${var.m_cmd_name}"
+type summary add -w lldb lldb_private::Variable                                -s "${var.m_type.m_name} ${var.m_name}"
+type summary add -w lldb lldb_private::StopInfo                                -s "ID: ${var.m_stop_id}, ${var.m_description}"
+type summary add -w lldb lldb_private::FileSpec                                -s "file: ${var.m_filename%S} dir: ${var.m_directory%S}"
+type summary add -w -v lldb lldb::ConnectionStatus                             -s "[enum=${var%E} val=${var%i}]"
 # Where '-v' tells type summary not to show the value itself, but just use the summary format.
+
+type summary add -w lldb "lldb_private::ThreadSafeValue<lldb::StateType>"      -s "${var.m_value}"
+type summary add -w lldb lldb_private::CompileUnit                             -s "file: ${var.m_filename%S} dir: ${var.m_directory%S}" 
+type summary add -w lldb "lldb_private::Module"                                -s "${var.m_file%S}"
+type summary add -w lldb "lldb_private::ModuleSpec"                            -s "${var.m_file%S}"
+type summary add -w lldb "lldb_private::ModuleList"                            -s "${var.m_modules%S}"
+type summary add -w lldb "lldb::ModuleSP"                                      -s "${var._M_ptr%S}"
+type summary add -w lldb "lldb_private::Process"                               -s "Public: ${var.m_public_state%S} Private: ${var.m_private_state%S}"
+type summary add -w lldb "DynamicLoaderMacOSXDYLD::DYLDImageInfo"              -s "${var.file_spec%S}"
+
+type format add -f x lldb::addr_t
+
+type category enable lldb

Modified: lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h Mon Jul 30 09:29:39 2012
@@ -156,6 +156,9 @@
     lldb::SBError
     Signal (int signal);
 
+    void
+    SendAsyncInterrupt();
+    
     size_t
     ReadMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);
 

Modified: lldb/branches/apple/python-GIL/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/Process.h?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Process.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Process.h Mon Jul 30 09:29:39 2012
@@ -2388,6 +2388,9 @@
                      uint32_t num_frames, 
                      uint32_t num_frames_with_source);
 
+    void
+    SendAsyncInterrupt ();
+    
 protected:
     
     void

Modified: lldb/branches/apple/python-GIL/include/lldb/Target/RegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/RegisterContext.h?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/RegisterContext.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/RegisterContext.h Mon Jul 30 09:29:39 2012
@@ -59,6 +59,13 @@
     virtual bool
     WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value) = 0;
     
+    // These two functions are used to implement "push" and "pop" of register states.  They are used primarily
+    // for expression evaluation, where we need to push a new state (storing the old one in data_sp) and then
+    // restoring the original state by passing the data_sp we got from ReadAllRegisters to WriteAllRegisterValues.
+    // ReadAllRegisters will do what is necessary to return a coherent set of register values for this thread, which
+    // may mean e.g. interrupting a thread that is sitting in a kernel trap.  That is a somewhat disruptive operation,
+    // so these API's should only be used when this behavior is needed.
+    
     virtual bool
     ReadAllRegisterValues (lldb::DataBufferSP &data_sp) = 0;
 

Modified: lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj Mon Jul 30 09:29:39 2012
@@ -4077,7 +4077,7 @@
 				LLDB_TOOLS_INSTALL_DIR = /usr/bin;
 				LLVM_BUILD_DIR = "$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
 				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
-				LLVM_CONFIGURATION = Release;
+				LLVM_CONFIGURATION = "Debug+Asserts";
 				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
@@ -4194,9 +4194,9 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 162;
+				DYLIB_CURRENT_VERSION = 163;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4253,10 +4253,10 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 162;
+				DYLIB_CURRENT_VERSION = 163;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4313,7 +4313,7 @@
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				DEBUGGING_SYMBOLS = YES;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -4340,7 +4340,7 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4358,7 +4358,7 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4373,8 +4373,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 162;
-				DYLIB_CURRENT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
+				DYLIB_CURRENT_VERSION = 163;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4404,8 +4404,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 162;
-				DYLIB_CURRENT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
+				DYLIB_CURRENT_VERSION = 163;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4435,8 +4435,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 162;
-				DYLIB_CURRENT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
+				DYLIB_CURRENT_VERSION = 163;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4526,7 +4526,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4567,10 +4567,10 @@
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 162;
+				DYLIB_CURRENT_VERSION = 163;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4886,7 +4886,7 @@
 		26F5C26C10F3D9A5009D5894 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4916,7 +4916,7 @@
 		26F5C26D10F3D9A5009D5894 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 162;
+				CURRENT_PROJECT_VERSION = 163;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",

Modified: lldb/branches/apple/python-GIL/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/llvm.zip?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
Binary files - no diff available.

Modified: lldb/branches/apple/python-GIL/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/resources/LLDB-Info.plist?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/resources/LLDB-Info.plist (original)
+++ lldb/branches/apple/python-GIL/resources/LLDB-Info.plist Mon Jul 30 09:29:39 2012
@@ -17,7 +17,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>162</string>
+	<string>163</string>
 	<key>CFBundleName</key>
 	<string>${EXECUTABLE_NAME}</string>
 </dict>

Modified: lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i (original)
+++ lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i Mon Jul 30 09:29:39 2012
@@ -206,6 +206,9 @@
     lldb::SBError
     Signal (int signal);
 
+    void
+    SendAsyncInterrupt();
+    
     %feature("autodoc", "
     Reads memory from the current process's address space and removes any
     traps that may have been inserted into the memory. It returns the byte

Modified: lldb/branches/apple/python-GIL/scripts/llvm.amalgamated.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/llvm.amalgamated.diff?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/llvm.amalgamated.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/llvm.amalgamated.diff Mon Jul 30 09:29:39 2012
@@ -492,7 +492,7 @@
    if (type == TYPE_RELv) {
 +    isBranch = true;
 +    pcrel = insn.startLocation +
-+            insn.displacementOffset + insn.displacementSize;
++            insn.immediateOffset + insn.immediateSize;
      switch (insn.displacementSize) {
      default:
        break;

Modified: lldb/branches/apple/python-GIL/source/API/SBProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBProcess.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBProcess.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBProcess.cpp Mon Jul 30 09:29:39 2012
@@ -718,6 +718,16 @@
     return sb_error;
 }
 
+void
+SBProcess::SendAsyncInterrupt ()
+{
+    ProcessSP process_sp(GetSP());
+    if (process_sp)
+    {
+        process_sp->SendAsyncInterrupt ();
+    }
+}
+
 SBThread
 SBProcess::GetThreadByID (tid_t tid)
 {

Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp Mon Jul 30 09:29:39 2012
@@ -566,6 +566,7 @@
                     else
                     {
                         result.AppendError ("attach failed: process did not stop (no such process or permission problem?)");
+                        process->Destroy();
                         result.SetStatus (eReturnStatusFailed);
                         return false;                
                     }

Modified: lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp Mon Jul 30 09:29:39 2012
@@ -2703,6 +2703,9 @@
             {
                 const bool include_symbols = true;
                 
+                // TODO Fix FindFunctions so that it doesn't return
+                //   instance methods for eFunctionNameTypeBase.
+                
                 target->GetImages().FindFunctions(name,
                                                   eFunctionNameTypeBase,
                                                   include_symbols,
@@ -2725,6 +2728,14 @@
                     
                     if (sym_ctx.function)
                     {
+                        clang::DeclContext *decl_ctx = sym_ctx.function->GetClangDeclContext();
+                        
+                        // Filter out class/instance methods.
+                        if (dyn_cast<clang::ObjCMethodDecl>(decl_ctx))
+                            continue;
+                        if (dyn_cast<clang::CXXMethodDecl>(decl_ctx))
+                            continue;
+                        
                         // TODO only do this if it's a C function; C++ functions may be
                         // overloaded
                         if (!context.m_found.function_with_type_info)
@@ -3281,10 +3292,15 @@
     {
         ASTDumper ast_dumper(fun_decl);
         
-        log->Printf("  CEDM::FEVD[%u] Found %s function %s, returned %s", 
+        StreamString ss;
+        
+        fun_address->Dump(&ss, m_parser_vars->m_exe_ctx.GetBestExecutionContextScope(), Address::DumpStyleResolvedDescription);
+        
+        log->Printf("  CEDM::FEVD[%u] Found %s function %s (description %s), returned %s",
                     current_id,
                     (fun ? "specific" : "generic"), 
-                    decl_name.c_str(), 
+                    decl_name.c_str(),
+                    ss.GetData(),
                     ast_dumper.GetCString());
     }
 }

Modified: lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp Mon Jul 30 09:29:39 2012
@@ -2811,7 +2811,12 @@
             
             return false;
         }
+    }
 
+    for (bbi = function->begin();
+         bbi != function->end();
+         ++bbi)
+    {
         if (!ResolveCalls(*bbi))
         {
             if (log)

Modified: lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist (original)
+++ lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist Mon Jul 30 09:29:39 2012
@@ -25,7 +25,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>162</string>
+	<string>163</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
 	<key>XPCService</key>

Modified: lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist (original)
+++ lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist Mon Jul 30 09:29:39 2012
@@ -25,7 +25,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>162</string>
+	<string>163</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
 	<key>XPCService</key>

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Mon Jul 30 09:29:39 2012
@@ -51,6 +51,7 @@
     m_supports_watchpoint_support_info  (eLazyBoolCalculate),
     m_watchpoints_trigger_after_instruction(eLazyBoolCalculate),
     m_attach_or_wait_reply(eLazyBoolCalculate),
+    m_prepare_for_reg_writing_reply (eLazyBoolCalculate),
     m_supports_qProcessInfoPID (true),
     m_supports_qfProcessInfo (true),
     m_supports_qUserName (true),
@@ -154,6 +155,26 @@
         return false;
 }
 
+bool
+GDBRemoteCommunicationClient::GetSyncThreadStateSupported ()
+{
+    if (m_prepare_for_reg_writing_reply == eLazyBoolCalculate)
+    {
+        m_prepare_for_reg_writing_reply = eLazyBoolNo;
+        
+        StringExtractorGDBRemote response;
+        if (SendPacketAndWaitForResponse("qSyncThreadStateSupported", response, false))
+        {
+            if (response.IsOKResponse())
+                m_prepare_for_reg_writing_reply = eLazyBoolYes;
+        }
+    }
+    if (m_prepare_for_reg_writing_reply == eLazyBoolYes)
+        return true;
+    else
+        return false;
+}
+
 
 void
 GDBRemoteCommunicationClient::ResetDiscoverableSettings()
@@ -168,6 +189,8 @@
     m_qHostInfo_is_valid = eLazyBoolCalculate;
     m_supports_alloc_dealloc_memory = eLazyBoolCalculate;
     m_supports_memory_region_info = eLazyBoolCalculate;
+    m_prepare_for_reg_writing_reply = eLazyBoolCalculate;
+    m_attach_or_wait_reply = eLazyBoolCalculate;
 
     m_supports_qProcessInfoPID = true;
     m_supports_qfProcessInfo = true;

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Mon Jul 30 09:29:39 2012
@@ -224,6 +224,9 @@
     bool
     GetVAttachOrWaitSupported ();
     
+    bool
+    GetSyncThreadStateSupported();
+    
     void
     ResetDiscoverableSettings();
 
@@ -369,6 +372,7 @@
     lldb_private::LazyBool m_supports_watchpoint_support_info;
     lldb_private::LazyBool m_watchpoints_trigger_after_instruction;
     lldb_private::LazyBool m_attach_or_wait_reply;
+    lldb_private::LazyBool m_prepare_for_reg_writing_reply;
     
     bool
         m_supports_qProcessInfoPID:1,

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Mon Jul 30 09:29:39 2012
@@ -286,7 +286,6 @@
     return true;
 }
 
-
 bool
 GDBRemoteRegisterContext::WriteRegister (const RegisterInfo *reg_info,
                                          const RegisterValue &value)
@@ -326,6 +325,29 @@
     }
     return false;
 }
+
+void
+GDBRemoteRegisterContext::SyncThreadState(Process *process)
+{
+    // NB.  We assume our caller has locked the sequence mutex.
+    
+    GDBRemoteCommunicationClient &gdb_comm (((ProcessGDBRemote *) process)->GetGDBRemote());
+    if (!gdb_comm.GetSyncThreadStateSupported())
+        return;
+
+    StreamString packet;
+    StringExtractorGDBRemote response;
+    packet.Printf ("QSyncThreadState:%4.4llx;", m_thread.GetID());
+    if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),
+                                              packet.GetString().size(),
+                                              response,
+                                              false))
+    {
+        if (response.IsOKResponse())
+            InvalidateAllRegisters();
+    }
+}
+
 bool
 GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo *reg_info, DataExtractor &data, uint32_t data_offset)
 {
@@ -479,6 +501,8 @@
     Mutex::Locker locker;
     if (gdb_comm.GetSequenceMutex (locker, "Didn't get sequence mutex for read all registers."))
     {
+        SyncThreadState(process);
+        
         char packet[32];
         const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported();
         ProcessSP process_sp (m_thread.GetProcess());

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h Mon Jul 30 09:29:39 2012
@@ -243,6 +243,9 @@
     void
     SetAllRegisterValid (bool b);
 
+    void
+    SyncThreadState(lldb_private::Process *process);  // Assumes the sequence mutex has already been acquired.
+    
     GDBRemoteDynamicRegisterInfo &m_reg_info;
     std::vector<bool> m_reg_valid;
     lldb_private::DataExtractor m_reg_data;

Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Jul 30 09:29:39 2012
@@ -48,13 +48,13 @@
 // Project includes
 #include "lldb/Host/Host.h"
 #include "Plugins/Process/Utility/InferiorCallPOSIX.h"
+#include "Plugins/Process/Utility/StopInfoMachException.h"
 #include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
 #include "Utility/StringExtractorGDBRemote.h"
 #include "GDBRemoteRegisterContext.h"
 #include "ProcessGDBRemote.h"
 #include "ProcessGDBRemoteLog.h"
 #include "ThreadGDBRemote.h"
-#include "StopInfoMachException.h"
 
 namespace lldb
 {
@@ -1868,7 +1868,7 @@
         {
             if (log)
                 log->Printf ("ProcessGDBRemote::DoDestroy - failed to send k packet");
-            exit_string.assign ("killing while attaching.");
+            exit_string.assign ("killed or interrupted while attaching.");
         }
     }
     else

Modified: lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ExecutionContext.cpp Mon Jul 30 09:29:39 2012
@@ -643,7 +643,7 @@
                         if (!thread_sp)
                             thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0);
                         
-                        if (thread_sp)
+                        if (thread_sp && process_sp->GetState() == lldb::eStateStopped)
                         {
                             SetThreadSP (thread_sp);
                             lldb::StackFrameSP frame_sp (thread_sp->GetSelectedFrame());

Modified: lldb/branches/apple/python-GIL/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Process.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Process.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Process.cpp Mon Jul 30 09:29:39 2012
@@ -835,7 +835,8 @@
                                       eBroadcastBitSTDERR);
 
     m_private_state_listener.StartListeningForEvents(&m_private_state_broadcaster,
-                                                     eBroadcastBitStateChanged);
+                                                     eBroadcastBitStateChanged |
+                                                     eBroadcastBitInterrupt);
 
     m_private_state_listener.StartListeningForEvents(&m_private_state_control_broadcaster,
                                                      eBroadcastInternalStateControlStop |
@@ -1027,7 +1028,7 @@
 {
     if (listener != NULL)
     {
-        return HijackBroadcaster(listener, eBroadcastBitStateChanged);
+        return HijackBroadcaster(listener, eBroadcastBitStateChanged | eBroadcastBitInterrupt);
     }
     else
         return false;
@@ -1044,7 +1045,7 @@
 {
     if (listener != NULL)
     {
-        return m_private_state_broadcaster.HijackBroadcaster(listener, eBroadcastBitStateChanged);
+        return m_private_state_broadcaster.HijackBroadcaster(listener, eBroadcastBitStateChanged | eBroadcastBitInterrupt);
     }
     else
         return false;
@@ -1067,9 +1068,14 @@
     StateType state = eStateInvalid;
     if (m_listener.WaitForEventForBroadcasterWithType (timeout,
                                                        this,
-                                                       eBroadcastBitStateChanged,
+                                                       eBroadcastBitStateChanged | eBroadcastBitInterrupt,
                                                        event_sp))
-        state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+    {
+        if (event_sp && event_sp->GetType() == eBroadcastBitStateChanged)
+            state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+        else if (log)
+            log->Printf ("Process::%s got no event or was interrupted.", __FUNCTION__);
+    }
 
     if (log)
         log->Printf ("Process::%s (timeout = %p, event_sp) => %s",
@@ -1118,9 +1124,10 @@
     StateType state = eStateInvalid;
     if (m_private_state_listener.WaitForEventForBroadcasterWithType (timeout,
                                                                      &m_private_state_broadcaster,
-                                                                     eBroadcastBitStateChanged,
+                                                                     eBroadcastBitStateChanged | eBroadcastBitInterrupt,
                                                                      event_sp))
-        state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+        if (event_sp && event_sp->GetType() == eBroadcastBitStateChanged)
+            state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
 
     // This is a bit of a hack, but when we wait here we could very well return
     // to the command-line, and that could disable the log, which would render the
@@ -3292,6 +3299,15 @@
 }
 
 void
+Process::SendAsyncInterrupt ()
+{
+    if (PrivateStateThreadIsValid())
+        m_private_state_broadcaster.BroadcastEvent (Process::eBroadcastBitInterrupt, NULL);
+    else
+        BroadcastEvent (Process::eBroadcastBitInterrupt, NULL);
+}
+
+void
 Process::HandlePrivateEvent (EventSP &event_sp)
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
@@ -3410,7 +3426,22 @@
             m_private_state_control_wait.SetValue (true, eBroadcastAlways);
             continue;
         }
-
+        else if (event_sp->GetType() == eBroadcastBitInterrupt)
+        {
+            if (m_public_state.GetValue() == eStateAttaching)
+            {
+                if (log)
+                    log->Printf ("Process::%s (arg = %p, pid = %llu) woke up with an interrupt while attaching - forwarding interrupt.", __FUNCTION__, this, GetID());
+                BroadcastEvent (eBroadcastBitInterrupt, NULL);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("Process::%s (arg = %p, pid = %llu) woke up with an interrupt - Halting.", __FUNCTION__, this, GetID());
+                Halt();
+            }
+            continue;
+        }
 
         const StateType internal_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
 
@@ -4215,72 +4246,85 @@
                 if (event_sp.get())
                 {
                     bool keep_going = false;
-                    stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
-                    if (log)
-                        log->Printf("Process::RunThreadPlan(): in while loop, got event: %s.", StateAsCString(stop_state));
-                        
-                    switch (stop_state)
+                    if (event_sp->GetType() == eBroadcastBitInterrupt)
                     {
-                    case lldb::eStateStopped:
+                        Halt();
+                        keep_going = false;
+                        return_value = eExecutionInterrupted;
+                        errors.Printf ("Execution halted by user interrupt.");
+                        if (log)
+                            log->Printf ("Process::RunThreadPlan(): Got  interrupted by eBroadcastBitInterrupted, exiting.");
+                    }
+                    else
+                    {
+                        stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+                        if (log)
+                            log->Printf("Process::RunThreadPlan(): in while loop, got event: %s.", StateAsCString(stop_state));
+                            
+                        switch (stop_state)
                         {
-                            // Yay, we're done.  Now make sure that our thread plan actually completed.
-                            ThreadSP thread_sp = GetThreadList().FindThreadByIndexID (thread_idx_id);
-                            if (!thread_sp)
+                        case lldb::eStateStopped:
                             {
-                                // Ooh, our thread has vanished.  Unlikely that this was successful execution...
-                                if (log)
-                                    log->Printf ("Process::RunThreadPlan(): execution completed but our thread (index-id=%u) has vanished.", thread_idx_id);
-                                return_value = eExecutionInterrupted;
-                            }
-                            else
-                            {
-                                StopInfoSP stop_info_sp (thread_sp->GetStopInfo ());
-                                StopReason stop_reason = eStopReasonInvalid;
-                                if (stop_info_sp)
-                                     stop_reason = stop_info_sp->GetStopReason();
-                                if (stop_reason == eStopReasonPlanComplete)
+                                // Yay, we're done.  Now make sure that our thread plan actually completed.
+                                ThreadSP thread_sp = GetThreadList().FindThreadByIndexID (thread_idx_id);
+                                if (!thread_sp)
                                 {
+                                    // Ooh, our thread has vanished.  Unlikely that this was successful execution...
                                     if (log)
-                                        log->PutCString ("Process::RunThreadPlan(): execution completed successfully.");
-                                    // Now mark this plan as private so it doesn't get reported as the stop reason
-                                    // after this point.  
-                                    if (thread_plan_sp)
-                                        thread_plan_sp->SetPrivate (orig_plan_private);
-                                    return_value = eExecutionCompleted;
+                                        log->Printf ("Process::RunThreadPlan(): execution completed but our thread (index-id=%u) has vanished.", thread_idx_id);
+                                    return_value = eExecutionInterrupted;
                                 }
                                 else
                                 {
-                                    if (log)
-                                        log->PutCString ("Process::RunThreadPlan(): thread plan didn't successfully complete.");
+                                    StopInfoSP stop_info_sp (thread_sp->GetStopInfo ());
+                                    StopReason stop_reason = eStopReasonInvalid;
+                                    if (stop_info_sp)
+                                         stop_reason = stop_info_sp->GetStopReason();
+                                    if (stop_reason == eStopReasonPlanComplete)
+                                    {
+                                        if (log)
+                                            log->PutCString ("Process::RunThreadPlan(): execution completed successfully.");
+                                        // Now mark this plan as private so it doesn't get reported as the stop reason
+                                        // after this point.  
+                                        if (thread_plan_sp)
+                                            thread_plan_sp->SetPrivate (orig_plan_private);
+                                        return_value = eExecutionCompleted;
+                                    }
+                                    else
+                                    {
+                                        if (log)
+                                            log->PutCString ("Process::RunThreadPlan(): thread plan didn't successfully complete.");
 
-                                    return_value = eExecutionInterrupted;
+                                        return_value = eExecutionInterrupted;
+                                    }
                                 }
-                            }
-                        }        
-                        break;
+                            }        
+                            break;
 
-                    case lldb::eStateCrashed:
-                        if (log)
-                            log->PutCString ("Process::RunThreadPlan(): execution crashed.");
-                        return_value = eExecutionInterrupted;
-                        break;
+                        case lldb::eStateCrashed:
+                            if (log)
+                                log->PutCString ("Process::RunThreadPlan(): execution crashed.");
+                            return_value = eExecutionInterrupted;
+                            break;
 
-                    case lldb::eStateRunning:
-                        do_resume = false;
-                        keep_going = true;
-                        break;
+                        case lldb::eStateRunning:
+                            do_resume = false;
+                            keep_going = true;
+                            break;
 
-                    default:
-                        if (log)
-                            log->Printf("Process::RunThreadPlan(): execution stopped with unexpected state: %s.", StateAsCString(stop_state));
-                            
-                        if (stop_state == eStateExited)
-                            event_to_broadcast_sp = event_sp;
-                            
-                        errors.Printf ("Execution stopped with unexpected state.");
-                        return_value = eExecutionInterrupted;
-                        break;
+                        default:
+                            if (log)
+                                log->Printf("Process::RunThreadPlan(): execution stopped with unexpected state: %s.", StateAsCString(stop_state));
+                                
+                            if (stop_state == eStateExited)
+                                event_to_broadcast_sp = event_sp;
+                                
+                            errors.Printf ("Execution stopped with unexpected state.");
+                            return_value = eExecutionInterrupted;
+                            break;
+                        }
                     }
+                    
                     if (keep_going)
                         continue;
                     else
@@ -4499,83 +4543,92 @@
                 
                 do 
                 {
-                    const Process::ProcessEventData *event_data = Process::ProcessEventData::GetEventDataFromEvent (event_sp.get());
-
-                    if (!event_data)
+                    if (!event_sp)
                     {
-                        event_explanation = "<no event data>";
+                        event_explanation = "<no event>";
                         break;
                     }
-                    
-                    Process *process = event_data->GetProcessSP().get();
-
-                    if (!process)
+                    else if (event_sp->GetType() == eBroadcastBitInterrupt)
                     {
-                        event_explanation = "<no process>";
+                        event_explanation = "<user interrupt>";
                         break;
                     }
-                    
-                    ThreadList &thread_list = process->GetThreadList();
-                    
-                    uint32_t num_threads = thread_list.GetSize();
-                    uint32_t thread_index;
-                    
-                    ts.Printf("<%u threads> ", num_threads);
-                    
-                    for (thread_index = 0;
-                         thread_index < num_threads;
-                         ++thread_index)
+                    else
                     {
-                        Thread *thread = thread_list.GetThreadAtIndex(thread_index).get();
+                        const Process::ProcessEventData *event_data = Process::ProcessEventData::GetEventDataFromEvent (event_sp.get());
+
+                        if (!event_data)
+                        {
+                            event_explanation = "<no event data>";
+                            break;
+                        }
                         
-                        if (!thread)
+                        Process *process = event_data->GetProcessSP().get();
+
+                        if (!process)
                         {
-                            ts.Printf("<?> ");
-                            continue;
+                            event_explanation = "<no process>";
+                            break;
                         }
                         
-                        ts.Printf("<0x%4.4llx ", thread->GetID());
-                        RegisterContext *register_context = thread->GetRegisterContext().get();
+                        ThreadList &thread_list = process->GetThreadList();
                         
-                        if (register_context)
-                            ts.Printf("[ip 0x%llx] ", register_context->GetPC());
-                        else
-                            ts.Printf("[ip unknown] ");
+                        uint32_t num_threads = thread_list.GetSize();
+                        uint32_t thread_index;
                         
-                        lldb::StopInfoSP stop_info_sp = thread->GetStopInfo();
-                        if (stop_info_sp)
+                        ts.Printf("<%u threads> ", num_threads);
+                        
+                        for (thread_index = 0;
+                             thread_index < num_threads;
+                             ++thread_index)
                         {
-                            const char *stop_desc = stop_info_sp->GetDescription();
-                            if (stop_desc)
-                                ts.PutCString (stop_desc);
+                            Thread *thread = thread_list.GetThreadAtIndex(thread_index).get();
+                            
+                            if (!thread)
+                            {
+                                ts.Printf("<?> ");
+                                continue;
+                            }
+                            
+                            ts.Printf("<0x%4.4llx ", thread->GetID());
+                            RegisterContext *register_context = thread->GetRegisterContext().get();
+                            
+                            if (register_context)
+                                ts.Printf("[ip 0x%llx] ", register_context->GetPC());
+                            else
+                                ts.Printf("[ip unknown] ");
+                            
+                            lldb::StopInfoSP stop_info_sp = thread->GetStopInfo();
+                            if (stop_info_sp)
+                            {
+                                const char *stop_desc = stop_info_sp->GetDescription();
+                                if (stop_desc)
+                                    ts.PutCString (stop_desc);
+                            }
+                            ts.Printf(">");
                         }
-                        ts.Printf(">");
+                        
+                        event_explanation = ts.GetData();
                     }
-                    
-                    event_explanation = ts.GetData();
                 } while (0);
                 
-                if (log)
-                {
-                    if (event_explanation)
-                        log->Printf("Process::RunThreadPlan(): execution interrupted: %s %s", s.GetData(), event_explanation);
-                    else
-                        log->Printf("Process::RunThreadPlan(): execution interrupted: %s", s.GetData());
-                }                
-                    
-                if (discard_on_error && thread_plan_sp)
-                {
-                    if (log)
-                        log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - discarding thread plans up to %p.", thread_plan_sp.get());
-                    thread->DiscardThreadPlansUpToPlan (thread_plan_sp);
-                    thread_plan_sp->SetPrivate (orig_plan_private);
-                }
+                if (event_explanation)
+                    log->Printf("Process::RunThreadPlan(): execution interrupted: %s %s", s.GetData(), event_explanation);
                 else
-                {
-                    if (log)
-                        log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - for plan: %p not discarding.", thread_plan_sp.get());
-
-                }
+                    log->Printf("Process::RunThreadPlan(): execution interrupted: %s", s.GetData());
+            }
+            
+            if (discard_on_error && thread_plan_sp)
+            {
+                if (log)
+                    log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - discarding thread plans up to %p.", thread_plan_sp.get());
+                thread->DiscardThreadPlansUpToPlan (thread_plan_sp);
+                thread_plan_sp->SetPrivate (orig_plan_private);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - for plan: %p not discarding.", thread_plan_sp.get());
             }
         }
         else if (return_value == eExecutionSetupError)

Modified: lldb/branches/apple/python-GIL/source/Target/TargetList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/TargetList.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/TargetList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/TargetList.cpp Mon Jul 30 09:29:39 2012
@@ -349,7 +349,7 @@
             Process* process = target_sp->GetProcessSP().get();
             if (process)
             {
-                process->BroadcastEvent (Process::eBroadcastBitInterrupt, NULL);
+                process->SendAsyncInterrupt();
                 ++num_async_interrupts_sent;
             }
         }

Modified: lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOut.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOut.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOut.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOut.cpp Mon Jul 30 09:29:39 2012
@@ -415,6 +415,7 @@
             {
                 SymbolContext inlined_sc;
                 inlined_block->CalculateSymbolContext(&inlined_sc);
+                inlined_sc.target_sp = GetTarget().shared_from_this();
                 RunMode run_mode = m_stop_others ? lldb::eOnlyThisThread : lldb::eAllThreads;
                 ThreadPlanStepOverRange *step_through_inline_plan_ptr = new ThreadPlanStepOverRange(m_thread, 
                                                                                                     inline_range, 

Modified: lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOverRange.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepOverRange.cpp Mon Jul 30 09:29:39 2012
@@ -110,7 +110,36 @@
         if (older_frame_sp)
         {
             const SymbolContext &older_context = older_frame_sp->GetSymbolContext(eSymbolContextEverything);
-            if (older_context == m_addr_context)
+            
+            // Match as much as is specified in the m_addr_context:
+            // This is a fairly loose sanity check.  Note, sometimes the target doesn't get filled
+            // in so I left out the target check.  And sometimes the module comes in as the .o file from the
+            // inlined range, so I left that out too...
+            
+            bool older_ctx_is_equivalent = false;
+            if (m_addr_context.comp_unit)
+            {
+                if (m_addr_context.comp_unit == older_context.comp_unit)
+                {
+                    if (m_addr_context.function && m_addr_context.function == older_context.function)
+                    {
+                        if (m_addr_context.block && m_addr_context.block == older_context.block)
+                        {
+                            older_ctx_is_equivalent = true;
+                            if (m_addr_context.line_entry.IsValid() && LineEntry::Compare(m_addr_context.line_entry, older_context.line_entry) != 0)
+                            {
+                                older_ctx_is_equivalent = false;
+                            }
+                        }
+                    }
+                }
+            }
+            else if (m_addr_context.symbol && m_addr_context.symbol == older_context.symbol)
+            {
+                older_ctx_is_equivalent = true;
+            }
+        
+            if (older_ctx_is_equivalent)
             {
                 new_plan = m_thread.QueueThreadPlanForStepOut (false, 
                                                            NULL, 

Modified: lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj Mon Jul 30 09:29:39 2012
@@ -480,7 +480,7 @@
 					i386,
 				);
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 189;
+				CURRENT_PROJECT_VERSION = 190;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
@@ -501,7 +501,7 @@
 					armv7s,
 				);
 				"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
-				CURRENT_PROJECT_VERSION = 189;
+				CURRENT_PROJECT_VERSION = 190;
 				DEAD_CODE_STRIPPING = YES;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -527,7 +527,7 @@
 					x86_64,
 					i386,
 				);
-				CURRENT_PROJECT_VERSION = 189;
+				CURRENT_PROJECT_VERSION = 190;
 				DEAD_CODE_STRIPPING = YES;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -546,7 +546,7 @@
 			buildSettings = {
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 189;
+				CURRENT_PROJECT_VERSION = 190;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -599,7 +599,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 189;
+				CURRENT_PROJECT_VERSION = 190;
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
 					"$(SDKROOT)/System/Library/PrivateFrameworks",
@@ -651,7 +651,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 189;
+				CURRENT_PROJECT_VERSION = 190;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (

Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp Mon Jul 30 09:29:39 2012
@@ -1797,6 +1797,19 @@
     return INVALID_NUB_THREAD;
 }
 
+//----------------------------------------------------------------------
+// Do whatever is needed to sync the thread's register state with it's kernel values.
+//----------------------------------------------------------------------
+nub_bool_t
+DNBProcessSyncThreadState (nub_process_t pid, nub_thread_t tid)
+{
+    MachProcessSP procSP;
+    if (GetProcessSP (pid, procSP))
+        return procSP->SyncThreadState (tid);
+    return false;
+
+}
+
 nub_addr_t
 DNBProcessGetSharedLibraryInfoAddress (nub_process_t pid)
 {

Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.h?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.h (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.h Mon Jul 30 09:29:39 2012
@@ -79,6 +79,7 @@
 nub_thread_t    DNBProcessGetCurrentThread              (nub_process_t pid) DNB_EXPORT;
 nub_thread_t    DNBProcessSetCurrentThread              (nub_process_t pid, nub_thread_t tid) DNB_EXPORT;
 nub_thread_t    DNBProcessGetThreadAtIndex              (nub_process_t pid, nub_size_t thread_idx) DNB_EXPORT;
+nub_bool_t      DNBProcessSyncThreadState               (nub_process_t pid, nub_thread_t tid) DNB_EXPORT;
 nub_addr_t      DNBProcessGetSharedLibraryInfoAddress   (nub_process_t pid) DNB_EXPORT;
 nub_bool_t      DNBProcessSharedLibrariesUpdated        (nub_process_t pid) DNB_EXPORT;
 nub_size_t      DNBProcessGetSharedLibraryInfo          (nub_process_t pid, nub_bool_t only_changed, DNBExecutableImageInfo **image_infos) DNB_EXPORT;

Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp Mon Jul 30 09:29:39 2012
@@ -151,6 +151,22 @@
     return m_thread_list.ThreadIDAtIndex(thread_idx);
 }
 
+nub_bool_t
+MachProcess::SyncThreadState (nub_thread_t tid)
+{
+    MachThreadSP thread_sp(m_thread_list.GetThreadByID(tid));
+    if (!thread_sp)
+        return false;
+    kern_return_t kret = ::thread_abort_safely(thread_sp->ThreadID());
+    DNBLogThreadedIf (LOG_THREAD, "thread = 0x%4.4x calling thread_abort_safely (tid) => %u (GetGPRState() for stop_count = %u)", thread_sp->ThreadID(), kret, thread_sp->Process()->StopCount());
+
+    if (kret == KERN_SUCCESS)
+        return true;
+    else
+        return false;
+    
+}
+
 nub_thread_t
 MachProcess::GetCurrentThread ()
 {

Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.h?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.h (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.h Mon Jul 30 09:29:39 2012
@@ -159,6 +159,7 @@
                             GetRegisterSetInfo (nub_thread_t tid, nub_size_t *num_reg_sets) const;
     bool                    GetRegisterValue (nub_thread_t tid, uint32_t set, uint32_t reg, DNBRegisterValue *reg_value) const;
     bool                    SetRegisterValue (nub_thread_t tid, uint32_t set, uint32_t reg, const DNBRegisterValue *value) const;
+    nub_bool_t              SyncThreadState (nub_thread_t tid);
     const char *            ThreadGetName (nub_thread_t tid);
     nub_state_t             ThreadGetState (nub_thread_t tid);
     nub_size_t              GetNumThreads () const;

Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp Mon Jul 30 09:29:39 2012
@@ -155,9 +155,6 @@
 {
     if (force || m_state.GetError(e_regSetGPR, Read))
     {
-        kern_return_t kret = ::thread_abort_safely(m_thread->ThreadID());
-        DNBLogThreadedIf (LOG_THREAD, "thread = 0x%4.4x calling thread_abort_safely (tid) => %u (GetGPRState() for stop_count = %u)", m_thread->ThreadID(), kret, m_thread->Process()->StopCount());    
-
 #if DEBUG_GPR_VALUES
         m_state.context.gpr.__rax = ('a' << 8) + 'x';
         m_state.context.gpr.__rbx = ('b' << 8) + 'x';

Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp Mon Jul 30 09:29:39 2012
@@ -171,6 +171,7 @@
     t.push_back (Packet (query_shlib_notify_info_addr,  &RNBRemote::HandlePacket_qShlibInfoAddr,NULL, "qShlibInfoAddr", "Returns the address that contains info needed for getting shared library notifications"));
     t.push_back (Packet (query_step_packet_supported,   &RNBRemote::HandlePacket_qStepPacketSupported,NULL, "qStepPacketSupported", "Replys with OK if the 's' packet is supported."));
     t.push_back (Packet (query_vattachorwait_supported, &RNBRemote::HandlePacket_qVAttachOrWaitSupported,NULL, "qVAttachOrWaitSupported", "Replys with OK if the 'vAttachOrWait' packet is supported."));
+    t.push_back (Packet (query_sync_thread_state_supported, &RNBRemote::HandlePacket_qSyncThreadStateSupported,NULL, "qSyncThreadStateSupported", "Replys with OK if the 'QSyncThreadState:' packet is supported."));
     t.push_back (Packet (query_host_info,               &RNBRemote::HandlePacket_qHostInfo,     NULL, "qHostInfo", "Replies with multiple 'key:value;' tuples appended to each other."));
 //  t.push_back (Packet (query_symbol_lookup,           &RNBRemote::HandlePacket_UNIMPLEMENTED, NULL, "qSymbol", "Notify that host debugger is ready to do symbol lookups"));
     t.push_back (Packet (start_noack_mode,              &RNBRemote::HandlePacket_QStartNoAckMode        , NULL, "QStartNoAckMode", "Request that " DEBUGSERVER_PROGRAM_NAME " stop acking remote protocol packets"));
@@ -187,6 +188,7 @@
     t.push_back (Packet (set_stderr,                    &RNBRemote::HandlePacket_QSetSTDIO              , NULL, "QSetSTDERR:", "Set the standard error for a process to be launched with the 'A' packet"));
     t.push_back (Packet (set_working_dir,               &RNBRemote::HandlePacket_QSetWorkingDir         , NULL, "QSetWorkingDir:", "Set the working directory for a process to be launched with the 'A' packet"));
     t.push_back (Packet (set_list_threads_in_stop_reply,&RNBRemote::HandlePacket_QListThreadsInStopReply , NULL, "QListThreadsInStopReply", "Set if the 'threads' key should be added to the stop reply packets with a list of all thread IDs."));
+    t.push_back (Packet (sync_thread_state,             &RNBRemote::HandlePacket_QSyncThreadState , NULL, "QSyncThreadState:", "Do whatever is necessary to make sure 'thread' is in a safe state to call functions on."));
 //  t.push_back (Packet (pass_signals_to_inferior,      &RNBRemote::HandlePacket_UNIMPLEMENTED, NULL, "QPassSignals:", "Specify which signals are passed to the inferior"));
     t.push_back (Packet (allocate_memory,               &RNBRemote::HandlePacket_AllocateMemory, NULL, "_M", "Allocate memory in the inferior process."));
     t.push_back (Packet (deallocate_memory,             &RNBRemote::HandlePacket_DeallocateMemory, NULL, "_m", "Deallocate memory in the inferior process."));
@@ -1304,6 +1306,13 @@
 }
 
 rnb_err_t
+RNBRemote::HandlePacket_qSyncThreadStateSupported (const char *p)
+{
+    // We support attachOrWait meaning attach if the process exists, otherwise wait to attach.
+    return SendPacket("OK");
+}
+
+rnb_err_t
 RNBRemote::HandlePacket_qVAttachOrWaitSupported (const char *p)
 {
     // We support attachOrWait meaning attach if the process exists, otherwise wait to attach.
@@ -1881,6 +1890,30 @@
 }
 
 rnb_err_t
+RNBRemote::HandlePacket_QSyncThreadState (const char *p)
+{
+    if (!m_ctx.HasValidProcessID())
+    {
+        // We allow gdb to connect to a server that hasn't started running
+        // the target yet.  gdb still wants to ask questions about it and
+        // freaks out if it gets an error.  So just return OK here.
+        return SendPacket ("OK");
+    }
+
+    errno = 0;
+    p += strlen("QSyncThreadState:");
+    nub_thread_t tid = strtoul (p, NULL, 16);
+    if (errno != 0 && tid == 0)
+    {
+        return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "Invalid thread number in QSyncThreadState packet");
+    }
+    if (DNBProcessSyncThreadState(m_ctx.ProcessID(), tid))
+        return SendPacket("OK");
+    else
+        return SendPacket ("E61");
+}
+
+rnb_err_t
 RNBRemote::HandlePacket_QListThreadsInStopReply (const char *p)
 {
     // If this packet is received, it allows us to send an extra key/value

Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.h?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.h (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.h Mon Jul 30 09:29:39 2012
@@ -93,6 +93,7 @@
         query_shlib_notify_info_addr,   // 'qShlibInfoAddr'
         query_step_packet_supported,    // 'qStepPacketSupported'
         query_vattachorwait_supported,  // 'qVAttachOrWaitSupported'
+        query_sync_thread_state_supported,// 'QSyncThreadState'
         query_host_info,                // 'qHostInfo'
         pass_signals_to_inferior,       // 'QPassSignals'
         start_noack_mode,               // 'QStartNoAckMode'
@@ -109,6 +110,7 @@
         set_stderr,                     // 'QSetSTDERR:'
         set_working_dir,                // 'QSetWorkingDir:'
         set_list_threads_in_stop_reply, // 'QListThreadsInStopReply:'
+        sync_thread_state,              // 'QSyncThreadState:'
         memory_region_info,             // 'qMemoryRegionInfo:'
         watchpoint_support_info,        // 'qWatchpointSupportInfo:'
         allocate_memory,                // '_M'
@@ -167,6 +169,7 @@
     rnb_err_t HandlePacket_qShlibInfoAddr (const char *p);
     rnb_err_t HandlePacket_qStepPacketSupported (const char *p);
     rnb_err_t HandlePacket_qVAttachOrWaitSupported (const char *p);
+    rnb_err_t HandlePacket_qSyncThreadStateSupported (const char *p);
     rnb_err_t HandlePacket_qThreadInfo (const char *p);
     rnb_err_t HandlePacket_qThreadExtraInfo (const char *p);
     rnb_err_t HandlePacket_qThreadStopInfo (const char *p);
@@ -183,6 +186,7 @@
     rnb_err_t HandlePacket_QEnvironmentHexEncoded (const char *p);
     rnb_err_t HandlePacket_QLaunchArch (const char *p);
     rnb_err_t HandlePacket_QListThreadsInStopReply (const char *p);
+    rnb_err_t HandlePacket_QSyncThreadState (const char *p);
     rnb_err_t HandlePacket_QPrefixRegisterPacketsWithThreadID (const char *p);
     rnb_err_t HandlePacket_last_signal (const char *p);
     rnb_err_t HandlePacket_m (const char *p);

Modified: lldb/branches/apple/python-GIL/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/driver/Driver.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/driver/Driver.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/driver/Driver.cpp Mon Jul 30 09:29:39 2012
@@ -1080,11 +1080,12 @@
     case eInputReaderInterrupt:
         if (driver->m_io_channel_ap.get() != NULL)
         {
-            SBProcess process = driver->GetDebugger().GetSelectedTarget().GetProcess();
+            SBProcess process(driver->GetDebugger().GetSelectedTarget().GetProcess());
             if (!driver->m_io_channel_ap->EditLineHasCharacters()
-                &&  process.IsValid() && process.GetState() == lldb::eStateRunning)
+                &&  process.IsValid()
+                && (process.GetState() == lldb::eStateRunning || process.GetState() == lldb::eStateAttaching))
             {
-                process.Stop();
+                process.SendAsyncInterrupt ();
             }
             else
             {

Modified: lldb/branches/apple/python-GIL/tools/driver/IOChannel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/driver/IOChannel.cpp?rev=160960&r1=160959&r2=160960&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/driver/IOChannel.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/driver/IOChannel.cpp Mon Jul 30 09:29:39 2012
@@ -55,7 +55,15 @@
 {
     const LineInfo *line_info  = el_line(m_edit_line);
     if (line_info)
-        return line_info->cursor != line_info->buffer;
+    {
+        // Sometimes we get called after the user has submitted the line, but before editline has
+        // cleared the buffer.  In that case the cursor will be pointing at the newline.  That's
+        // equivalent to having no characters on the line, since it has already been submitted.
+        if (*line_info->cursor == '\n')
+            return false;
+        else
+            return line_info->cursor != line_info->buffer;
+    }
     else
         return false;
 }





More information about the lldb-commits mailing list