Index: docs/code-signing.txt =================================================================== --- docs/code-signing.txt +++ docs/code-signing.txt @@ -1,6 +1,11 @@ -On MacOSX lldb needs to be code signed. The Debug, DebugClang and Release -builds are set to code sign using a code signing certificate named -"lldb_codesign". +To use the in-tree debug server on macOS, lldb needs to be code signed. The +Debug, DebugClang and Release builds are set to code sign using a code signing +certificate named "lldb_codesign". This document explains how to set up the +signing certificate. + +Note that it is possible build and use lldb on macOS without setting up code +signing by using the system's debug server. To configure lldb in this way with +cmake, specify -DLLDB_CODESIGN_IDENTITY=''. If you have re-installed a new OS, please delete all old lldb_codesign items from your keychain. There will be a code signing certification and a public Index: test/CMakeLists.txt =================================================================== --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -25,7 +25,9 @@ endif() if(TARGET debugserver) - list(APPEND LLDB_TEST_DEPS debugserver) + if(NOT CMAKE_HOST_APPLE OR LLDB_CODESIGN_IDENTITY) + list(APPEND LLDB_TEST_DEPS debugserver) + endif() endif() if(TARGET lldb-mi) @@ -95,7 +97,17 @@ endif() if(CMAKE_HOST_APPLE) - list(APPEND LLDB_TEST_COMMON_ARGS --server $) + if(LLDB_CODESIGN_IDENTITY) + list(APPEND LLDB_TEST_COMMON_ARGS --server $) + else() + execute_process( + COMMAND xcode-select -p + OUTPUT_VARIABLE XCODE_DEV_DIR) + string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR) + set(SYSTEM_DEBUGSERVER + "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver") + list(APPEND LLDB_TEST_COMMON_ARGS --server ${SYSTEM_DEBUGSERVER}) + endif() endif() set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})