[Lldb-commits] [lldb] r366631 - [CMake] Align debugserver with lldb-server on Darwin

2019-07-20 Thread Stefan Granitz via lldb-commits
Author: stefan.graenitz
Date: Sat Jul 20 04:18:31 2019
New Revision: 366631

URL: http://llvm.org/viewvc/llvm-project?rev=366631&view=rev
Log:
[CMake] Align debugserver with lldb-server on Darwin

Summary: Make debugserver a tool like lldb-server, so it can be 
included/excluded via `LLDB_TOOL_DEBUGSERVER_BUILD`. This replaces the old 
`LLDB_NO_DEBUGSERVER` flag. Doing the same for darwin-debug while I am here.

Reviewers: xiaobai, JDevlieghere, davide

Reviewed By: xiaobai, JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64994

Modified:
lldb/trunk/cmake/modules/LLDBConfig.cmake
lldb/trunk/test/CMakeLists.txt
lldb/trunk/tools/CMakeLists.txt
lldb/trunk/unittests/CMakeLists.txt
lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=366631&r1=366630&r2=366631&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Sat Jul 20 04:18:31 2019
@@ -373,17 +373,17 @@ list(APPEND system_libs ${CMAKE_DL_LIBS}
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
 if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-  set(LLDB_CAN_USE_LLDB_SERVER 1)
+  set(LLDB_CAN_USE_LLDB_SERVER ON)
 else()
-  set(LLDB_CAN_USE_LLDB_SERVER 0)
+  set(LLDB_CAN_USE_LLDB_SERVER OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll
 # ensure we build debugserver when we build lldb.
-if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
-set(LLDB_CAN_USE_DEBUGSERVER 1)
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+set(LLDB_CAN_USE_DEBUGSERVER ON)
 else()
-set(LLDB_CAN_USE_DEBUGSERVER 0)
+set(LLDB_CAN_USE_DEBUGSERVER OFF)
 endif()
 
 if (NOT LLDB_DISABLE_CURSES)

Modified: lldb/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=366631&r1=366630&r2=366631&view=diff
==
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Sat Jul 20 04:18:31 2019
@@ -101,11 +101,18 @@ if(CMAKE_HOST_APPLE)
 lldb_find_system_debugserver(system_debugserver_path)
 message(STATUS "LLDB tests use out-of-tree debugserver: 
${system_debugserver_path}")
 list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver)
-  else()
+  elseif(TARGET debugserver)
 set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver)
 message(STATUS "LLDB Tests use just-built debugserver: 
${debugserver_path}")
 list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path})
 add_dependencies(lldb-test-deps debugserver)
+  elseif(TARGET lldb-server)
+set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server)
+message(STATUS "LLDB Tests use just-built lldb-server: 
${lldb_server_path}")
+list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path})
+add_dependencies(lldb-test-deps lldb-server)
+  else()
+message(WARNING "LLDB Tests enabled, but no server available")
   endif()
 endif()
 

Modified: lldb/trunk/tools/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/CMakeLists.txt?rev=366631&r1=366630&r2=366631&view=diff
==
--- lldb/trunk/tools/CMakeLists.txt (original)
+++ lldb/trunk/tools/CMakeLists.txt Sat Jul 20 04:18:31 2019
@@ -11,8 +11,8 @@ add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  add_subdirectory(darwin-debug)
-  add_subdirectory(debugserver)
+  add_lldb_tool_subdirectory(darwin-debug)
+  add_lldb_tool_subdirectory(debugserver)
 endif()
 
 if (LLDB_CAN_USE_LLDB_SERVER)

Modified: lldb/trunk/unittests/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=366631&r1=366630&r2=366631&view=diff
==
--- lldb/trunk/unittests/CMakeLists.txt (original)
+++ lldb/trunk/unittests/CMakeLists.txt Sat Jul 20 04:18:31 2019
@@ -78,6 +78,6 @@ add_subdirectory(tools)
 add_subdirectory(UnwindAssembly)
 add_subdirectory(Utility)
 
-if(LLDB_CAN_USE_DEBUGSERVER AND NOT LLDB_USE_SYSTEM_DEBUGSERVER)
+if(LLDB_CAN_USE_DEBUGSERVER AND LLDB_TOOL_DEBUGSERVER_BUILD AND NOT 
LLDB_USE_SYSTEM_DEBUGSERVER)
   add_subdirectory(debugserver)
 endif()

Modified: lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt?rev=366631&r1=366630&r2=366631&view=diff
==
--- lldb/tr

