[Lldb-commits] [lldb] r212208 - Removing Carbon dependency by removing obsolete code.

Jean-Daniel Dupas devlists at shadowlab.org
Wed Jul 2 12:37:26 PDT 2014


Author: jddupas
Date: Wed Jul  2 14:37:25 2014
New Revision: 212208

URL: http://llvm.org/viewvc/llvm-project?rev=212208&view=rev
Log:
Removing Carbon dependency by removing obsolete code.
The only part using Carbon is a function in Host.mm used to open a file in Xcode.
That code is broken and it is no longer useful as Xcode supports LLDB natively.


Modified:
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Host/macosx/Host.mm

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=212208&r1=212207&r2=212208&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jul  2 14:37:25 2014
@@ -1783,7 +1783,6 @@
 		4C626533130F1B0A00C889F6 /* StreamTee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamTee.h; path = include/lldb/Core/StreamTee.h; sourceTree = "<group>"; };
 		4C66499F14EEE7F100B0316F /* StreamCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamCallback.h; path = include/lldb/Core/StreamCallback.h; sourceTree = "<group>"; };
 		4C6649A214EEE81000B0316F /* StreamCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamCallback.cpp; path = source/Core/StreamCallback.cpp; sourceTree = "<group>"; };
-		4C74CB6212288704006A8171 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
 		4C7CF7E31295E10E00B4FBB5 /* ThreadPlanCallUserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallUserExpression.h; path = include/lldb/Target/ThreadPlanCallUserExpression.h; sourceTree = "<group>"; };
 		4C7CF7E51295E12B00B4FBB5 /* ThreadPlanCallUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallUserExpression.cpp; path = source/Target/ThreadPlanCallUserExpression.cpp; sourceTree = "<group>"; };
 		4C98D3DA118FB96F00E575D0 /* ClangFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangFunction.cpp; path = source/Expression/ClangFunction.cpp; sourceTree = "<group>"; };
@@ -3833,7 +3832,6 @@
 				26F5C32B10F3DFDD009D5894 /* libtermcap.dylib */,
 				26D55234159A7DB100708D8D /* libxml2.dylib */,
 				966C6B7818E6A56A0093F5EC /* libz.dylib */,
-				4C74CB6212288704006A8171 /* Carbon.framework */,
 				EDB919B414F6F10D008FF64B /* Security.framework */,
 			);
 			name = Libraries;
@@ -5408,8 +5406,6 @@
 					"-framework",
 					Foundation,
 					"-framework",
-					Carbon,
-					"-framework",
 					DebugSymbols,
 					"-framework",
 					Security,
@@ -5469,8 +5465,6 @@
 					"-framework",
 					Foundation,
 					"-framework",
-					Carbon,
-					"-framework",
 					DebugSymbols,
 					"-framework",
 					Security,
@@ -5805,8 +5799,6 @@
 					"-framework",
 					Foundation,
 					"-framework",
-					Carbon,
-					"-framework",
 					DebugSymbols,
 					"-framework",
 					Security,
@@ -6613,8 +6605,6 @@
 					"-framework",
 					Foundation,
 					"-framework",
-					Carbon,
-					"-framework",
 					DebugSymbols,
 					"-framework",
 					Security,

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=212208&r1=212207&r2=212208&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Wed Jul  2 14:37:25 2014
@@ -63,10 +63,6 @@
 #include <CoreFoundation/CoreFoundation.h>
 #include <Foundation/Foundation.h>
 
-#if !defined(__arm__) && !defined(__arm64__)
-#include <Carbon/Carbon.h>
-#endif
-
 #ifndef _POSIX_SPAWN_DISABLE_ASLR
 #define _POSIX_SPAWN_DISABLE_ASLR       0x0100
 #endif
@@ -839,96 +835,7 @@ Host::OpenFileInExternalEditor (const Fi
 
         return false;
     }
-    
-    ProcessInfoRec which_process;
-    ::memset(&which_process, 0, sizeof(which_process));
-    unsigned char ap_name[PATH_MAX];
-    which_process.processName = ap_name;
-    error = ::GetProcessInformation (&psn, &which_process);
-    
-    bool using_xcode;
-    if (error != noErr)
-    {
-        if (log)
-            log->Printf("GetProcessInformation failed, error: %ld.\n", error);
-        using_xcode = false;
-    }
-    else
-        using_xcode = strncmp((char *) ap_name+1, "Xcode", (int) ap_name[0]) == 0;
-    
-    // Xcode doesn't obey the line number in the Open Apple Event.  So I have to send
-    // it an AppleScript to focus on the right line.
-    
-    if (using_xcode)
-    {
-        static ComponentInstance osa_component = NULL;
-        static const char *as_template = "tell application \"Xcode\"\n"
-                                   "set doc to the first document whose path is \"%s\"\n"
-                                   "set the selection to paragraph %d of doc\n"
-                                   "--- set the selected paragraph range to {%d, %d} of doc\n"
-                                   "end tell\n";
-        const int chars_for_int = 32;
-        static int as_template_len = strlen (as_template);
-
-      
-        char *as_str;
-        AEDesc as_desc;
-      
-        if (osa_component == NULL)
-        {
-            osa_component = ::OpenDefaultComponent (kOSAComponentType,
-                                                    kAppleScriptSubtype);
-        }
-        
-        if (osa_component == NULL)
-        {
-            if (log)
-                log->Printf("Could not get default AppleScript component.\n");
-            return false;
-        }
-
-        uint32_t as_str_size = as_template_len + strlen (file_path) + 3 * chars_for_int + 1;     
-        as_str = (char *) malloc (as_str_size);
-        ::snprintf (as_str, 
-                    as_str_size - 1, 
-                    as_template, 
-                    file_path, 
-                    line_no, 
-                    line_no, 
-                    line_no);
-
-        error = ::AECreateDesc (typeChar, 
-                                as_str, 
-                                strlen (as_str),
-                                &as_desc);
-        
-        ::free (as_str);
-
-        if (error != noErr)
-        {
-            if (log)
-                log->Printf("Failed to create AEDesc for Xcode AppleEvent: %ld.\n", error);
-            return false;
-        }
-            
-        OSAID ret_OSAID;
-        error = ::OSACompileExecute (osa_component, 
-                                     &as_desc, 
-                                     kOSANullScript, 
-                                     kOSAModeNeverInteract, 
-                                     &ret_OSAID);
-        
-        ::OSADispose (osa_component, ret_OSAID);
-
-        ::AEDisposeDesc (&as_desc);
 
-        if (error != noErr)
-        {
-            if (log)
-                log->Printf("Sending AppleEvent to Xcode failed, error: %ld.\n", error);
-            return false;
-        }
-    }
     return true;
 #endif // #if !defined(__arm__)
 }





More information about the lldb-commits mailing list