This patch fixes the codesigning of debugserver on OSX when built with
cmake.  Without this you get this error when debugging:
    error: process launch failed: unable to locate debugserver
Please review and commit if OK?

Note: you also need to set LLDB_DEBUGSERVER_PATH to point to your built 
debugserver
or you will get the same error.  E.g. apply patch then:
    cd <builddir>
    rm -f bin/debugserver
    ninja
    export LLDB_DEBUGSERVER_PATH=`pwd`/bin/debugserver
Index: tools/debugserver/source/CMakeLists.txt
===================================================================
--- tools/debugserver/source/CMakeLists.txt     (revision 218687)
+++ tools/debugserver/source/CMakeLists.txt     (working copy)
@@ -7,7 +7,7 @@
   include_directories(MacOSX)
   #include_directories(${CMAKE_CURRENT_BINARY_DIR}/MacOSX)
 
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ 
-Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/../resources/lldb-debugserver-Info.plist")
 endif()
 
 add_definitions(
Index: tools/debugserver/source/MacOSX/CMakeLists.txt
===================================================================
--- tools/debugserver/source/MacOSX/CMakeLists.txt      (revision 218687)
+++ tools/debugserver/source/MacOSX/CMakeLists.txt      (working copy)
@@ -60,7 +60,9 @@
   )
 add_custom_command(TARGET debugserver
   POST_BUILD
-  COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements 
${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign 
${CODESIGN_IDENTITY} debugserver
+  # --entitlements option removed, as it causes errors when debugging.
+  #was: COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements 
${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign 
${CODESIGN_IDENTITY} debugserver
+  COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign 
${CODESIGN_IDENTITY} debugserver
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
   )
 
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to