Use llvm_codesign to sign debugserver with entitlements. Handle reconfigurations correctly. We have a lot of cases, make them explicit:
(1) build and sign debugserver, if all conditions apply:
- LLDB_NO_DEBUGSERVER=OFF (default)
- On Darwin: LLDB_USE_SYSTEM_DEBUGSERVER=OFF (default)
- On Darwin: LLVM_CODESIGNING_IDENTITY == lldb_codesign
(2) use system debugserver, if on Darwin and any of:
- LLDB_USE_SYSTEM_DEBUGSERVER=ON and debugserver found on system (explicit case)
- LLVM_CODESIGNING_IDENTITY != lldb_codesign and debugserver found on system (fallback case)
(3) debugserver will not be available, in case of:
- LLDB_NO_DEBUGSERVER=ON
- On Darwin: LLVM_CODESIGNING_IDENTITY != lldb_codesign and debugserver not found on system
(4) error state, in case of:
- LLDB_USE_SYSTEM_DEBUGSERVER=ON and debugserver not found on system
- LLDB_USE_SYSTEM_DEBUGSERVER=ON and LLDB_NO_DEBUGSERVER=ON