[Lldb-commits] [PATCH] D43419: Fix TestBreakpointInGlobalConstructor for Windows

2018-02-17 Thread Pavel Labath via Phabricator via lldb-commits
labath requested changes to this revision.
labath added a comment.
This revision now requires changes to proceed.

Yeah, setting this to zero would break other platforms that are able to locate 
shared libraries before running the executable. On linux, we try to locate them 
as well, but it's kind of on a best-effort basis  -- it's quite hard to figure 
out what library will get loaded with absolute precision, as it can e.g. depend 
on the value of LD_LIBRARY_PATH env var that you run the process with (and you 
don't know that until the actual "process launch" command). In fact, it 
wouldn't be hard to come up with examples where this static resolution finds 
the wrong library.

So, it sounds to me like we do need a special flag for "zero or more" 
breakpoint locations for tests which don't care about this behavior such as 
this one. Maybe num_expected_locations=-2 (I think we should leave "0" meaning 
"exactly zero", as that can be useful in some situations). In fact I know of at 
least one other test that could use something like this (I've had to disable 
some tests in TestLoadUnload on linux because the out-of-tree build caused the 
automatic library lookup to not work).

Of course being able to resolve DLL dependencies statically like other 
platforms would be nice, but that's quite orthogonal to this what this test is 
doing. (Here the purpose is to check that we set the breakpoint early enough -- 
before the global constructor executes).


https://reviews.llvm.org/D43419



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


[Lldb-commits] [PATCH] D43432: [cmake] Fix LLDB_CODESIGN_IDENTITY logic.

2018-02-17 Thread Vedant Kumar via Phabricator via lldb-commits
vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.

Thanks, lgtm!


https://reviews.llvm.org/D43432



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


[Lldb-commits] [lldb] r325442 - [cmake] Fix LLDB_CODESIGN_IDENTITY logic.

2018-02-17 Thread Don Hinton via lldb-commits
Author: dhinton
Date: Sat Feb 17 11:17:21 2018
New Revision: 325442

URL: http://llvm.org/viewvc/llvm-project?rev=325442&view=rev
Log:
[cmake] Fix LLDB_CODESIGN_IDENTITY logic.

Summary:
Consolidate LLDB_CODESIGN_IDENTITY logic in one place and use
SKIP_DEBUGSERVER, which can be set independently, to control
codesigning targets.

Currently, running cmake the first time in a clean directory, without
passing -DLLDB_CODESIGN_IDENTITY='', fails.  However, subsequent runs
succeed.  That's because LLDB_CODESIGN_IDENTITY gets added to the
CACHE after the initial test.  To fix that, the default value must be
set before it's tested.

Here's the error produced on the first run:

CMake Error at tools/lldb/tools/debugserver/source/CMakeLists.txt:215 
(add_custom_command):
  No TARGET 'debugserver' has been created in this directory.

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

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/tools/debugserver/source/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=325442&r1=325441&r2=325442&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Sat Feb 17 11:17:21 2018
@@ -57,21 +57,6 @@ if (NOT LLDB_DISABLE_PYTHON)
   add_subdirectory(scripts)
 endif ()
 
-if(CMAKE_HOST_APPLE)
-  if(LLDB_CODESIGN_IDENTITY)
-set(DEBUGSERVER_PATH $)
-  else()
-execute_process(
-  COMMAND xcode-select -p
-  OUTPUT_VARIABLE XCODE_DEV_DIR)
-string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
-set(DEBUGSERVER_PATH
-  
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
-set(SKIP_DEBUGSERVER True)
-  endif()
-  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
-endif()
-
 add_subdirectory(source)
 add_subdirectory(tools)
 

Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=325442&r1=325441&r2=325442&view=diff
==
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Sat Feb 17 11:17:21 2018
@@ -95,6 +95,22 @@ set(lldbDebugserverCommonSources
 add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
 
 
+set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
+  CACHE STRING "Identity used for code signing. Set to empty string to skip 
the signing step.")
+
+if(NOT LLDB_CODESIGN_IDENTITY STREQUAL "")
+  set(DEBUGSERVER_PATH $)
+else()
+  execute_process(
+COMMAND xcode-select -p
+OUTPUT_VARIABLE XCODE_DEV_DIR)
+  string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
+  set(DEBUGSERVER_PATH
+
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
+  set(SKIP_DEBUGSERVER True)
+endif()
+message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
+
 if (APPLE)
   if(IOS)
 find_library(BACKBOARD_LIBRARY BackBoardServices
@@ -187,15 +203,13 @@ if(IOS)
   set(entitlements_xml 
${CMAKE_CURRENT_SOURCE_DIR}/debugserver-entitlements.plist)
 endif()
 
-set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
-  CACHE STRING "Identity used for code signing. Set to empty string to skip 
the signing step.")
 set(LLDB_USE_ENTITLEMENTS_Default On)
 if("${LLDB_CODESIGN_IDENTITY}" STREQUAL "lldb_codesign")
   set(LLDB_USE_ENTITLEMENTS_Default Off)
 endif()
 option(LLDB_USE_ENTITLEMENTS "Use entitlements when codesigning (Defaults Off 
when using lldb_codesign identity, otherwise On)" 
${LLDB_USE_ENTITLEMENTS_Default})
 
-if ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "")
+if (SKIP_DEBUGSERVER)
   if (CMAKE_HOST_APPLE)
 # If we haven't built a signed debugserver, copy the one from the system.
 add_custom_target(debugserver


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


[Lldb-commits] [PATCH] D43432: [cmake] Fix LLDB_CODESIGN_IDENTITY logic.

2018-02-17 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL325442: [cmake] Fix LLDB_CODESIGN_IDENTITY logic. (authored 
by dhinton, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D43432

Files:
  lldb/trunk/CMakeLists.txt
  lldb/trunk/tools/debugserver/source/CMakeLists.txt


Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -57,21 +57,6 @@
   add_subdirectory(scripts)
 endif ()
 
-if(CMAKE_HOST_APPLE)
-  if(LLDB_CODESIGN_IDENTITY)
-set(DEBUGSERVER_PATH $)
-  else()
-execute_process(
-  COMMAND xcode-select -p
-  OUTPUT_VARIABLE XCODE_DEV_DIR)
-string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
-set(DEBUGSERVER_PATH
-  
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
-set(SKIP_DEBUGSERVER True)
-  endif()
-  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
-endif()
-
 add_subdirectory(source)
 add_subdirectory(tools)
 
Index: lldb/trunk/tools/debugserver/source/CMakeLists.txt
===
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt
@@ -95,6 +95,22 @@
 add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
 
 
+set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
+  CACHE STRING "Identity used for code signing. Set to empty string to skip 
the signing step.")
+
+if(NOT LLDB_CODESIGN_IDENTITY STREQUAL "")
+  set(DEBUGSERVER_PATH $)
+else()
+  execute_process(
+COMMAND xcode-select -p
+OUTPUT_VARIABLE XCODE_DEV_DIR)
+  string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
+  set(DEBUGSERVER_PATH
+
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
+  set(SKIP_DEBUGSERVER True)
+endif()
+message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
+
 if (APPLE)
   if(IOS)
 find_library(BACKBOARD_LIBRARY BackBoardServices
@@ -187,15 +203,13 @@
   set(entitlements_xml 
${CMAKE_CURRENT_SOURCE_DIR}/debugserver-entitlements.plist)
 endif()
 
-set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
-  CACHE STRING "Identity used for code signing. Set to empty string to skip 
the signing step.")
 set(LLDB_USE_ENTITLEMENTS_Default On)
 if("${LLDB_CODESIGN_IDENTITY}" STREQUAL "lldb_codesign")
   set(LLDB_USE_ENTITLEMENTS_Default Off)
 endif()
 option(LLDB_USE_ENTITLEMENTS "Use entitlements when codesigning (Defaults Off 
when using lldb_codesign identity, otherwise On)" 
${LLDB_USE_ENTITLEMENTS_Default})
 
-if ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "")
+if (SKIP_DEBUGSERVER)
   if (CMAKE_HOST_APPLE)
 # If we haven't built a signed debugserver, copy the one from the system.
 add_custom_target(debugserver


Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -57,21 +57,6 @@
   add_subdirectory(scripts)
 endif ()
 
-if(CMAKE_HOST_APPLE)
-  if(LLDB_CODESIGN_IDENTITY)
-set(DEBUGSERVER_PATH $)
-  else()
-execute_process(
-  COMMAND xcode-select -p
-  OUTPUT_VARIABLE XCODE_DEV_DIR)
-string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
-set(DEBUGSERVER_PATH
-  "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
-set(SKIP_DEBUGSERVER True)
-  endif()
-  message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
-endif()
-
 add_subdirectory(source)
 add_subdirectory(tools)
 
Index: lldb/trunk/tools/debugserver/source/CMakeLists.txt
===
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt
@@ -95,6 +95,22 @@
 add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
 
 
+set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
+  CACHE STRING "Identity used for code signing. Set to empty string to skip the signing step.")
+
+if(NOT LLDB_CODESIGN_IDENTITY STREQUAL "")
+  set(DEBUGSERVER_PATH $)
+else()
+  execute_process(
+COMMAND xcode-select -p
+OUTPUT_VARIABLE XCODE_DEV_DIR)
+  string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
+  set(DEBUGSERVER_PATH
+"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
+  set(SKIP_DEBUGSERVER True)
+endif()
+message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
+
 if (APPLE)
   if(IOS)
 find_library(BACKBOARD_LIBRARY BackBoardServices
@@ -187,15 +203,13 @@
   set(entitlements_xml ${CMAKE_CURRENT_SOURCE_DIR}/debugserver-entitlements.plist)
 endif()
 
-set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
-  CACHE STRING "Identity used for code signing. Set to empty string to skip the signing step.")
 set(LLDB_USE_ENTITLEMENTS_Default On)
 if("${LLDB_CODESIGN_IDENTITY}" STREQUAL "lldb_codesign")
   set(LLDB_USE_ENTITLEMENTS_Default Off)
 endif()
 op

[Lldb-commits] [PATCH] D43432: [cmake] Fix LLDB_CODESIGN_IDENTITY logic.

2018-02-17 Thread Don Hinton via Phabricator via lldb-commits
hintonda added a comment.

This is causing test failures due debugserver not found.  The fix should be to 
add DEBUGSERVER_PATH to the cache -- it was originally available in the root 
scope.

I hope to have a fix in as soon as I validated the fix locally, but if this is 
causing an issue for anyone, please let me know and I'll revert.


Repository:
  rL LLVM

https://reviews.llvm.org/D43432



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


[Lldb-commits] [lldb] r325452 - Add DEBUGSERVER_PATH to the cache so it'll be available for tests.

2018-02-17 Thread Don Hinton via lldb-commits
Author: dhinton
Date: Sat Feb 17 15:06:15 2018
New Revision: 325452

URL: http://llvm.org/viewvc/llvm-project?rev=325452&view=rev
Log:
Add DEBUGSERVER_PATH to the cache so it'll be available for tests.

This fixed a problem caused by r325442.

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

Modified:
lldb/trunk/tools/debugserver/source/CMakeLists.txt

Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=325452&r1=325451&r2=325452&view=diff
==
--- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Sat Feb 17 15:06:15 2018
@@ -99,14 +99,14 @@ set(LLDB_CODESIGN_IDENTITY "lldb_codesig
   CACHE STRING "Identity used for code signing. Set to empty string to skip 
the signing step.")
 
 if(NOT LLDB_CODESIGN_IDENTITY STREQUAL "")
-  set(DEBUGSERVER_PATH $)
+  set(DEBUGSERVER_PATH $ CACHE PATH "Path to 
debugserver.")
 else()
   execute_process(
 COMMAND xcode-select -p
 OUTPUT_VARIABLE XCODE_DEV_DIR)
   string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
   set(DEBUGSERVER_PATH
-
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver")
+
"${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" 
CACHE PATH "Path to debugserver.")
   set(SKIP_DEBUGSERVER True)
 endif()
 message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")


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