[Lldb-commits] [PATCH] D64994: [CMake] Align debugserver with lldb-server on Darwin

2019-07-20 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366631: [CMake] Align debugserver with lldb-server on Darwin 
(authored by stefan.graenitz, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64994?vs=210832&id=210951#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64994/new/

https://reviews.llvm.org/D64994

Files:
  lldb/trunk/cmake/modules/LLDBConfig.cmake
  lldb/trunk/test/CMakeLists.txt
  lldb/trunk/tools/CMakeLists.txt
  lldb/trunk/unittests/CMakeLists.txt
  lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt


Index: lldb/trunk/cmake/modules/LLDBConfig.cmake
===
--- lldb/trunk/cmake/modules/LLDBConfig.cmake
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake
@@ -373,17 +373,17 @@
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
 if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-  set(LLDB_CAN_USE_LLDB_SERVER 1)
+  set(LLDB_CAN_USE_LLDB_SERVER ON)
 else()
-  set(LLDB_CAN_USE_LLDB_SERVER 0)
+  set(LLDB_CAN_USE_LLDB_SERVER OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll
 # ensure we build debugserver when we build lldb.
-if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
-set(LLDB_CAN_USE_DEBUGSERVER 1)
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+set(LLDB_CAN_USE_DEBUGSERVER ON)
 else()
-set(LLDB_CAN_USE_DEBUGSERVER 0)
+set(LLDB_CAN_USE_DEBUGSERVER OFF)
 endif()
 
 if (NOT LLDB_DISABLE_CURSES)
Index: lldb/trunk/test/CMakeLists.txt
===
--- lldb/trunk/test/CMakeLists.txt
+++ lldb/trunk/test/CMakeLists.txt
@@ -101,11 +101,18 @@
 lldb_find_system_debugserver(system_debugserver_path)
 message(STATUS "LLDB tests use out-of-tree debugserver: 
${system_debugserver_path}")
 list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver)
-  else()
+  elseif(TARGET debugserver)
 set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver)
 message(STATUS "LLDB Tests use just-built debugserver: 
${debugserver_path}")
 list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path})
 add_dependencies(lldb-test-deps debugserver)
+  elseif(TARGET lldb-server)
+set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server)
+message(STATUS "LLDB Tests use just-built lldb-server: 
${lldb_server_path}")
+list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path})
+add_dependencies(lldb-test-deps lldb-server)
+  else()
+message(WARNING "LLDB Tests enabled, but no server available")
   endif()
 endif()
 
Index: lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
===
--- lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
+++ lldb/trunk/unittests/tools/lldb-server/CMakeLists.txt
@@ -13,7 +13,7 @@
 add_lldb_test_executable(thread_inferior inferior/thread_inferior.cpp)
 add_lldb_test_executable(environment_check inferior/environment_check.cpp)
 
-if(LLDB_CAN_USE_DEBUGSERVER)
+if(LLDB_CAN_USE_DEBUGSERVER AND LLDB_TOOL_DEBUGSERVER_BUILD)
   if(LLDB_USE_SYSTEM_DEBUGSERVER)
 lldb_find_system_debugserver(debugserver_path)
   else()
Index: lldb/trunk/unittests/CMakeLists.txt
===
--- lldb/trunk/unittests/CMakeLists.txt
+++ lldb/trunk/unittests/CMakeLists.txt
@@ -78,6 +78,6 @@
 add_subdirectory(UnwindAssembly)
 add_subdirectory(Utility)
 
-if(LLDB_CAN_USE_DEBUGSERVER AND NOT LLDB_USE_SYSTEM_DEBUGSERVER)
+if(LLDB_CAN_USE_DEBUGSERVER AND LLDB_TOOL_DEBUGSERVER_BUILD AND NOT 
LLDB_USE_SYSTEM_DEBUGSERVER)
   add_subdirectory(debugserver)
 endif()
Index: lldb/trunk/tools/CMakeLists.txt
===
--- lldb/trunk/tools/CMakeLists.txt
+++ lldb/trunk/tools/CMakeLists.txt
@@ -11,8 +11,8 @@
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  add_subdirectory(darwin-debug)
-  add_subdirectory(debugserver)
+  add_lldb_tool_subdirectory(darwin-debug)
+  add_lldb_tool_subdirectory(debugserver)
 endif()
 
 if (LLDB_CAN_USE_LLDB_SERVER)


Index: lldb/trunk/cmake/modules/LLDBConfig.cmake
===
--- lldb/trunk/cmake/modules/LLDBConfig.cmake
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake
@@ -373,17 +373,17 @@
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
 if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-  set(LLDB_CAN_USE_LLDB_SERVER 1)
+  set(LLDB_CAN_USE_LLDB_SERVER ON)
 else()
-  set(LLDB_CAN_USE_LLDB_SERVER 0)
+  set(LLDB_CAN_USE_LLDB_SERVER OFF)
 endif()
 
 # Figure out if lldb could use d

[Lldb-commits] [PATCH] D65025: [Symbol] Improve TypeSystemMap mutex safety

2019-07-20 Thread Noel Grandin via Phabricator via lldb-commits
grandinj added a comment.

Maybe make AddMap take a lock_guard parameter as recommended here

  
https://stackoverflow.com/questions/28825749/ensuring-that-current-thread-holds-a-lock-on-a-c11-mutex

?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65025/new/

https://reviews.llvm.org/D65025



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r366639 - build: allow the user to specify `llvm-tblgen`

2019-07-20 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Sat Jul 20 10:59:08 2019
New Revision: 366639

URL: http://llvm.org/viewvc/llvm-project?rev=366639&view=rev
Log:
build: allow the user to specify `llvm-tblgen`

This follows the same pattern as Clang and permits the user to specify
the tablegen to use via `-DLLVM_TABLEGEN=`.  This allows for
cross-compiling LLDB for a foreign target (e.g. Windows ARM64 on Windows
X64).  The LLVM dependency for LLDB in that case must be a Windows ARM64
build which cannot cross-compile llvm-tblgen due to the way that Visual
Studio works.  Instead, permit the user to have a separate tablegen
build which can be used during the build.

Modified:
lldb/trunk/cmake/modules/LLDBStandalone.cmake

Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=366639&r1=366638&r2=366639&view=diff
==
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Sat Jul 20 10:59:08 2019
@@ -31,31 +31,35 @@ append_configuration_directories(${LLVM_
 find_program(lit_full_path ${lit_file_name} ${config_dirs} NO_DEFAULT_PATH)
 set(LLVM_DEFAULT_EXTERNAL_LIT ${lit_full_path} CACHE PATH "Path to llvm-lit")
 
-if(CMAKE_CROSSCOMPILING)
-  set(LLVM_NATIVE_BUILD "${LLVM_BINARY_DIR}/NATIVE")
-  if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
-message(FATAL_ERROR
-  "Attempting to cross-compile LLDB standalone but no native LLVM build
-  found. Please cross-compile LLVM as well.")
-  endif()
+if(LLVM_TABLEGEN)
+  set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN})
+else()
+  if(CMAKE_CROSSCOMPILING)
+set(LLVM_NATIVE_BUILD "${LLVM_BINARY_DIR}/NATIVE")
+if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
+  message(FATAL_ERROR
+"Attempting to cross-compile LLDB standalone but no native LLVM build
+found. Please cross-compile LLVM as well.")
+endif()
 
-  if (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
-set(HOST_EXECUTABLE_SUFFIX ".exe")
-  endif()
+if (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+  set(HOST_EXECUTABLE_SUFFIX ".exe")
+endif()
 
-  if (NOT CMAKE_CONFIGURATION_TYPES)
-set(LLVM_TABLEGEN_EXE
-  "${LLVM_NATIVE_BUILD}/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+if (NOT CMAKE_CONFIGURATION_TYPES)
+  set(LLVM_TABLEGEN_EXE
+"${LLVM_NATIVE_BUILD}/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+else()
+  # NOTE: LLVM NATIVE build is always built Release, as is specified in
+  # CrossCompile.cmake
+  set(LLVM_TABLEGEN_EXE
+
"${LLVM_NATIVE_BUILD}/Release/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+endif()
   else()
-# NOTE: LLVM NATIVE build is always built Release, as is specified in
-# CrossCompile.cmake
-set(LLVM_TABLEGEN_EXE
-  "${LLVM_NATIVE_BUILD}/Release/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
+set(tblgen_file_name "llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
+append_configuration_directories(${LLVM_TOOLS_BINARY_DIR} config_dirs)
+find_program(LLVM_TABLEGEN_EXE ${tblgen_file_name} ${config_dirs} 
NO_DEFAULT_PATH)
   endif()
-else()
-  set(tblgen_file_name "llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")
-  append_configuration_directories(${LLVM_TOOLS_BINARY_DIR} config_dirs)
-  find_program(LLVM_TABLEGEN_EXE ${tblgen_file_name} ${config_dirs} 
NO_DEFAULT_PATH)
 endif()
 
 # They are used as destination of target generators.


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits