Re: [Lldb-commits] [lldb] r316800 - [CMake] Build clang as dependency when using in-tree clang for tests.
A few notes on this change. > On Oct 27, 2017, at 2:22 PM, Davide Italiano via lldb-commits > wrote: > > Author: davide > Date: Fri Oct 27 14:22:57 2017 > New Revision: 316800 > > URL: http://llvm.org/viewvc/llvm-project?rev=316800&view=rev > Log: > [CMake] Build clang as dependency when using in-tree clang for tests. > > Discussed with Zachary Turner and Pavel Labath on lldb-dev. > Let's hope this doesn't break anything :) > > Modified: >lldb/trunk/lit/CMakeLists.txt >lldb/trunk/test/CMakeLists.txt > > Modified: lldb/trunk/lit/CMakeLists.txt > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=316800&r1=316799&r2=316800&view=diff > == > --- lldb/trunk/lit/CMakeLists.txt (original) > +++ lldb/trunk/lit/CMakeLists.txt Fri Oct 27 14:22:57 2017 > @@ -54,6 +54,12 @@ add_lit_testsuite(check-lldb-lit "Runnin > > set_target_properties(check-lldb-lit PROPERTIES FOLDER "LLDB tests") > > +# If we're building with an in-tree clang, then list clang as a dependency > +# to run tests. > +if (TARGET clang) > + add_dependencies(check-lldb-lit clang) > +endif() This is unnecessary. Higher up in the file clang is added to LLDB_TEST_DEPS, which gets setup correctly. > + > add_lit_testsuites(LLDB ${CMAKE_CURRENT_SOURCE_DIR} > PARAMS lldb_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg > lldb_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg > > Modified: lldb/trunk/test/CMakeLists.txt > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=316800&r1=316799&r2=316800&view=diff > == > --- lldb/trunk/test/CMakeLists.txt (original) > +++ lldb/trunk/test/CMakeLists.txt Fri Oct 27 14:22:57 2017 > @@ -109,6 +109,12 @@ add_python_test_target(check-lldb > "Testing LLDB (parallel execution, with a separate subprocess per test)" > ) > > +# If we're building with an in-tree clang, then list clang as a dependency > +# to run tests. > +if (TARGET clang) > + add_dependencies(check-lldb clang) > +endif() This is only necessary because Pavel's change (r316728) broke it. Prior to Pavel's change we specified the in-tree compiler using a generator expression which is more robust and properly sets up a dependency. It would be much better to remove this and fix Pavel's patch to use generator expressions for finding the compiler. The fix for Pavel's patch would be to set `LLDB_DEFAULT_TEST_C_COMPILER` to `$` instead of trying to hand munge the path. We also should derive the CXX compiler from the C compiler as it is pretty unnecessary to define them separately. -Chris > + > add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS}) > # This will add LLDB's test dependencies to the depenednecies for check-all > and > # include them in the test-depends target. > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D31367: Expression: add missing linkage to RuntimeDyld component
I had a talk with Lang about the ExecutionEngine library structuring, and it sounds like there are some problems there that need to be worked out. Luckily for this specific case, I think the solution is actually quite simple: ``` diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index f68337c..cc99f94 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -15,7 +15,6 @@ #ifndef LLVM_EXECUTIONENGINE_EXECUTIONENGINE_H #define LLVM_EXECUTIONENGINE_EXECUTIONENGINE_H -#include "RuntimeDyld.h" #include "llvm-c/ExecutionEngine.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -49,6 +48,7 @@ class ObjectCache; class RTDyldMemoryManager; class Triple; class Type; +class JITSymbolResolver; namespace object { class Archive; ``` It seems to me that there is no reason why ExecutionEngine.h needs to include RuntimeDyld.h. a forward declaration of the JITSymbolResolver class will suffice. -Chris > On Mar 30, 2017, at 11:41 AM, Michał Górny via Phabricator > wrote: > > mgorny added a comment. > > In https://reviews.llvm.org/D31367#714305, @beanz wrote: > >> Please revert your patch. It is *not* the right solution and is masking >> underlying problems. > > > Reverted in r299095. Now I'd really appreciate some help in figuring out how > to fix it properly. > >> ExecutionEngine headers directly reference symbols from RuntimeDyld, so we >> should enforce a requirement that anyone using ExeuctionEngine also link >> RuntimeDyld. This works today as expected for static archive builds. It is >> only broken with `BUILD_SHARED_LIBS`. I suspect the problem is that when >> built as a DSO ExecutionEngine has no unresolved symbols against >> RuntimeDyld, and the linker probably isn't including the reference to >> RuntimeDyld in the produced ExecutionEngine DSO. > > The DSO is linking to RuntimeDyld. However, obviously the `PRIVATE` linkage > forced in `llvm_add_library` is not the correct solution when the symbols are > explicitly used in the headers. It should be `PUBLIC` for that particular > component. Any suggestion on how to fix that API? Should I add an additional > `PUBLIC_LINK_COMPONENTS` (and `PUBLIC_LINK_LIBS`)? > > > Repository: > rL LLVM > > https://reviews.llvm.org/D31367 > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300111 - Support Unit Testing debugserver
Author: cbieneman Date: Wed Apr 12 16:56:29 2017 New Revision: 300111 URL: http://llvm.org/viewvc/llvm-project?rev=300111&view=rev Log: Support Unit Testing debugserver Summary: This patch refactors the CMake build system's support for building debugserver to allow us to build the majority of debugserver's sources into the debugserverCommon library which can then be reused by unit tests. The first unit test I've written tests debug server's ability to accept incoming connections from LLDB. The test forks the process, and one side creates a listening socket using debugserver's socket API, the other side creates a transmitting socket using LLDB's TCPSocket class. I have no clue where to even start getting this connected into the LLDB Xcode project, so for now these tests are CMake-only. Reviewers: zturner, labath, jasonmolenda Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D31357 Added: lldb/trunk/unittests/debugserver/ lldb/trunk/unittests/debugserver/CMakeLists.txt lldb/trunk/unittests/debugserver/RNBSocketTest.cpp lldb/trunk/unittests/debugserver/debugserver_LogCallback.cpp Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt lldb/trunk/unittests/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=300111&r1=300110&r2=300111&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Wed Apr 12 16:56:29 2017 @@ -2,12 +2,10 @@ include_directories(${CMAKE_CURRENT_BINA include_directories(${LLDB_SOURCE_DIR}/source) include_directories(MacOSX/DarwinLog) -if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - include_directories(MacOSX) - #include_directories(${CMAKE_CURRENT_BINARY_DIR}/MacOSX) +include_directories(MacOSX) +#include_directories(${CMAKE_CURRENT_BINARY_DIR}/MacOSX) - 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() +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") check_cxx_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments" CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS) @@ -27,19 +25,31 @@ if (CXX_SUPPORTS_NO_EXTENDED_OFFSETOF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extended-offsetof") endif () -if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") - add_definitions( --DDEBUGSERVER_VERSION_STR="${LLDB_VERSION}" -) -endif () +find_library(COCOA_LIBRARY Cocoa) +add_subdirectory(MacOSX) -if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - find_library(COCOA_LIBRARY Cocoa) - add_subdirectory(MacOSX) -endif() +set(generated_mach_interfaces + ${CMAKE_CURRENT_BINARY_DIR}/mach_exc.h + ${CMAKE_CURRENT_BINARY_DIR}/mach_excServer.c + ${CMAKE_CURRENT_BINARY_DIR}/mach_excUser.c + ) +add_custom_command(OUTPUT ${generated_mach_interfaces} + COMMAND mig ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs + ) -add_lldb_library(lldbDebugserverCommon - debugserver.cpp +set(DEBUGSERVER_VERS_GENERATED_FILE ${CMAKE_CURRENT_BINARY_DIR}/debugserver_vers.c) +set_source_files_properties(${DEBUGSERVER_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) + +add_custom_command(OUTPUT ${DEBUGSERVER_VERS_GENERATED_FILE} + COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl + ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj debugserver + > ${DEBUGSERVER_VERS_GENERATED_FILE} + DEPENDS ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl + ${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj + ) + +set(lldbDebugserverCommonSources DNBArch.cpp DNBBreakpoint.cpp DNB.cpp @@ -63,12 +73,53 @@ add_lldb_library(lldbDebugserverCommon RNBSocket.cpp SysSignal.cpp TTYState.cpp + + MacOSX/CFBundle.cpp + MacOSX/CFString.cpp + MacOSX/Genealogy.cpp + MacOSX/MachException.cpp + MacOSX/MachProcess.mm + MacOSX/MachTask.mm + MacOSX/MachThread.cpp + MacOSX/MachThreadList.cpp + MacOSX/MachVMMemory.cpp + MacOSX/MachVMRegion.cpp + MacOSX/OsLogger.cpp + ${generated_mach_interfaces} + ${DEBUGSERVER_VERS_GENERATED_FILE}) + +add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources}) + +target_link_libraries(lldbDebugserverCommon + INTERFACE ${COCOA_LIBRARY} + lldbDebugserverMacOSX_I386 + lldbDebugserverMacOSX_X86_64 + lldbDebugserverMacOSX_DarwinLog) + +set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources}) +add_lldb_tool(debugserver INCLUDE_IN_
[Lldb-commits] [lldb] r300112 - [NFC] Adding a new wrapper for getaddrinfo
Author: cbieneman Date: Wed Apr 12 16:56:33 2017 New Revision: 300112 URL: http://llvm.org/viewvc/llvm-project?rev=300112&view=rev Log: [NFC] Adding a new wrapper for getaddrinfo Summary: This patch adds a new wrapper for getaddrinfo which returns a std::vector of SocketAddresses. While this patch doesn't add any uses of the new function, I have two separable patches that are dependent on this, so I put it in its own patch. Reviewers: zturner Reviewed By: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31822 Modified: lldb/trunk/include/lldb/Host/SocketAddress.h lldb/trunk/source/Host/common/SocketAddress.cpp Modified: lldb/trunk/include/lldb/Host/SocketAddress.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/SocketAddress.h?rev=300112&r1=300111&r2=300112&view=diff == --- lldb/trunk/include/lldb/Host/SocketAddress.h (original) +++ lldb/trunk/include/lldb/Host/SocketAddress.h Wed Apr 12 16:56:33 2017 @@ -32,15 +32,23 @@ typedef ADDRESS_FAMILY sa_family_t; // Other libraries and framework includes // Project includes #include +#include namespace lldb_private { class SocketAddress { public: + // + // Static method to get all address information for a host and/or service + // + static std::vector GetAddressInfo(const char *hostname, + const char *servname); + //-- // Constructors and Destructors //-- SocketAddress(); + SocketAddress(const struct addrinfo *addr_info); SocketAddress(const struct sockaddr &s); SocketAddress(const struct sockaddr_in &s); SocketAddress(const struct sockaddr_in6 &s); @@ -63,6 +71,9 @@ public: const SocketAddress &operator=(const struct sockaddr_storage &s); + bool operator==(const SocketAddress &rhs) const; + bool operator!=(const SocketAddress &rhs) const; + //-- // Clear the contents of this socket address //-- @@ -135,6 +146,11 @@ public: bool IsValid() const; //-- + // Returns true if the socket is INADDR_ANY + //-- + bool IsAnyAddr() const; + + //-- // Direct access to all of the sockaddr structures //-- struct sockaddr &sockaddr() { Modified: lldb/trunk/source/Host/common/SocketAddress.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/SocketAddress.cpp?rev=300112&r1=300111&r2=300112&view=diff == --- lldb/trunk/source/Host/common/SocketAddress.cpp (original) +++ lldb/trunk/source/Host/common/SocketAddress.cpp Wed Apr 12 16:56:33 2017 @@ -89,6 +89,10 @@ SocketAddress::SocketAddress(const struc m_socket_addr.sa_storage = s; } +SocketAddress::SocketAddress(const struct addrinfo *addr_info) { + *this = addr_info; +} + //-- // SocketAddress copy constructor //-- @@ -244,6 +248,24 @@ bool SocketAddress::getaddrinfo(const ch return result; } +std::vector SocketAddress::GetAddressInfo(const char *hostname, + const char *servname) { + std::vector addr_list; + + struct addrinfo *service_info_list = NULL; + int err = ::getaddrinfo(hostname, servname, NULL, &service_info_list); + if (err == 0 && service_info_list) { +for (struct addrinfo *service_ptr = service_info_list; service_ptr != NULL; + service_ptr = service_ptr->ai_next) { + addr_list.emplace_back(SocketAddress(service_ptr)); +} + } + + if (service_info_list) +::freeaddrinfo(service_info_list); + return addr_list; +} + bool SocketAddress::SetToLocalhost(sa_family_t family, uint16_t port) { switch (family) { case AF_INET: @@ -287,3 +309,29 @@ bool SocketAddress::SetToAnyAddress(sa_f Clear(); return false; } + +bool SocketAddress::IsAnyAddr() const { + return (GetFamily() == AF_INET) + ? m_socket_addr.sa_ipv4.sin_addr.s_addr == htonl(INADDR_ANY) + : 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr, &in6addr_any, 16); +} + +bool SocketAddress::operator==(const SocketAddress &rhs) const { + if (GetFamily() != rhs.GetFamily()) +return f
[Lldb-commits] [lldb] r300372 - [CMake] Support generating Config.h
Author: cbieneman Date: Fri Apr 14 17:03:45 2017 New Revision: 300372 URL: http://llvm.org/viewvc/llvm-project?rev=300372&view=rev Log: [CMake] Support generating Config.h Summary: This patch removes the hand maintained config files in favor of auto-generating the config file. We will still need to maintain the defines for the Xcode builds on Mac, but all CMake builds use the generated header instead. This will enable finer grained platform support tests and enable supporting LLDB on more platforms with less manual maintenance. I have only tested this patch on Darwin, and any help testing it out on other platforms would be greatly appreciated. I've probably messed something up somewhere. Reviewers: labath, zturner Reviewed By: labath Subscribers: krytarowski, emaste, srhines, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D31969 Added: lldb/trunk/include/lldb/Host/Config.h.cmake Removed: lldb/trunk/include/lldb/Host/android/Config.h lldb/trunk/include/lldb/Host/freebsd/Config.h lldb/trunk/include/lldb/Host/linux/Config.h lldb/trunk/include/lldb/Host/macosx/Config.h lldb/trunk/include/lldb/Host/mingw/Config.h lldb/trunk/include/lldb/Host/msvc/Config.h lldb/trunk/include/lldb/Host/netbsd/Config.h lldb/trunk/include/lldb/Host/openbsd/Config.h Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake lldb/trunk/include/lldb/Host/Config.h lldb/trunk/source/Host/common/File.cpp Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=300372&r1=300371&r2=300372&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Fri Apr 14 17:03:45 2017 @@ -270,8 +270,8 @@ string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[ message(STATUS "LLDB version: ${LLDB_VERSION}") include_directories(BEFORE - ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_BINARY_DIR}/include ) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) @@ -281,6 +281,17 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE +PATTERN ".cmake" EXCLUDE +PATTERN "Config.h" EXCLUDE +) + + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ +COMPONENT lldb_headers +DESTINATION include +FILES_MATCHING +PATTERN "*.h" +PATTERN ".svn" EXCLUDE +PATTERN ".cmake" EXCLUDE ) endif() @@ -421,3 +432,18 @@ if ((CMAKE_SYSTEM_NAME MATCHES "Android" endif() find_package(Backtrace) + +check_include_file(termios.h HAVE_TERMIOS_H) + +# These checks exist in LLVM's configuration, so I want to match the LLVM names +# so that the check isn't duplicated, but we translate them into the LLDB names +# so that I don't have to change all the uses at the moment. +set(LLDB_CONFIG_TERMIOS_SUPPORTED ${HAVE_TERMIOS_H}) +if(NOT UNIX) + set(LLDB_DISABLE_POSIX 1) +endif() + +# This should be done at the end +configure_file( + ${LLDB_INCLUDE_ROOT}/lldb/Host/Config.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/include/lldb/Host/Config.h) Modified: lldb/trunk/include/lldb/Host/Config.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h?rev=300372&r1=300371&r2=300372&view=diff == --- lldb/trunk/include/lldb/Host/Config.h (original) +++ lldb/trunk/include/lldb/Host/Config.h Fri Apr 14 17:03:45 2017 @@ -7,45 +7,21 @@ // //===--===// -#ifndef liblldb_Config_h_ -#define liblldb_Config_h_ - +#ifndef LLDB_HOST_CONFIG_H +#define LLDB_HOST_CONFIG_H + #if defined(__APPLE__) -#include "lldb/Host/macosx/Config.h" - -#elif defined(__ANDROID__) - -#include "lldb/Host/android/Config.h" - -#elif defined(__linux__) || defined(__GNU__) - -#include "lldb/Host/linux/Config.h" - -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - -#include "lldb/Host/freebsd/Config.h" - -#elif defined(__NetBSD__) - -#include "lldb/Host/netbsd/Config.h" - -#elif defined(__OpenBSD__) - -#include "lldb/Host/openbsd/Config.h" - -#elif defined(__MINGW__) || defined(__MINGW32__) - -#include "lldb/Host/mingw/Config.h" - -#elif defined(_MSC_VER) +// This block of code only exists to keep the Xcode project working in the +// absence of a configuration step. +#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 -#include "lldb/Host/msvc/Config.h" +#define HAVE_SYS_EVENT_H 1 #else -#error undefined platform +#error This file is only used by the Xcode build. #endif -#endif // #ifndef liblldb_Config_h_ +#endif // #ifndef LLDB_HOST_CONFIG_H Added: lldb/trunk/include/lldb/Host/Config.h.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=300372&view=auto ==
[Lldb-commits] [lldb] r300374 - Fix bot breakage from r300372
Author: cbieneman Date: Fri Apr 14 17:20:36 2017 New Revision: 300374 URL: http://llvm.org/viewvc/llvm-project?rev=300374&view=rev Log: Fix bot breakage from r300372 Use #cmakedefine instead of #cmakedefine01 because the uses are ifndef instead of if. Modified: lldb/trunk/include/lldb/Host/Config.h.cmake Modified: lldb/trunk/include/lldb/Host/Config.h.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=300374&r1=300373&r2=300374&view=diff == --- lldb/trunk/include/lldb/Host/Config.h.cmake (original) +++ lldb/trunk/include/lldb/Host/Config.h.cmake Fri Apr 14 17:20:36 2017 @@ -10,7 +10,7 @@ #ifndef LLDB_HOST_CONFIG_H #define LLDB_HOST_CONFIG_H -#cmakedefine01 LLDB_CONFIG_TERMIOS_SUPPORTED +#cmakedefine LLDB_CONFIG_TERMIOS_SUPPORTED #cmakedefine LLDB_DISABLE_POSIX ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300579 - Update LLDB Host to support IPv6 over TCP
Author: cbieneman Date: Tue Apr 18 15:01:52 2017 New Revision: 300579 URL: http://llvm.org/viewvc/llvm-project?rev=300579&view=rev Log: Update LLDB Host to support IPv6 over TCP Summary: This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way. This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me). The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call. This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address. The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else. Reviewers: zturner, clayborg Subscribers: jasonmolenda, labath, lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D31823 Added: lldb/trunk/source/Host/common/MainLoop.cpp - copied, changed from r300564, lldb/trunk/source/Host/posix/MainLoopPosix.cpp Removed: lldb/trunk/include/lldb/Host/posix/MainLoopPosix.h lldb/trunk/source/Host/posix/MainLoopPosix.cpp Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake lldb/trunk/include/lldb/Host/Config.h lldb/trunk/include/lldb/Host/Config.h.cmake lldb/trunk/include/lldb/Host/MainLoop.h lldb/trunk/include/lldb/Host/Socket.h lldb/trunk/include/lldb/Host/common/TCPSocket.h lldb/trunk/include/lldb/Host/common/UDPSocket.h lldb/trunk/include/lldb/Host/linux/AbstractSocket.h lldb/trunk/include/lldb/Host/posix/DomainSocket.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Host/CMakeLists.txt lldb/trunk/source/Host/common/Socket.cpp lldb/trunk/source/Host/common/TCPSocket.cpp lldb/trunk/source/Host/common/UDPSocket.cpp lldb/trunk/source/Host/linux/AbstractSocket.cpp lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp lldb/trunk/source/Host/posix/DomainSocket.cpp lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp lldb/trunk/tools/lldb-server/Acceptor.cpp lldb/trunk/unittests/Host/SocketTest.cpp lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp lldb/trunk/unittests/debugserver/RNBSocketTest.cpp Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=300579&r1=300578&r2=300579&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Apr 18 15:01:52 2017 @@ -432,6 +432,7 @@ if ((CMAKE_SYSTEM_NAME MATCHES "Android" endif() find_package(Backtrace) +check_symbol_exists(ppoll poll.h HAVE_PPOLL) check_include_file(termios.h HAVE_TERMIOS_H) Modified: lldb/trunk/include/lldb/Host/Config.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h?rev=300579&r1=300578&r2=300579&view=diff == --- lldb/trunk/include/lldb/Host/Config.h (original) +++ lldb/trunk/include/lldb/Host/Config.h Tue Apr 18 15:01:52 2017 @@ -18,6 +18,8 @@ #define HAVE_SYS_EVENT_H 1 +#define HAVE_PPOLL 0 + #else #error This file is only used by the Xcode build. Modified: lldb/trunk/include/lldb/Host/Config.h.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=300579&r1=300578&r2=300579&view=diff == --- lldb/trunk/include/lldb/Host/Config.h.cmake (original) +++ lldb/trunk/include/lldb/Host/Config.h.cmake Tue Apr 18 15:01:52 2017 @@ -16,4 +16,6 @@ #cmakedefine01 HAVE_SYS_EVENT_H +#cmakedefine01 HAVE_PPOLL + #endif // #
[Lldb-commits] [lldb] r300580 - Update DebugServer to support IPv6 over TCP
Author: cbieneman Date: Tue Apr 18 15:01:59 2017 New Revision: 300580 URL: http://llvm.org/viewvc/llvm-project?rev=300580&view=rev Log: Update DebugServer to support IPv6 over TCP Summary: This patch adds IPv6 support to debugserver. It follows a similar pattern to the changes proposed for LLDB/Host except that the listen implementation is only with kqueue(2) because debugserver is only supported on Darwin. Reviewers: jingham, jasonmolenda, clayborg Reviewed By: clayborg Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D31824 Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj lldb/trunk/tools/debugserver/source/CMakeLists.txt lldb/trunk/tools/debugserver/source/RNBSocket.cpp lldb/trunk/tools/debugserver/source/debugserver.cpp lldb/trunk/unittests/debugserver/RNBSocketTest.cpp Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=300580&r1=300579&r2=300580&view=diff == --- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original) +++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Apr 18 15:01:59 2017 @@ -101,6 +101,7 @@ AF48558D1D75127500D19C07 /* StdStringExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF48558B1D75126800D19C07 /* StdStringExtractor.cpp */; }; AFA3FCA11E39984900218D5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49D404611E39260F00570CDC /* Foundation.framework */; }; AFEC3364194A8B0B00FF05C6 /* Genealogy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */; }; + D6631CA91E848FE9006A7B11 /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6631CA81E848FE9006A7B11 /* SocketAddress.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -219,6 +220,7 @@ AF67ABFF0D34604D0022D128 /* PseudoTerminal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PseudoTerminal.cpp; sourceTree = ""; }; AF67AC000D34604D0022D128 /* PseudoTerminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoTerminal.h; sourceTree = ""; }; AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Genealogy.cpp; sourceTree = ""; }; + D6631CA81E848FE9006A7B11 /* SocketAddress.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SocketAddress.cpp; path = ../../source/Host/common/SocketAddress.cpp; sourceTree = ""; }; ED128B7918E1F163003F6A7B /* libpmenergy.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpmenergy.dylib; path = usr/lib/libpmenergy.dylib; sourceTree = SDKROOT; }; ED128B7A18E1F163003F6A7B /* libpmsample.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpmsample.dylib; path = usr/lib/libpmsample.dylib; sourceTree = SDKROOT; }; EF88788B0D9C7558001831DA /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.applist.plist; sourceTree = ""; }; @@ -251,6 +253,7 @@ 08FB7794FE84155DC02AAC07 /* dbgnub */ = { isa = PBXGroup; children = ( + D6631CA81E848FE9006A7B11 /* SocketAddress.cpp */, 26ACA3330D3E94F200A2120B /* Framework */, 26C637D50C71334A0024798E /* source */, 1AB674ADFE9D54B511CA2CBB /* Products */, @@ -577,6 +580,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D6631CA91E848FE9006A7B11 /* SocketAddress.cpp in Sources */, 26CE05A7115C360D0022F371 /* DNBError.cpp in Sources */, 26CE05A8115C36170022F371 /* DNBThreadResumeActions.cpp in Sources */, 26CE05A9115C36250022F371 /* debugserver.cpp in Sources */, Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=300580&r1=300579&r2=300580&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserv
[Lldb-commits] [lldb] r300582 - Fixing bot failure caused by r300579
Author: cbieneman Date: Tue Apr 18 15:08:29 2017 New Revision: 300582 URL: http://llvm.org/viewvc/llvm-project?rev=300582&view=rev Log: Fixing bot failure caused by r300579 Modified: lldb/trunk/source/Host/common/Socket.cpp Modified: lldb/trunk/source/Host/common/Socket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Socket.cpp?rev=300582&r1=300581&r2=300582&view=diff == --- lldb/trunk/source/Host/common/Socket.cpp (original) +++ lldb/trunk/source/Host/common/Socket.cpp Tue Apr 18 15:08:29 2017 @@ -101,7 +101,7 @@ std::unique_ptr Socket::Create(c case ProtocolUnixAbstract: #ifdef __linux__ socket_up = -llvm::make_unique(true, child_processes_inherit); +llvm::make_unique(child_processes_inherit); #else error.SetErrorString( "Abstract domain sockets are not supported on this platform."); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300587 - Fix broken windows build.
Author: cbieneman Date: Tue Apr 18 15:37:05 2017 New Revision: 300587 URL: http://llvm.org/viewvc/llvm-project?rev=300587&view=rev Log: Fix broken windows build. This is not ideal, but it should get the bot going again. I'll need to revisit this if we want to get signal handling working on Windows. Modified: lldb/trunk/include/lldb/Host/MainLoop.h lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/include/lldb/Host/MainLoop.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/MainLoop.h?rev=300587&r1=300586&r2=300587&view=diff == --- lldb/trunk/include/lldb/Host/MainLoop.h (original) +++ lldb/trunk/include/lldb/Host/MainLoop.h Tue Apr 18 15:37:05 2017 @@ -10,10 +10,15 @@ #ifndef lldb_Host_MainLoop_h_ #define lldb_Host_MainLoop_h_ +#include "lldb/Host/Config.h" #include "lldb/Host/MainLoopBase.h" #include "llvm/ADT/DenseMap.h" +#if !HAVE_PPOLL && !HAVE_SYS_EVENT_H +#define SIGNAL_POLLING_UNSUPPORTED 1 +#endif + namespace lldb_private { // Implementation of the MainLoopBase class. It can monitor file descriptors for @@ -83,7 +88,9 @@ private: struct SignalInfo { Callback callback; +#if !SIGNAL_POLLING_UNSUPPORTED struct sigaction old_action; +#endif bool was_blocked : 1; }; Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300587&r1=300586&r2=300587&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 15:37:05 2017 @@ -33,7 +33,6 @@ #endif #if !HAVE_PPOLL && !HAVE_SYS_EVENT_H -#define SIGNAL_POLLING_UNSUPPORTED 1 int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts, const sigset_t *) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300589 - Writing multi-platform code is hard...
Author: cbieneman Date: Tue Apr 18 15:49:05 2017 New Revision: 300589 URL: http://llvm.org/viewvc/llvm-project?rev=300589&view=rev Log: Writing multi-platform code is hard... Fixing another error from r300579. Modified: lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300589&r1=300588&r2=300589&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 15:49:05 2017 @@ -176,7 +176,6 @@ Error MainLoop::Run() { // listen to, we // will store the *real* list of events separately. signals.clear(); -read_fds.clear(); #if HAVE_SYS_EVENT_H events.resize(m_read_fds.size() + m_signals.size()); @@ -198,6 +197,7 @@ Error MainLoop::Run() { return Error("kevent() failed with error %d\n", num_events); #else +read_fds.clear(); if (int ret = pthread_sigmask(SIG_SETMASK, nullptr, &sigmask)) return Error("pthread_sigmask failed with error %d\n", ret); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300590 - [CMake] Adding configure-time check for sigaction
Author: cbieneman Date: Tue Apr 18 15:49:09 2017 New Revision: 300590 URL: http://llvm.org/viewvc/llvm-project?rev=300590&view=rev Log: [CMake] Adding configure-time check for sigaction Hopefully this will fix the netbsd bot that I broke... Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake lldb/trunk/include/lldb/Host/Config.h.cmake lldb/trunk/include/lldb/Host/MainLoop.h Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=300590&r1=300589&r2=300590&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Apr 18 15:49:09 2017 @@ -433,6 +433,7 @@ endif() find_package(Backtrace) check_symbol_exists(ppoll poll.h HAVE_PPOLL) +check_symbol_exists(sigaction signal.h HAVE_SIGACTION) check_include_file(termios.h HAVE_TERMIOS_H) Modified: lldb/trunk/include/lldb/Host/Config.h.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=300590&r1=300589&r2=300590&view=diff == --- lldb/trunk/include/lldb/Host/Config.h.cmake (original) +++ lldb/trunk/include/lldb/Host/Config.h.cmake Tue Apr 18 15:49:09 2017 @@ -18,4 +18,6 @@ #cmakedefine01 HAVE_PPOLL +#cmakedefine01 HAVE_SIGACTION + #endif // #ifndef LLDB_HOST_CONFIG_H Modified: lldb/trunk/include/lldb/Host/MainLoop.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/MainLoop.h?rev=300590&r1=300589&r2=300590&view=diff == --- lldb/trunk/include/lldb/Host/MainLoop.h (original) +++ lldb/trunk/include/lldb/Host/MainLoop.h Tue Apr 18 15:49:09 2017 @@ -88,7 +88,7 @@ private: struct SignalInfo { Callback callback; -#if !SIGNAL_POLLING_UNSUPPORTED +#if HAVE_SIGACTION struct sigaction old_action; #endif bool was_blocked : 1; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300605 - Removing unused include
Author: cbieneman Date: Tue Apr 18 16:23:55 2017 New Revision: 300605 URL: http://llvm.org/viewvc/llvm-project?rev=300605&view=rev Log: Removing unused include This is causing the Windows bot failures. Modified: lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300605&r1=300604&r2=300605&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 16:23:55 2017 @@ -15,7 +15,6 @@ #include #include #include -#include #include #if HAVE_SYS_EVENT_H ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300606 - Fixing error on Android build (-Werror)
Author: cbieneman Date: Tue Apr 18 16:35:26 2017 New Revision: 300606 URL: http://llvm.org/viewvc/llvm-project?rev=300606&view=rev Log: Fixing error on Android build (-Werror) This is fallout from r300579. Modified: lldb/trunk/source/Host/common/UDPSocket.cpp Modified: lldb/trunk/source/Host/common/UDPSocket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/UDPSocket.cpp?rev=300606&r1=300605&r2=300606&view=diff == --- lldb/trunk/source/Host/common/UDPSocket.cpp (original) +++ lldb/trunk/source/Host/common/UDPSocket.cpp Tue Apr 18 16:35:26 2017 @@ -122,11 +122,11 @@ Error UDPSocket::Connect(llvm::StringRef } Error UDPSocket::Listen(llvm::StringRef name, int backlog) { - return Error(g_not_supported_error); + return Error("%s", g_not_supported_error); } Error UDPSocket::Accept(Socket *&socket) { - return Error(g_not_supported_error); + return Error("%s", g_not_supported_error); } Error UDPSocket::CreateSocket() { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300610 - Fix Windows bot failure
Author: cbieneman Date: Tue Apr 18 16:47:50 2017 New Revision: 300610 URL: http://llvm.org/viewvc/llvm-project?rev=300610&view=rev Log: Fix Windows bot failure timespec is not available on Windows, and we should use size_t instead of nfds_t. Modified: lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300610&r1=300609&r2=300610&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 16:47:50 2017 @@ -33,7 +33,14 @@ #if !HAVE_PPOLL && !HAVE_SYS_EVENT_H -int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts, +#ifdef LLVM_ON_WIN32 +struct timespec { + time_t tv_sec; + suseconds_t tv_nsec; +}; +#endif + +int ppoll(struct pollfd *fds, size_t nfds, const struct timespec *timeout_ts, const sigset_t *) { int timeout = (timeout_ts == nullptr) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r300610 - Fix Windows bot failure
Ah! Missing include then. I'll fix it correctly. -Chris > On Apr 18, 2017, at 3:18 PM, Adrian McCarthy wrote: > > Actually, Windows does have `struct timespec`. It's defined in `` > and ``. > > https://msdn.microsoft.com/en-us/library/mt633792.aspx > <https://msdn.microsoft.com/en-us/library/mt633792.aspx> > > I suspect somebody had suppressed it for some reason. > > On Tue, Apr 18, 2017 at 2:47 PM, Chris Bieneman via lldb-commits > mailto:lldb-commits@lists.llvm.org>> wrote: > Author: cbieneman > Date: Tue Apr 18 16:47:50 2017 > New Revision: 300610 > > URL: http://llvm.org/viewvc/llvm-project?rev=300610&view=rev > <http://llvm.org/viewvc/llvm-project?rev=300610&view=rev> > Log: > Fix Windows bot failure > > timespec is not available on Windows, and we should use size_t instead of > nfds_t. > > Modified: > lldb/trunk/source/Host/common/MainLoop.cpp > > Modified: lldb/trunk/source/Host/common/MainLoop.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300610&r1=300609&r2=300610&view=diff > > <http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300610&r1=300609&r2=300610&view=diff> > == > --- lldb/trunk/source/Host/common/MainLoop.cpp (original) > +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 16:47:50 2017 > @@ -33,7 +33,14 @@ > > #if !HAVE_PPOLL && !HAVE_SYS_EVENT_H > > -int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts, > +#ifdef LLVM_ON_WIN32 > +struct timespec { > + time_t tv_sec; > + suseconds_t tv_nsec; > +}; > +#endif > + > +int ppoll(struct pollfd *fds, size_t nfds, const struct timespec *timeout_ts, >const sigset_t *) { >int timeout = >(timeout_ts == nullptr) > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org <mailto:lldb-commits@lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits> > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300615 - Include time.h, and fix a Darwin warning
Author: cbieneman Date: Tue Apr 18 17:11:13 2017 New Revision: 300615 URL: http://llvm.org/viewvc/llvm-project?rev=300615&view=rev Log: Include time.h, and fix a Darwin warning This is a little more cleanup from r300579. Modified: lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300615&r1=300614&r2=300615&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 17:11:13 2017 @@ -16,6 +16,7 @@ #include #include #include +#include #if HAVE_SYS_EVENT_H #include @@ -33,13 +34,6 @@ #if !HAVE_PPOLL && !HAVE_SYS_EVENT_H -#ifdef LLVM_ON_WIN32 -struct timespec { - time_t tv_sec; - suseconds_t tv_nsec; -}; -#endif - int ppoll(struct pollfd *fds, size_t nfds, const struct timespec *timeout_ts, const sigset_t *) { int timeout = @@ -160,7 +154,6 @@ void MainLoop::UnregisterSignal(int sign Error MainLoop::Run() { std::vector signals; - sigset_t sigmask; m_terminate_request = false; signals.reserve(m_signals.size()); @@ -172,6 +165,7 @@ Error MainLoop::Run() { std::vector events; events.reserve(m_read_fds.size() + m_signals.size()); #else + sigset_t sigmask; std::vector read_fds; read_fds.reserve(m_read_fds.size()); #endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300618 - Define HAVE_SIGACTION to 1 in Xcode build
Author: cbieneman Date: Tue Apr 18 17:37:00 2017 New Revision: 300618 URL: http://llvm.org/viewvc/llvm-project?rev=300618&view=rev Log: Define HAVE_SIGACTION to 1 in Xcode build This is needed to make the Xcode project build since it doesn't have auto-generated Config header. Modified: lldb/trunk/include/lldb/Host/Config.h Modified: lldb/trunk/include/lldb/Host/Config.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h?rev=300618&r1=300617&r2=300618&view=diff == --- lldb/trunk/include/lldb/Host/Config.h (original) +++ lldb/trunk/include/lldb/Host/Config.h Tue Apr 18 17:37:00 2017 @@ -20,6 +20,8 @@ #define HAVE_PPOLL 0 +#define HAVE_SIGACTION 1 + #else #error This file is only used by the Xcode build. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300636 - ifdefing out the signal handling code on Windows
Author: cbieneman Date: Tue Apr 18 20:00:16 2017 New Revision: 300636 URL: http://llvm.org/viewvc/llvm-project?rev=300636&view=rev Log: ifdefing out the signal handling code on Windows *fingers crossed* This might fix the Window bots, but I really don't know... Modified: lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300636&r1=300635&r2=300636&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 20:00:16 2017 @@ -32,7 +32,10 @@ #define POLL poll #endif -#if !HAVE_PPOLL && !HAVE_SYS_EVENT_H +#if SIGNAL_POLLING_UNSUPPORTED +#ifdef LLVM_ON_WIN32 +typedef int sigset_t; +#endif int ppoll(struct pollfd *fds, size_t nfds, const struct timespec *timeout_ts, const sigset_t *) { @@ -137,6 +140,10 @@ void MainLoop::UnregisterReadObject(IOOb } void MainLoop::UnregisterSignal(int signo) { +#if SIGNAL_POLLING_UNSUPPORTED + error.SetErrorString("Signal polling is not supported on this platform."); + return nullptr; +#else // We undo the actions of RegisterSignal on a best-effort basis. auto it = m_signals.find(signo); assert(it != m_signals.end()); @@ -150,6 +157,7 @@ void MainLoop::UnregisterSignal(int sign nullptr); m_signals.erase(it); +#endif } Error MainLoop::Run() { @@ -198,9 +206,17 @@ Error MainLoop::Run() { #else read_fds.clear(); + +#if !SIGNAL_POLLING_UNSUPPORTED if (int ret = pthread_sigmask(SIG_SETMASK, nullptr, &sigmask)) return Error("pthread_sigmask failed with error %d\n", ret); +for (const auto &sig : m_signals) { + signals.push_back(sig.first); + sigdelset(&sigmask, sig.first); +} +#endif + for (const auto &fd : m_read_fds) { struct pollfd pfd; pfd.fd = fd.first; @@ -209,11 +225,6 @@ Error MainLoop::Run() { read_fds.push_back(pfd); } -for (const auto &sig : m_signals) { - signals.push_back(sig.first); - sigdelset(&sigmask, sig.first); -} - if (ppoll(read_fds.data(), read_fds.size(), nullptr, &sigmask) == -1 && errno != EINTR) return Error(errno, eErrorTypePOSIX); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300638 - Buildbot wack-a-mole!
Author: cbieneman Date: Tue Apr 18 20:15:17 2017 New Revision: 300638 URL: http://llvm.org/viewvc/llvm-project?rev=300638&view=rev Log: Buildbot wack-a-mole! This should fix the netbsd bot I just broke. Modified: lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300638&r1=300637&r2=300638&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 20:15:17 2017 @@ -141,7 +141,7 @@ void MainLoop::UnregisterReadObject(IOOb void MainLoop::UnregisterSignal(int signo) { #if SIGNAL_POLLING_UNSUPPORTED - error.SetErrorString("Signal polling is not supported on this platform."); + Error("Signal polling is not supported on this platform."); return nullptr; #else // We undo the actions of RegisterSignal on a best-effort basis. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300640 - Another netbsd build failure...
Author: cbieneman Date: Tue Apr 18 20:17:29 2017 New Revision: 300640 URL: http://llvm.org/viewvc/llvm-project?rev=300640&view=rev Log: Another netbsd build failure... Modified: lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300640&r1=300639&r2=300640&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 20:17:29 2017 @@ -142,7 +142,6 @@ void MainLoop::UnregisterReadObject(IOOb void MainLoop::UnregisterSignal(int signo) { #if SIGNAL_POLLING_UNSUPPORTED Error("Signal polling is not supported on this platform."); - return nullptr; #else // We undo the actions of RegisterSignal on a best-effort basis. auto it = m_signals.find(signo); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300647 - One more attempt and Windows
Author: cbieneman Date: Tue Apr 18 20:32:08 2017 New Revision: 300647 URL: http://llvm.org/viewvc/llvm-project?rev=300647&view=rev Log: One more attempt and Windows This is the last Windows compile error, so... Hit me with your best shot. Modified: lldb/trunk/source/Host/common/MainLoop.cpp Modified: lldb/trunk/source/Host/common/MainLoop.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=300647&r1=300646&r2=300647&view=diff == --- lldb/trunk/source/Host/common/MainLoop.cpp (original) +++ lldb/trunk/source/Host/common/MainLoop.cpp Tue Apr 18 20:32:08 2017 @@ -35,6 +35,7 @@ #if SIGNAL_POLLING_UNSUPPORTED #ifdef LLVM_ON_WIN32 typedef int sigset_t; +typedef int siginfo_t; #endif int ppoll(struct pollfd *fds, size_t nfds, const struct timespec *timeout_ts, ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r300654 - [CMake] Add configure check for sys/event.h
Author: cbieneman Date: Tue Apr 18 21:53:53 2017 New Revision: 300654 URL: http://llvm.org/viewvc/llvm-project?rev=300654&view=rev Log: [CMake] Add configure check for sys/event.h This enables the kqueue path in MainLoop for Darwin and BSD. Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=300654&r1=300653&r2=300654&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Apr 18 21:53:53 2017 @@ -436,6 +436,7 @@ check_symbol_exists(ppoll poll.h HAVE_PP check_symbol_exists(sigaction signal.h HAVE_SIGACTION) check_include_file(termios.h HAVE_TERMIOS_H) +check_include_file(sys/event.h HAVE_SYS_EVENT_H) # These checks exist in LLVM's configuration, so I want to match the LLVM names # so that the check isn't duplicated, but we translate them into the LLDB names ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301492 - Re-landing IPv6 support for LLDB Host
Author: cbieneman Date: Wed Apr 26 18:17:20 2017 New Revision: 301492 URL: http://llvm.org/viewvc/llvm-project?rev=301492&view=rev Log: Re-landing IPv6 support for LLDB Host This support was landed in r300579, and reverted in r300669 due to failures on the bots. The failures were caused by sockets not being properly closed, and this updated version of the patches should resolve that. Summary from the original change: This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way. This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me). The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call. This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address. The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else. https://reviews.llvm.org/D31823 Added: lldb/trunk/source/Host/common/MainLoop.cpp - copied, changed from r301483, lldb/trunk/source/Host/posix/MainLoopPosix.cpp Removed: lldb/trunk/include/lldb/Host/posix/MainLoopPosix.h lldb/trunk/source/Host/posix/MainLoopPosix.cpp Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake lldb/trunk/include/lldb/Host/Config.h lldb/trunk/include/lldb/Host/Config.h.cmake lldb/trunk/include/lldb/Host/MainLoop.h lldb/trunk/include/lldb/Host/Socket.h lldb/trunk/include/lldb/Host/common/TCPSocket.h lldb/trunk/include/lldb/Host/common/UDPSocket.h lldb/trunk/include/lldb/Host/linux/AbstractSocket.h lldb/trunk/include/lldb/Host/posix/DomainSocket.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/Host/CMakeLists.txt lldb/trunk/source/Host/common/Socket.cpp lldb/trunk/source/Host/common/SocketAddress.cpp lldb/trunk/source/Host/common/TCPSocket.cpp lldb/trunk/source/Host/common/UDPSocket.cpp lldb/trunk/source/Host/linux/AbstractSocket.cpp lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp lldb/trunk/source/Host/posix/DomainSocket.cpp lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj lldb/trunk/tools/debugserver/source/CMakeLists.txt lldb/trunk/tools/debugserver/source/RNBSocket.cpp lldb/trunk/tools/debugserver/source/debugserver.cpp lldb/trunk/tools/lldb-server/Acceptor.cpp lldb/trunk/unittests/Host/SocketTest.cpp lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp lldb/trunk/unittests/debugserver/RNBSocketTest.cpp Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=301492&r1=301491&r2=301492&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Wed Apr 26 18:17:20 2017 @@ -1,4 +1,7 @@ include(CheckCXXSymbolExists) +include(CheckSymbolExists) +include(CheckIncludeFile) +include(CheckIncludeFiles) set(LLDB_PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source") @@ -426,10 +429,14 @@ if ((CMAKE_SYSTEM_NAME MATCHES "Android" endif() find_package(Backtrace) +set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) +check_symbol_exists(ppoll poll.h HAVE_PPOLL) +set(CMAKE_REQUIRED_DEFINITIONS) +check_symbol_exists(sigaction signal.h HAVE_SIGACTION) include(CheckIncludeFile) check_include_file(termios.h HAVE_TERMIOS_H) -check_include_file(sys/event.h HAVE_SYS_EVENT_H) +check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H) # These checks exist in LLVM's configuration, so I
[Lldb-commits] [lldb] r301502 - Fix Windows bots broken by r301492
Author: cbieneman Date: Wed Apr 26 19:03:27 2017 New Revision: 301502 URL: http://llvm.org/viewvc/llvm-project?rev=301502&view=rev Log: Fix Windows bots broken by r301492 http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/8644/ Modified: lldb/trunk/source/Host/common/TCPSocket.cpp Modified: lldb/trunk/source/Host/common/TCPSocket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TCPSocket.cpp?rev=301502&r1=301501&r2=301502&view=diff == --- lldb/trunk/source/Host/common/TCPSocket.cpp (original) +++ lldb/trunk/source/Host/common/TCPSocket.cpp Wed Apr 26 19:03:27 2017 @@ -188,7 +188,9 @@ Error TCPSocket::Listen(llvm::StringRef // enable local address reuse int option_value = 1; -::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &option_value, +set_socket_option_arg_type option_value_p = +reinterpret_cast(&option_value); +::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, option_value_p, sizeof(option_value)); address.SetPort(port); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301504 - One more attempt to fix the broken bots.
Author: cbieneman Date: Wed Apr 26 19:23:41 2017 New Revision: 301504 URL: http://llvm.org/viewvc/llvm-project?rev=301504&view=rev Log: One more attempt to fix the broken bots. Modified: lldb/trunk/source/Host/common/TCPSocket.cpp Modified: lldb/trunk/source/Host/common/TCPSocket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TCPSocket.cpp?rev=301504&r1=301503&r2=301504&view=diff == --- lldb/trunk/source/Host/common/TCPSocket.cpp (original) +++ lldb/trunk/source/Host/common/TCPSocket.cpp Wed Apr 26 19:23:41 2017 @@ -32,8 +32,10 @@ #ifdef LLVM_ON_WIN32 #define CLOSE_SOCKET closesocket +typedef const char *set_socket_option_arg_type; #else #define CLOSE_SOCKET ::close +typedef const void *set_socket_option_arg_type; #endif using namespace lldb; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301506 - One more try at the whole compiling thing...
Author: cbieneman Date: Wed Apr 26 19:47:19 2017 New Revision: 301506 URL: http://llvm.org/viewvc/llvm-project?rev=301506&view=rev Log: One more try at the whole compiling thing... Need to actually use the right type in both parts of the cast. Modified: lldb/trunk/source/Host/common/TCPSocket.cpp Modified: lldb/trunk/source/Host/common/TCPSocket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TCPSocket.cpp?rev=301506&r1=301505&r2=301506&view=diff == --- lldb/trunk/source/Host/common/TCPSocket.cpp (original) +++ lldb/trunk/source/Host/common/TCPSocket.cpp Wed Apr 26 19:47:19 2017 @@ -191,7 +191,7 @@ Error TCPSocket::Listen(llvm::StringRef // enable local address reuse int option_value = 1; set_socket_option_arg_type option_value_p = -reinterpret_cast(&option_value); +reinterpret_cast(&option_value); ::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, option_value_p, sizeof(option_value)); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301553 - [CMake] Abstract Config.h generation for Xcode
Author: cbieneman Date: Thu Apr 27 11:04:26 2017 New Revision: 301553 URL: http://llvm.org/viewvc/llvm-project?rev=301553&view=rev Log: [CMake] Abstract Config.h generation for Xcode This patch abstracts the generation of Config.h and creates a dummy project entry point to allow generation of LLDB's Config header without performing a full CMake configuration. This will enable the Xcode project to generate LLDB's Config header. Added: lldb/trunk/cmake/XcodeHeaderGenerator/ lldb/trunk/cmake/XcodeHeaderGenerator/CMakeLists.txt lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake Modified: lldb/trunk/CMakeLists.txt lldb/trunk/cmake/modules/LLDBConfig.cmake Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=301553&r1=301552&r2=301553&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Thu Apr 27 11:04:26 2017 @@ -1,8 +1,15 @@ cmake_minimum_required(VERSION 3.4.3) -include(cmake/modules/LLDBStandalone.cmake) -include(cmake/modules/LLDBConfig.cmake) -include(cmake/modules/AddLLDB.cmake) +# Add path for custom modules +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + ) + +include(LLDBStandalone) +include(LLDBConfig) +include(AddLLDB) if (CMAKE_SYSTEM_NAME MATCHES "Windows|Android") set(LLDB_DEFAULT_DISABLE_LIBEDIT 1) Added: lldb/trunk/cmake/XcodeHeaderGenerator/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/XcodeHeaderGenerator/CMakeLists.txt?rev=301553&view=auto == --- lldb/trunk/cmake/XcodeHeaderGenerator/CMakeLists.txt (added) +++ lldb/trunk/cmake/XcodeHeaderGenerator/CMakeLists.txt Thu Apr 27 11:04:26 2017 @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.4.3) + +project(XcodeConfig C CXX) + +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/.." + "${CMAKE_CURRENT_SOURCE_DIR}/../modules" + ) + +set(LLDB_CONFIG_HEADER_INPUT +${CMAKE_CURRENT_SOURCE_DIR}/../../include/lldb/Host/Config.h.cmake) + +include(LLDBGenerateConfig) Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=301553&r1=301552&r2=301553&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Thu Apr 27 11:04:26 2017 @@ -1,7 +1,4 @@ include(CheckCXXSymbolExists) -include(CheckSymbolExists) -include(CheckIncludeFile) -include(CheckIncludeFiles) set(LLDB_PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source") @@ -429,24 +426,4 @@ if ((CMAKE_SYSTEM_NAME MATCHES "Android" endif() find_package(Backtrace) -set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) -check_symbol_exists(ppoll poll.h HAVE_PPOLL) -set(CMAKE_REQUIRED_DEFINITIONS) -check_symbol_exists(sigaction signal.h HAVE_SIGACTION) - -include(CheckIncludeFile) -check_include_file(termios.h HAVE_TERMIOS_H) -check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H) - -# These checks exist in LLVM's configuration, so I want to match the LLVM names -# so that the check isn't duplicated, but we translate them into the LLDB names -# so that I don't have to change all the uses at the moment. -set(LLDB_CONFIG_TERMIOS_SUPPORTED ${HAVE_TERMIOS_H}) -if(NOT UNIX) - set(LLDB_DISABLE_POSIX 1) -endif() - -# This should be done at the end -configure_file( - ${LLDB_INCLUDE_ROOT}/lldb/Host/Config.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/include/lldb/Host/Config.h) +include(LLDBGenerateConfig) Added: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake?rev=301553&view=auto == --- lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake (added) +++ lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake Thu Apr 27 11:04:26 2017 @@ -0,0 +1,35 @@ +# This file contains all the logic for running configure-time checks + +include(CheckSymbolExists) +include(CheckIncludeFile) +include(CheckIncludeFiles) + +set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) +check_symbol_exists(ppoll poll.h HAVE_PPOLL) +set(CMAKE_REQUIRED_DEFINITIONS) +check_symbol_exists(sigaction signal.h HAVE_SIGACTION) + +check_include_file(termios.h HAVE_TERMIOS_H) +check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H) + +# These checks exist in LLVM's configuration, so I want to match the LLVM names +# so that the check isn't duplicated, but we translate them into the LLDB names +# so that I don't have to change all the uses at the moment. +set(LLDB_CONFIG_TERMIOS_SUPPORTED ${HAVE_TERMIOS_H}) +if(NOT UNIX) +
[Lldb-commits] [lldb] r301559 - Update GDB remote command regex for IPv6
Author: cbieneman Date: Thu Apr 27 11:13:58 2017 New Revision: 301559 URL: http://llvm.org/viewvc/llvm-project?rev=301559&view=rev Log: Update GDB remote command regex for IPv6 This updates the regular expression used to match host/port pairs for the gdb-remote command to also match IPv6 addresses. The IPv6 address matcher is very generic and does not really check for structural validity of the address. It turns out that IPv6 addresses are very complicated. Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=301559&r1=301558&r2=301559&view=diff == --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Apr 27 11:13:58 2017 @@ -645,8 +645,8 @@ void CommandInterpreter::LoadCommandDict "gdb-remote [:]", 2, 0, false)); if (connect_gdb_remote_cmd_ap.get()) { if (connect_gdb_remote_cmd_ap->AddRegexCommand( -"^([^:]+:[[:digit:]]+)$", -"process connect --plugin gdb-remote connect://%1") && +"^([^:]+|\\[[0-9a-fA-F:]+.*\\]):([0-9]+)$", +"process connect --plugin gdb-remote connect://%1:%2") && connect_gdb_remote_cmd_ap->AddRegexCommand( "^([[:digit:]]+)$", "process connect --plugin gdb-remote connect://localhost:%1")) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301579 - Fix GreenDragon bots
Author: cbieneman Date: Thu Apr 27 14:45:13 2017 New Revision: 301579 URL: http://llvm.org/viewvc/llvm-project?rev=301579&view=rev Log: Fix GreenDragon bots We don't actually need to include Compiler.h here because it is only used on Windows and Windows/PosixAPI.h includes it. Modified: lldb/trunk/include/lldb/Host/PosixApi.h Modified: lldb/trunk/include/lldb/Host/PosixApi.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/PosixApi.h?rev=301579&r1=301578&r2=301579&view=diff == --- lldb/trunk/include/lldb/Host/PosixApi.h (original) +++ lldb/trunk/include/lldb/Host/PosixApi.h Thu Apr 27 14:45:13 2017 @@ -14,8 +14,6 @@ // to provide a minimum level of compatibility across all platforms to rely // on various posix api functionality. -#include "llvm/Support/Compiler.h" - #if defined(LLVM_ON_WIN32) #include "lldb/Host/windows/PosixApi.h" #endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301580 - NFC. Add comment about debugserver usage
Author: cbieneman Date: Thu Apr 27 14:45:16 2017 New Revision: 301580 URL: http://llvm.org/viewvc/llvm-project?rev=301580&view=rev Log: NFC. Add comment about debugserver usage This just adds a comment to SocketAddress about it being used by debugserver and the implications of that. If we need to make changes to this class that make it unsuitable for debugserver we can re-implement the minimal abstractions we need from this file in debugserver. I would prefer not to do that because code duplication is bad. Nuff said. Modified: lldb/trunk/source/Host/common/SocketAddress.cpp Modified: lldb/trunk/source/Host/common/SocketAddress.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/SocketAddress.cpp?rev=301580&r1=301579&r2=301580&view=diff == --- lldb/trunk/source/Host/common/SocketAddress.cpp (original) +++ lldb/trunk/source/Host/common/SocketAddress.cpp Thu Apr 27 14:45:16 2017 @@ -6,6 +6,12 @@ // License. See LICENSE.TXT for details. // //===--===// +// +// Note: This file is used on Darwin by debugserver, so it needs to remain as +// self contained as possible, and devoid of references to LLVM unless +// there is compelling reason. +// +//===--===// #if defined(_MSC_VER) #define _WINSOCK_DEPRECATED_NO_WARNINGS ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301581 - Fixing Windows bot
Author: cbieneman Date: Thu Apr 27 14:56:54 2017 New Revision: 301581 URL: http://llvm.org/viewvc/llvm-project?rev=301581&view=rev Log: Fixing Windows bot URL: http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/8700 Modified: lldb/trunk/include/lldb/Host/PosixApi.h Modified: lldb/trunk/include/lldb/Host/PosixApi.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/PosixApi.h?rev=301581&r1=301580&r2=301581&view=diff == --- lldb/trunk/include/lldb/Host/PosixApi.h (original) +++ lldb/trunk/include/lldb/Host/PosixApi.h Thu Apr 27 14:56:54 2017 @@ -14,7 +14,7 @@ // to provide a minimum level of compatibility across all platforms to rely // on various posix api functionality. -#if defined(LLVM_ON_WIN32) +#if defined(_WIN32) #include "lldb/Host/windows/PosixApi.h" #endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r302282 - Fix UDP Socket connections
Author: cbieneman Date: Fri May 5 15:35:50 2017 New Revision: 302282 URL: http://llvm.org/viewvc/llvm-project?rev=302282&view=rev Log: Fix UDP Socket connections Some of the refactoring in r301492 broke UDP socket connections. This is a partial revert of that refactoring. At some point I'll spend more time diagnosing where the refactoring went wrong and how to better clean up this code, but I don't have time to do that today. Modified: lldb/trunk/include/lldb/Host/common/UDPSocket.h lldb/trunk/source/Host/common/UDPSocket.cpp Modified: lldb/trunk/include/lldb/Host/common/UDPSocket.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/UDPSocket.h?rev=302282&r1=302281&r2=302282&view=diff == --- lldb/trunk/include/lldb/Host/common/UDPSocket.h (original) +++ lldb/trunk/include/lldb/Host/common/UDPSocket.h Fri May 5 15:35:50 2017 @@ -21,15 +21,13 @@ public: Socket *&socket); private: - UDPSocket(NativeSocket socket, const UDPSocket &listen_socket); + UDPSocket(NativeSocket socket); size_t Send(const void *buf, const size_t num_bytes) override; Error Connect(llvm::StringRef name) override; Error Listen(llvm::StringRef name, int backlog) override; Error Accept(Socket *&socket) override; - Error CreateSocket(); - SocketAddress m_sockaddr; }; } Modified: lldb/trunk/source/Host/common/UDPSocket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/UDPSocket.cpp?rev=302282&r1=302281&r2=302282&view=diff == --- lldb/trunk/source/Host/common/UDPSocket.cpp (original) +++ lldb/trunk/source/Host/common/UDPSocket.cpp Fri May 5 15:35:50 2017 @@ -28,31 +28,41 @@ const int kDomain = AF_INET; const int kType = SOCK_DGRAM; static const char *g_not_supported_error = "Not supported"; -} // namespace - -UDPSocket::UDPSocket(bool should_close, bool child_processes_inherit) -: Socket(ProtocolUdp, should_close, child_processes_inherit) {} +} -UDPSocket::UDPSocket(NativeSocket socket, const UDPSocket &listen_socket) -: Socket(ProtocolUdp, listen_socket.m_should_close_fd, - listen_socket.m_child_processes_inherit) { +UDPSocket::UDPSocket(NativeSocket socket) : Socket(ProtocolUdp, true, true) { m_socket = socket; } +UDPSocket::UDPSocket(bool should_close, bool child_processes_inherit) +: Socket(ProtocolUdp, should_close, child_processes_inherit) {} + size_t UDPSocket::Send(const void *buf, const size_t num_bytes) { return ::sendto(m_socket, static_cast(buf), num_bytes, 0, m_sockaddr, m_sockaddr.GetLength()); } Error UDPSocket::Connect(llvm::StringRef name) { + return Error("%s", g_not_supported_error); +} + +Error UDPSocket::Listen(llvm::StringRef name, int backlog) { + return Error("%s", g_not_supported_error); +} + +Error UDPSocket::Accept(Socket *&socket) { + return Error("%s", g_not_supported_error); +} + +Error UDPSocket::Connect(llvm::StringRef name, bool child_processes_inherit, + Socket *&socket) { + std::unique_ptr final_socket; + Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION)); if (log) log->Printf("UDPSocket::%s (host/port = %s)", __FUNCTION__, name.data()); Error error; - if (error.Fail()) -return error; - std::string host_str; std::string port_str; int32_t port = INT32_MIN; @@ -84,11 +94,12 @@ Error UDPSocket::Connect(llvm::StringRef for (struct addrinfo *service_info_ptr = service_info_list; service_info_ptr != nullptr; service_info_ptr = service_info_ptr->ai_next) { -m_socket = Socket::CreateSocket( +auto send_fd = CreateSocket( service_info_ptr->ai_family, service_info_ptr->ai_socktype, -service_info_ptr->ai_protocol, m_child_processes_inherit, error); +service_info_ptr->ai_protocol, child_processes_inherit, error); if (error.Success()) { - m_sockaddr = service_info_ptr; + final_socket.reset(new UDPSocket(send_fd)); + final_socket->m_sockaddr = service_info_ptr; break; } else continue; @@ -96,17 +107,16 @@ Error UDPSocket::Connect(llvm::StringRef ::freeaddrinfo(service_info_list); - if (IsValid()) + if (!final_socket) return error; SocketAddress bind_addr; // Only bind to the loopback address if we are expecting a connection from // localhost to avoid any firewall issues. - const bool bind_addr_success = - (host_str == "127.0.0.1" || host_str == "localhost") - ? bind_addr.SetToLocalhost(kDomain, port) - : bind_addr.SetToAnyAddress(kDomain, port); + const bool bind_addr_success = (host_str == "127.0.0.1" || host_str == "localhost") + ? bind_addr.SetToLocalhost(kDomain, port) + : bind_addr.SetToAnyAddres
[Lldb-commits] [lldb] r307957 - Fix debugserver accepting remote connections
Author: cbieneman Date: Thu Jul 13 13:58:13 2017 New Revision: 307957 URL: http://llvm.org/viewvc/llvm-project?rev=307957&view=rev Log: Fix debugserver accepting remote connections While adding IPv6 support to debugserver I broke handling wildcard addresses and fully qualified address filtering. This patch resolves that bug and adds a test for matching the address "*". Modified: lldb/trunk/include/lldb/Host/SocketAddress.h lldb/trunk/source/Host/common/SocketAddress.cpp lldb/trunk/tools/debugserver/source/RNBSocket.cpp lldb/trunk/unittests/debugserver/RNBSocketTest.cpp Modified: lldb/trunk/include/lldb/Host/SocketAddress.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/SocketAddress.h?rev=307957&r1=307956&r2=307957&view=diff == --- lldb/trunk/include/lldb/Host/SocketAddress.h (original) +++ lldb/trunk/include/lldb/Host/SocketAddress.h Thu Jul 13 13:58:13 2017 @@ -152,6 +152,11 @@ public: bool IsAnyAddr() const; //-- + // Returns true if the socket is INADDR_LOOPBACK + //-- + bool IsLocalhost() const; + + //-- // Direct access to all of the sockaddr structures //-- struct sockaddr &sockaddr() { Modified: lldb/trunk/source/Host/common/SocketAddress.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/SocketAddress.cpp?rev=307957&r1=307956&r2=307957&view=diff == --- lldb/trunk/source/Host/common/SocketAddress.cpp (original) +++ lldb/trunk/source/Host/common/SocketAddress.cpp Thu Jul 13 13:58:13 2017 @@ -317,6 +317,13 @@ bool SocketAddress::IsAnyAddr() const { : 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr, &in6addr_any, 16); } +bool SocketAddress::IsLocalhost() const { + return (GetFamily() == AF_INET) + ? m_socket_addr.sa_ipv4.sin_addr.s_addr == htonl(INADDR_LOOPBACK) + : 0 == memcmp(&m_socket_addr.sa_ipv6.sin6_addr, &in6addr_loopback, + 16); +} + bool SocketAddress::operator==(const SocketAddress &rhs) const { if (GetFamily() != rhs.GetFamily()) return false; Modified: lldb/trunk/tools/debugserver/source/RNBSocket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBSocket.cpp?rev=307957&r1=307956&r2=307957&view=diff == --- lldb/trunk/tools/debugserver/source/RNBSocket.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBSocket.cpp Thu Jul 13 13:58:13 2017 @@ -79,9 +79,17 @@ rnb_err_t RNBSocket::Listen(const char * return rnb_err; } + bool any_addr = (strcmp(listen_host, "*") == 0); + + // If the user wants to allow connections from any address we should create + // sockets on all families that can resolve localhost. This will allow us to + // listen for IPv6 and IPv4 connections from all addresses if those interfaces + // are available. + const char *local_addr = any_addr ? "localhost" : listen_host; + std::map sockets; auto addresses = lldb_private::SocketAddress::GetAddressInfo( - listen_host, NULL, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP); + local_addr, NULL, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP); for (auto address : addresses) { int sock_fd = ::socket(address.GetFamily(), SOCK_STREAM, IPPROTO_TCP); @@ -90,9 +98,15 @@ rnb_err_t RNBSocket::Listen(const char * SetSocketOption(sock_fd, SOL_SOCKET, SO_REUSEADDR, 1); -address.SetPort(port); +lldb_private::SocketAddress bind_address = address; + +if(any_addr || !bind_address.IsLocalhost()) + bind_address.SetToAnyAddress(bind_address.GetFamily(), port); +else + bind_address.SetPort(port); -int error = ::bind(sock_fd, &address.sockaddr(), address.GetLength()); +int error = +::bind(sock_fd, &bind_address.sockaddr(), bind_address.GetLength()); if (error == -1) { ClosePort(sock_fd, false); continue; @@ -179,6 +193,7 @@ rnb_err_t RNBSocket::Listen(const char * DNBLogThreaded("error: rejecting connection from %s (expecting %s)\n", accept_addr.GetIPAddress().c_str(), addr_in.GetIPAddress().c_str()); + err.Clear(); } } } Modified: lldb/trunk/unittests/debugserver/RNBSocketTest.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/debugserver/RNBSocketTest.cpp?rev=307957&r1=307956&r2=307957&view=diff == --- lldb/trunk/unittests/debugserver/RNBSocketTest.cpp (original) +++ lldb/trunk/unittests/debugserv
[Lldb-commits] [lldb] r308376 - [CMake] [NFC] Remove out of date and redundant version requirement
Author: cbieneman Date: Tue Jul 18 14:15:14 2017 New Revision: 308376 URL: http://llvm.org/viewvc/llvm-project?rev=308376&view=rev Log: [CMake] [NFC] Remove out of date and redundant version requirement Since we set the minimum required version elsewhere to be higher this actually has meaningful good impact. 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=308376&r1=308375&r2=308376&view=diff == --- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original) +++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Tue Jul 18 14:15:14 2017 @@ -2,7 +2,6 @@ # standalone project, using LLVM as an external library: if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(lldb) - cmake_minimum_required(VERSION 2.8.12.2) if (POLICY CMP0022) cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r308377 - [CMake] Refactor debugserver build system
Author: cbieneman Date: Tue Jul 18 14:15:27 2017 New Revision: 308377 URL: http://llvm.org/viewvc/llvm-project?rev=308377&view=rev Log: [CMake] Refactor debugserver build system This refactoring changes two significant things about how the debugserver build system works: (1) debugserver will include all appropriate architecture support, so we can now build arm or ppc debugservers (2) debugserver can be built by itself, so you don't have to configure all of LLDB in order to generate debugserver. Removed: lldb/trunk/tools/debugserver/source/MacOSX/i386/CMakeLists.txt lldb/trunk/tools/debugserver/source/MacOSX/x86_64/CMakeLists.txt Modified: lldb/trunk/tools/debugserver/CMakeLists.txt lldb/trunk/tools/debugserver/source/CMakeLists.txt lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/CMakeLists.txt Modified: lldb/trunk/tools/debugserver/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/CMakeLists.txt?rev=308377&r1=308376&r2=308377&view=diff == --- lldb/trunk/tools/debugserver/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/CMakeLists.txt Tue Jul 18 14:15:27 2017 @@ -1,2 +1,19 @@ -project(C CXX ASM-ATT) +cmake_minimum_required(VERSION 3.4.3) + +project(Debugserver LANGUAGES C CXX ASM-ATT) + +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(CMAKE_MODULE_PATH +${CMAKE_MODULE_PATH} +"${CMAKE_SOURCE_DIR}/../../cmake" +"${CMAKE_SOURCE_DIR}/../../cmake/modules" +) + + include(LLDBStandalone) + include(AddLLDB) + + set(LLDB_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../../") + include_directories(${LLDB_SOURCE_DIR}/include) +endif() + add_subdirectory(source) Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=308377&r1=308376&r2=308377&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Jul 18 14:15:27 2017 @@ -1,3 +1,4 @@ +include(CheckCXXCompilerFlag) include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) include_directories(${LLDB_SOURCE_DIR}/source) include_directories(MacOSX/DarwinLog) @@ -25,7 +26,6 @@ if (CXX_SUPPORTS_NO_EXTENDED_OFFSETOF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extended-offsetof") endif () -find_library(COCOA_LIBRARY Cocoa) add_subdirectory(MacOSX) set(generated_mach_interfaces @@ -91,11 +91,23 @@ set(lldbDebugserverCommonSources add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources}) + +if (APPLE) + if(IOS) +find_library(COCOA_LIBRARY UIKit) +target_link_libraries(lldbDebugserverCommon INTERFACE ${COCOA_LIBRARY} ${CORE_FOUNDATION_LIBRARY} ${FOUNDATION_LIBRARY}) + else() +find_library(COCOA_LIBRARY Cocoa) +target_link_libraries(lldbDebugserverCommon INTERFACE ${COCOA_LIBRARY}) + endif() +endif() + target_link_libraries(lldbDebugserverCommon INTERFACE ${COCOA_LIBRARY} - lldbDebugserverMacOSX_I386 - lldbDebugserverMacOSX_X86_64 - lldbDebugserverMacOSX_DarwinLog) + ${CORE_FOUNDATION_LIBRARY} + ${FOUNDATION_LIBRARY} + lldbDebugserverArchSupport + lldbDebugserverDarwin_DarwinLog) set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources}) add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK Modified: lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt?rev=308377&r1=308376&r2=308377&view=diff == --- lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt Tue Jul 18 14:15:27 2017 @@ -1,8 +1,23 @@ -#add_subdirectory(arm64) -#add_subdirectory(arm) -add_subdirectory(i386) -#add_subdirectory(ppc) -add_subdirectory(x86_64) +if("${CMAKE_OSX_ARCHITECTURES}" MATCHES ".*arm.*") + list(APPEND SOURCES arm/DNBArchImpl.cpp arm64/DNBArchImplARM64.cpp) + include_directories(${CURRENT_SOURCE_DIR}/arm ${CURRENT_SOURCE_DIR}/arm64) +endif() + +if(NOT CMAKE_OSX_ARCHITECTURES OR "${CMAKE_OSX_ARCHITECTURES}" MATCHES ".*86.*") + list(APPEND SOURCES i386/DNBArchImplI386.cpp x86_64/DNBArchImplX86_64.cpp) + include_directories(${CURRENT_SOURCE_DIR}/i386 ${CURRENT_SOURCE_DIR}/x86_64) +endif() + +if("${CMAKE_OSX_ARCHITECTURES}" MATCHES ".*ppc.*") + list(APPEND SOURCES ppc/DNBArchImpl.cpp) + include_directories(${CURRENT_SOURCE_DIR}/ppc) +endif() + add_subdirectory(DarwinLog) include_directories(..) + +include_directories(${LLDB_SOURCE_DIR}/tools
[Lldb-commits] [lldb] r308378 - [CMake] A few fixups to support building LLDB for iOS
Author: cbieneman Date: Tue Jul 18 14:15:53 2017 New Revision: 308378 URL: http://llvm.org/viewvc/llvm-project?rev=308378&view=rev Log: [CMake] A few fixups to support building LLDB for iOS These changes enable proper configuration of LLDB targeting iOS. Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake lldb/trunk/source/Host/CMakeLists.txt Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=308378&r1=308377&r2=308378&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Jul 18 14:15:53 2017 @@ -10,15 +10,20 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND set(LLDB_LINKER_SUPPORTS_GROUPS ON) endif() +set(LLDB_DEFAULT_DISABLE_PYTHON 0) +set(LLDB_DEFAULT_DISABLE_CURSES 0) + if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - set(LLDB_DEFAULT_DISABLE_PYTHON 0) set(LLDB_DEFAULT_DISABLE_CURSES 1) elseif (CMAKE_SYSTEM_NAME MATCHES "Android" ) set(LLDB_DEFAULT_DISABLE_PYTHON 1) set(LLDB_DEFAULT_DISABLE_CURSES 1) -else() - set(LLDB_DEFAULT_DISABLE_PYTHON 0) - set(LLDB_DEFAULT_DISABLE_CURSES 0) +elseif(IOS) + set(LLDB_DEFAULT_DISABLE_PYTHON 1) +endif() + +if(IOS) + add_definitions(-DNO_XPC_SERVICES) endif() set(LLDB_DISABLE_PYTHON ${LLDB_DEFAULT_DISABLE_PYTHON} CACHE BOOL @@ -298,13 +303,15 @@ if (NOT LIBXML2_FOUND AND NOT (CMAKE_SYS endif() # Find libraries or frameworks that may be needed -if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - find_library(CARBON_LIBRARY Carbon) +if (APPLE) + if(NOT IOS) +find_library(CARBON_LIBRARY Carbon) +find_library(CORE_SERVICES_LIBRARY CoreServices) +find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks") + endif() find_library(FOUNDATION_LIBRARY Foundation) find_library(CORE_FOUNDATION_LIBRARY CoreFoundation) - find_library(CORE_SERVICES_LIBRARY CoreServices) find_library(SECURITY_LIBRARY Security) - find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks") set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Output directory for LLDB.framework") set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)") @@ -312,10 +319,13 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources) add_definitions( -DLIBXML2_DEFINED ) - list(APPEND system_libs xml2 ${CURSES_LIBRARIES}) - list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY} - ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY} - ${DEBUG_SYMBOLS_LIBRARY}) + list(APPEND system_libs xml2 + ${CURSES_LIBRARIES} + ${FOUNDATION_LIBRARY} + ${CORE_FOUNDATION_LIBRARY} + ${CORE_SERVICES_LIBRARY} + ${SECURITY_LIBRARY} + ${DEBUG_SYMBOLS_LIBRARY}) else() if (LIBXML2_FOUND) Modified: lldb/trunk/source/Host/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=308378&r1=308377&r2=308378&view=diff == --- lldb/trunk/source/Host/CMakeLists.txt (original) +++ lldb/trunk/source/Host/CMakeLists.txt Tue Jul 18 14:15:53 2017 @@ -103,6 +103,10 @@ else() macosx/cfcpp/CFCMutableSet.cpp macosx/cfcpp/CFCString.cpp ) +if(IOS) + set_property(SOURCE macosx/Host.mm APPEND PROPERTY + COMPILE_DEFINITIONS "NO_XPC_SERVICES=1") +endif() elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android") ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r308509 - Fix GreenDragon bots
Author: cbieneman Date: Wed Jul 19 11:57:16 2017 New Revision: 308509 URL: http://llvm.org/viewvc/llvm-project?rev=308509&view=rev Log: Fix GreenDragon bots This commit removes a very old deprecated API that was causing compile failures for LLDB on Darwin. Since the comment says we only needed to keep the old API around for a few Xcode builds, and the comment was written 6 years ago... I think this can safely go away. Failure URL: http://lab.llvm.org:8080/green/view/LLDB/job/lldb_build_test/29936/console Modified: lldb/trunk/include/lldb/API/SBTarget.h lldb/trunk/source/API/SBTarget.cpp Modified: lldb/trunk/include/lldb/API/SBTarget.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=308509&r1=308508&r2=308509&view=diff == --- lldb/trunk/include/lldb/API/SBTarget.h (original) +++ lldb/trunk/include/lldb/API/SBTarget.h Wed Jul 19 11:57:16 2017 @@ -218,14 +218,6 @@ public: lldb::SBProcess AttachToProcessWithID(SBListener &listener, lldb::pid_t pid, lldb::SBError &error); -#if defined(__APPLE__) - // We need to keep this around for a build or two since Xcode links - // to the 32 bit version of this function. We will take it out soon. - lldb::SBProcess AttachToProcessWithID(SBListener &listener, -::pid_t pid, // 32 bit int process ID -lldb::SBError &error); // DEPRECATED -#endif - //-- /// Attach to process with name. /// Modified: lldb/trunk/source/API/SBTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=308509&r1=308508&r2=308509&view=diff == --- lldb/trunk/source/API/SBTarget.cpp (original) +++ lldb/trunk/source/API/SBTarget.cpp Wed Jul 19 11:57:16 2017 @@ -414,16 +414,6 @@ lldb::SBProcess SBTarget::Attach(SBAttac return sb_process; } -#if defined(__APPLE__) - -lldb::SBProcess SBTarget::AttachToProcessWithID(SBListener &listener, -::pid_t pid, -lldb::SBError &error) { - return AttachToProcessWithID(listener, (lldb::pid_t)pid, error); -} - -#endif // #if defined(__APPLE__) - lldb::SBProcess SBTarget::AttachToProcessWithID( SBListener &listener, lldb::pid_t pid, // The process ID to attach to ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309020 - [CMake] Add debugserver entitlements
Author: cbieneman Date: Tue Jul 25 13:29:28 2017 New Revision: 309020 URL: http://llvm.org/viewvc/llvm-project?rev=309020&view=rev Log: [CMake] Add debugserver entitlements When consigning debugserver we should also include the entitlements file on the code sign command. 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=309020&r1=309019&r2=309020&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Jul 25 13:29:28 2017 @@ -95,10 +95,8 @@ add_library(lldbDebugserverCommon ${lldb if (APPLE) if(IOS) find_library(COCOA_LIBRARY UIKit) -target_link_libraries(lldbDebugserverCommon INTERFACE ${COCOA_LIBRARY} ${CORE_FOUNDATION_LIBRARY} ${FOUNDATION_LIBRARY}) else() find_library(COCOA_LIBRARY Cocoa) -target_link_libraries(lldbDebugserverCommon INTERFACE ${COCOA_LIBRARY}) endif() endif() @@ -117,6 +115,11 @@ add_lldb_tool(debugserver INCLUDE_IN_FRA lldbDebugserverCommon ) +set(entitlements_xml ${CMAKE_CURRENT_SOURCE_DIR}/debugserver-macosx-entitlements.plist) +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.") if (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "")) @@ -129,6 +132,7 @@ if (NOT ("${LLDB_CODESIGN_IDENTITY}" STR POST_BUILD COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${LLDB_CODESIGN_IDENTITY} +--entitlements ${entitlements_xml} $ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309021 - [CMake] Cleanup unnecessary definition
Author: cbieneman Date: Tue Jul 25 13:29:45 2017 New Revision: 309021 URL: http://llvm.org/viewvc/llvm-project?rev=309021&view=rev Log: [CMake] Cleanup unnecessary definition This is only used in one file, and we already set it correctly on that file, so we don't need to set this everywhere. Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=309021&r1=309020&r2=309021&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Jul 25 13:29:45 2017 @@ -22,10 +22,6 @@ elseif(IOS) set(LLDB_DEFAULT_DISABLE_PYTHON 1) endif() -if(IOS) - add_definitions(-DNO_XPC_SERVICES) -endif() - set(LLDB_DISABLE_PYTHON ${LLDB_DEFAULT_DISABLE_PYTHON} CACHE BOOL "Disables the Python scripting integration.") set(LLDB_DISABLE_CURSES ${LLDB_DEFAULT_DISABLE_CURSES} CACHE BOOL @@ -282,6 +278,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) PATTERN ".svn" EXCLUDE PATTERN ".cmake" EXCLUDE PATTERN "Config.h" EXCLUDE +PATTERN "lldb-*.h" EXCLUDE +PATTERN "API/*.h" EXCLUDE ) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ @@ -291,6 +289,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN ".cmake" EXCLUDE +PATTERN "lldb-*.h" EXCLUDE +PATTERN "API/*.h" EXCLUDE ) endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309022 - [CMake] NFC. Cleanup unnecessary CMake policy
Author: cbieneman Date: Tue Jul 25 13:30:18 2017 New Revision: 309022 URL: http://llvm.org/viewvc/llvm-project?rev=309022&view=rev Log: [CMake] NFC. Cleanup unnecessary CMake policy This is just setting to the default behavior, so it does nothing. 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=309022&r1=309021&r2=309022&view=diff == --- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original) +++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Tue Jul 25 13:30:18 2017 @@ -3,10 +3,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(lldb) - if (POLICY CMP0022) -cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required - endif() - option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF) # Rely on llvm-config. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309023 - [CMake] Fix framework build
Author: cbieneman Date: Tue Jul 25 13:30:35 2017 New Revision: 309023 URL: http://llvm.org/viewvc/llvm-project?rev=309023&view=rev Log: [CMake] Fix framework build The LLDB framework build looks for the swig-generated source in the wrong place. This should resolve that. Modified: lldb/trunk/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=309023&r1=309022&r2=309023&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Tue Jul 25 13:30:35 2017 @@ -32,14 +32,16 @@ if (NOT LLDB_DISABLE_PYTHON) endif() set(LLDB_PYTHON_TARGET_DIR ${LLDB_BINARY_DIR}/scripts) + set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp) if(LLDB_BUILD_FRAMEWORK) set(LLDB_PYTHON_TARGET_DIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}) +set(LLDB_WRAP_PYTHON ${LLDB_PYTHON_TARGET_DIR}/LLDBWrapPython.cpp) else() # Don't set -m when building the framework. set(FINISH_EXTRA_ARGS "-m") endif() - set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp) + add_subdirectory(scripts) endif () ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309024 - [CMake] Rework construction of framework bundle
Author: cbieneman Date: Tue Jul 25 13:30:58 2017 New Revision: 309024 URL: http://llvm.org/viewvc/llvm-project?rev=309024&view=rev Log: [CMake] Rework construction of framework bundle This adds an explicit step for processing the headers and restructures how the framework bundles are constructed. This should make the frameworks more reliably constructed. Added: lldb/trunk/scripts/framework-header-fix.sh (with props) Modified: lldb/trunk/source/API/CMakeLists.txt Added: lldb/trunk/scripts/framework-header-fix.sh URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/framework-header-fix.sh?rev=309024&view=auto == --- lldb/trunk/scripts/framework-header-fix.sh (added) +++ lldb/trunk/scripts/framework-header-fix.sh Tue Jul 25 13:30:58 2017 @@ -0,0 +1,13 @@ +#!/bin/sh +# Usage: framework-header-fix.sh +for file in `find $1 -name "*.h"` +do + sed -i '' 's/\(#include\)[ ]*"lldb\/\(API\/\)\{0,1\}\(.*\)"/\1 /1' "$file" + sed -i '' 's|http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=309024&r1=309023&r2=309024&view=diff == --- lldb/trunk/source/API/CMakeLists.txt (original) +++ lldb/trunk/source/API/CMakeLists.txt Tue Jul 25 13:30:58 2017 @@ -156,19 +156,41 @@ endif() target_link_libraries(liblldb PRIVATE ${LLDB_SYSTEM_LIBS}) if(LLDB_BUILD_FRAMEWORK) - file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h) + file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h + ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h) + file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h) + + foreach(header ${root_public_headers}) +list(APPEND copy_headers_commands + COMMAND ${CMAKE_COMMAND} -E copy ${header} ${LLDB_SOURCE_DIR}/include/lldb/API ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders) + endforeach() + + foreach(header ${public_headers} ${root_public_headers}) +get_filename_component(basename ${header} NAME) +list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}) + endforeach() + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/LLDB.h +COMMAND ${CMAKE_COMMAND} -E copy_directory ${LLDB_SOURCE_DIR}/include/lldb/API ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders +${copy_headers_commands} +COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders ${LLDB_VERSION} +) + add_custom_target(lldb-framework-headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/LLDB.h) + add_dependencies(liblldb lldb-framework-headers) + set_target_properties(liblldb PROPERTIES OUTPUT_NAME LLDB FRAMEWORK On FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION} LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR} -PUBLIC_HEADER "${public_headers}") +PUBLIC_HEADER "${framework_headers}") add_custom_command(TARGET liblldb POST_BUILD -COMMAND ${CMAKE_COMMAND} -E make_directory $/Versions/${LLDB_FRAMEWORK_VERSION} -COMMAND ${CMAKE_COMMAND} -E copy_directory ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers -COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers +COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers +COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers +COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $/Resources/Clang ) + endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309025 - [CMake] Update Framework construction for iOS
Author: cbieneman Date: Tue Jul 25 13:31:15 2017 New Revision: 309025 URL: http://llvm.org/viewvc/llvm-project?rev=309025&view=rev Log: [CMake] Update Framework construction for iOS On iOS frameworks don't have versions or resources, they are flatter bundles. This updates the LLDB framework build to accommodate the flatter bundles. Modified: lldb/trunk/cmake/modules/AddLLDB.cmake lldb/trunk/source/API/CMakeLists.txt Modified: lldb/trunk/cmake/modules/AddLLDB.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=309025&r1=309024&r2=309025&view=diff == --- lldb/trunk/cmake/modules/AddLLDB.cmake (original) +++ lldb/trunk/cmake/modules/AddLLDB.cmake Tue Jul 25 13:31:15 2017 @@ -101,11 +101,15 @@ function(add_lldb_executable name) if(LLDB_BUILD_FRAMEWORK) if(ARG_INCLUDE_IN_FRAMEWORK) + if(NOT IOS) +set(resource_dir "/Resources") +set(resource_dots "../") + endif() string(REGEX REPLACE "[^/]+" ".." _dots ${LLDB_FRAMEWORK_INSTALL_DIR}) set_target_properties(${name} PROPERTIES -RUNTIME_OUTPUT_DIRECTORY $/Resources +RUNTIME_OUTPUT_DIRECTORY $${resource_dir} BUILD_WITH_INSTALL_RPATH On -INSTALL_RPATH "@loader_path/../../../../${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}") +INSTALL_RPATH "@loader_path/../../../${resource_dots}${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}") # For things inside the framework we don't need functional install targets # because CMake copies the resources and headers from the build directory. # But we still need this target to exist in order to use the Modified: lldb/trunk/source/API/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=309025&r1=309024&r2=309025&view=diff == --- lldb/trunk/source/API/CMakeLists.txt (original) +++ lldb/trunk/source/API/CMakeLists.txt Tue Jul 25 13:31:15 2017 @@ -185,12 +185,18 @@ if(LLDB_BUILD_FRAMEWORK) LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR} PUBLIC_HEADER "${framework_headers}") - add_custom_command(TARGET liblldb POST_BUILD -COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers -COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers -COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current -COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $/Resources/Clang -) + if(NOT IOS) +add_custom_command(TARGET liblldb POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers + COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $/Resources/Clang + ) + else() +add_custom_command(TARGET liblldb POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers + ) + endif() endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309026 - [CMake] Build debugserver & debugserver_nonui
Author: cbieneman Date: Tue Jul 25 13:31:53 2017 New Revision: 309026 URL: http://llvm.org/viewvc/llvm-project?rev=309026&view=rev Log: [CMake] Build debugserver & debugserver_nonui When building for iOS we build two variants of debugserver. One which supports UI functionality like Springboard for launching applications, and one which does not. This patch adds support for building debugserver with and without UI support libraries being available. 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=309026&r1=309025&r2=309026&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Jul 25 13:31:53 2017 @@ -94,26 +94,72 @@ add_library(lldbDebugserverCommon ${lldb if (APPLE) if(IOS) -find_library(COCOA_LIBRARY UIKit) +find_library(BACKBOARD_LIBRARY BackBoardServices + PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) +find_library(FRONTBOARD_LIBRARY FrontBoardServices + PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) +find_library(SPRINGBOARD_LIBRARY SpringBoardServices + PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) +find_library(MOBILESERVICES_LIBRARY MobileCoreServices + PATHS ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks) +find_library(LOCKDOWN_LIBRARY lockdown) + +if(NOT BACKBOARD_LIBRARY) + set(SKIP_DEBUGSERVER True) +endif() else() find_library(COCOA_LIBRARY Cocoa) endif() endif() -target_link_libraries(lldbDebugserverCommon +if(NOT SKIP_DEBUGSERVER) + target_link_libraries(lldbDebugserverCommon +INTERFACE ${COCOA_LIBRARY} +${CORE_FOUNDATION_LIBRARY} +${FOUNDATION_LIBRARY} +${BACKBOARD_LIBRARY} +${FRONTBOARD_LIBRARY} +${SPRINGBOARD_LIBRARY} +${MOBILESERVICES_LIBRARY} +${LOCKDOWN_LIBRARY} +lldbDebugserverArchSupport +lldbDebugserverDarwin_DarwinLog) + + set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources}) + add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK +debugserver.cpp + +LINK_LIBS + lldbDebugserverCommon +) + if(IOS) +set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS + WITH_LOCKDOWN + WITH_FBS + WITH_BKS + ) +set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_FLAGS + -F${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks + ) + endif() +endif() + +if(IOS) + add_library(lldbDebugserverCommon_NonUI ${lldbDebugserverCommonSources}) + target_link_libraries(lldbDebugserverCommon_NonUI INTERFACE ${COCOA_LIBRARY} ${CORE_FOUNDATION_LIBRARY} ${FOUNDATION_LIBRARY} lldbDebugserverArchSupport lldbDebugserverDarwin_DarwinLog) -set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources}) -add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK - debugserver.cpp + add_lldb_tool(debugserver_nonui INCLUDE_IN_FRAMEWORK +debugserver.cpp - LINK_LIBS -lldbDebugserverCommon - ) +LINK_LIBS + lldbDebugserverCommon_NonUI +) +endif() set(entitlements_xml ${CMAKE_CURRENT_SOURCE_DIR}/debugserver-macosx-entitlements.plist) if(IOS) @@ -136,6 +182,16 @@ if (NOT ("${LLDB_CODESIGN_IDENTITY}" STR $ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) + if(IOS) +add_custom_command(TARGET debugserver_nonui + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} + codesign --force --sign ${LLDB_CODESIGN_IDENTITY} + --entitlements ${entitlements_xml} + $ + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin +) + endif() endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309392 - [CMake] Adapt to clang r309390
Author: cbieneman Date: Fri Jul 28 08:39:49 2017 New Revision: 309392 URL: http://llvm.org/viewvc/llvm-project?rev=309392&view=rev Log: [CMake] Adapt to clang r309390 This removes the configuration order dependence between LLDB and Clang. Modified: lldb/trunk/cmake/modules/AddLLDB.cmake Modified: lldb/trunk/cmake/modules/AddLLDB.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=309392&r1=309391&r2=309392&view=diff == --- lldb/trunk/cmake/modules/AddLLDB.cmake (original) +++ lldb/trunk/cmake/modules/AddLLDB.cmake Fri Jul 28 08:39:49 2017 @@ -76,10 +76,7 @@ function(add_lldb_library name) # Hack: only some LLDB libraries depend on the clang autogenerated headers, # but it is simple enough to make all of LLDB depend on some of those # headers without negatively impacting much of anything. - get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY CLANG_TABLEGEN_TARGETS) - if(CLANG_TABLEGEN_TARGETS) -add_dependencies(${name} ${CLANG_TABLEGEN_TARGETS}) - endif() + add_dependencies(${name} clang-tablegen-targets) set_target_properties(${name} PROPERTIES FOLDER "lldb libraries") endfunction(add_lldb_library) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309393 - [CMake] Enable OS_LOG support on Darwin
Author: cbieneman Date: Fri Jul 28 08:39:50 2017 New Revision: 309393 URL: http://llvm.org/viewvc/llvm-project?rev=309393&view=rev Log: [CMake] Enable OS_LOG support on Darwin This gets CMake to match the Xcode project build Modified: lldb/trunk/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=309393&r1=309392&r2=309393&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Fri Jul 28 08:39:50 2017 @@ -24,6 +24,10 @@ if (LLDB_DISABLE_LIBEDIT) add_definitions( -DLLDB_DISABLE_LIBEDIT ) endif() +if(APPLE) + add_definitions(-DLLDB_USE_OS_LOG) +endif() + # add_subdirectory(include) add_subdirectory(docs) if (NOT LLDB_DISABLE_PYTHON) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309394 - [CMake] Cleanup of header fixup and installation
Author: cbieneman Date: Fri Jul 28 08:39:51 2017 New Revision: 309394 URL: http://llvm.org/viewvc/llvm-project?rev=309394&view=rev Log: [CMake] Cleanup of header fixup and installation This patch does the following: * Gets the header copy step to re-run whenever header change * Gets the header fix-up step to re-run whenever headers are copied * Removes lldb-private*.h headers from the installed headers Modified: lldb/trunk/source/API/CMakeLists.txt Modified: lldb/trunk/source/API/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=309394&r1=309393&r2=309394&view=diff == --- lldb/trunk/source/API/CMakeLists.txt (original) +++ lldb/trunk/source/API/CMakeLists.txt Fri Jul 28 08:39:51 2017 @@ -159,23 +159,19 @@ if(LLDB_BUILD_FRAMEWORK) file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h) file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h) - - foreach(header ${root_public_headers}) -list(APPEND copy_headers_commands - COMMAND ${CMAKE_COMMAND} -E copy ${header} ${LLDB_SOURCE_DIR}/include/lldb/API ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders) - endforeach() + file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h) + list(REMOVE_ITEM root_public_headers ${root_private_headers}) foreach(header ${public_headers} ${root_public_headers}) get_filename_component(basename ${header} NAME) +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename} + DEPENDS ${header} + COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}) list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}) endforeach() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/LLDB.h -COMMAND ${CMAKE_COMMAND} -E copy_directory ${LLDB_SOURCE_DIR}/include/lldb/API ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders -${copy_headers_commands} -COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders ${LLDB_VERSION} -) - add_custom_target(lldb-framework-headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/LLDB.h) + add_custom_target(lldb-framework-headers DEPENDS ${framework_headers} +COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders ${LLDB_VERSION}) add_dependencies(liblldb lldb-framework-headers) set_target_properties(liblldb PROPERTIES ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309395 - [CMake] Add checks for libcompression
Author: cbieneman Date: Fri Jul 28 08:39:51 2017 New Revision: 309395 URL: http://llvm.org/viewvc/llvm-project?rev=309395&view=rev Log: [CMake] Add checks for libcompression This enables libcompression when available in the CMake build system. Modified: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake lldb/trunk/include/lldb/Host/Config.h.cmake lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt lldb/trunk/tools/debugserver/source/CMakeLists.txt Modified: lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake?rev=309395&r1=309394&r2=309395&view=diff == --- lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBGenerateConfig.cmake Fri Jul 28 08:39:51 2017 @@ -3,6 +3,7 @@ include(CheckSymbolExists) include(CheckIncludeFile) include(CheckIncludeFiles) +include(CheckLibraryExists) set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) check_symbol_exists(ppoll poll.h HAVE_PPOLL) @@ -21,6 +22,8 @@ check_cxx_source_compiles(" int main() { return __NR_process_vm_readv; }" HAVE_NR_PROCESS_VM_READV) +check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION) + # These checks exist in LLVM's configuration, so I want to match the LLVM names # so that the check isn't duplicated, but we translate them into the LLDB names # so that I don't have to change all the uses at the moment. Modified: lldb/trunk/include/lldb/Host/Config.h.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h.cmake?rev=309395&r1=309394&r2=309395&view=diff == --- lldb/trunk/include/lldb/Host/Config.h.cmake (original) +++ lldb/trunk/include/lldb/Host/Config.h.cmake Fri Jul 28 08:39:51 2017 @@ -24,4 +24,6 @@ #cmakedefine01 HAVE_NR_PROCESS_VM_READV +#cmakedefine HAVE_LIBCOMPRESSION + #endif // #ifndef LLDB_HOST_CONFIG_H Modified: lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt?rev=309395&r1=309394&r2=309395&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt Fri Jul 28 08:39:51 2017 @@ -7,6 +7,10 @@ set(LLDB_PLUGINS lldbPluginPlatformMacOSX ) +if(HAVE_LIBCOMPRESSION) + set(LIBCOMPRESSION compression) +endif() + add_lldb_library(lldbPluginProcessGDBRemote PLUGIN GDBRemoteClientBase.cpp GDBRemoteCommunication.cpp @@ -30,6 +34,7 @@ add_lldb_library(lldbPluginProcessGDBRem lldbTarget lldbUtility ${LLDB_PLUGINS} +${LIBCOMPRESSION} LINK_COMPONENTS Support ) Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/CMakeLists.txt?rev=309395&r1=309394&r2=309395&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Fri Jul 28 08:39:51 2017 @@ -1,4 +1,5 @@ include(CheckCXXCompilerFlag) +include(CheckLibraryExists) include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) include_directories(${LLDB_SOURCE_DIR}/source) include_directories(MacOSX/DarwinLog) @@ -26,6 +27,8 @@ if (CXX_SUPPORTS_NO_EXTENDED_OFFSETOF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extended-offsetof") endif () +check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION) + add_subdirectory(MacOSX) set(generated_mach_interfaces @@ -123,8 +126,12 @@ if(NOT SKIP_DEBUGSERVER) ${MOBILESERVICES_LIBRARY} ${LOCKDOWN_LIBRARY} lldbDebugserverArchSupport -lldbDebugserverDarwin_DarwinLog) - +lldbDebugserverDarwin_DarwinLog +compression) + if(HAVE_LIBCOMPRESSION) +set_property(TARGET lldbDebugserverCommon APPEND PROPERTY + COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION) + endif() set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources}) add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK debugserver.cpp @@ -151,9 +158,14 @@ if(IOS) ${CORE_FOUNDATION_LIBRARY} ${FOUNDATION_LIBRARY} lldbDebugserverArchSupport - lldbDebugserverDarwin_DarwinLog) + lldbDebugserverDarwin_DarwinLog + compression) + if(HAVE_LIBCOMPRESSION) +set_property(TARGET lldbDebugserverCommon_NonUI APPEND PROPERTY + COMPILE_DEFINITIONS HAVE_LIBCOMPRES
[Lldb-commits] [lldb] r309396 - [CMake] libcompression is optional not required for debugserver
Author: cbieneman Date: Fri Jul 28 08:44:16 2017 New Revision: 309396 URL: http://llvm.org/viewvc/llvm-project?rev=309396&view=rev Log: [CMake] libcompression is optional not required for debugserver Fix a quick bug from r309395. 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=309396&r1=309395&r2=309396&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Fri Jul 28 08:44:16 2017 @@ -115,6 +115,10 @@ if (APPLE) endif() endif() +if(HAVE_LIBCOMPRESSION) + set(LIBCOMPRESSION compression) +endif() + if(NOT SKIP_DEBUGSERVER) target_link_libraries(lldbDebugserverCommon INTERFACE ${COCOA_LIBRARY} @@ -127,7 +131,7 @@ if(NOT SKIP_DEBUGSERVER) ${LOCKDOWN_LIBRARY} lldbDebugserverArchSupport lldbDebugserverDarwin_DarwinLog -compression) +${LIBCOMPRESSION}) if(HAVE_LIBCOMPRESSION) set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION) @@ -159,7 +163,7 @@ if(IOS) ${FOUNDATION_LIBRARY} lldbDebugserverArchSupport lldbDebugserverDarwin_DarwinLog - compression) + ${LIBCOMPRESSION}) if(HAVE_LIBCOMPRESSION) set_property(TARGET lldbDebugserverCommon_NonUI APPEND PROPERTY COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309428 - [CMake] debugserver-nonui doesn't go in the framework
Author: cbieneman Date: Fri Jul 28 13:27:37 2017 New Revision: 309428 URL: http://llvm.org/viewvc/llvm-project?rev=309428&view=rev Log: [CMake] debugserver-nonui doesn't go in the framework Small change to correct the install path of the nonui debugserver. 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=309428&r1=309427&r2=309428&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Fri Jul 28 13:27:37 2017 @@ -169,7 +169,7 @@ if(IOS) COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION) endif() - add_lldb_tool(debugserver-nonui INCLUDE_IN_FRAMEWORK + add_lldb_tool(debugserver-nonui debugserver.cpp LINK_LIBS ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r309429 - [CMake] Add SharingPtr.h to the Framework header list
Author: cbieneman Date: Fri Jul 28 13:27:38 2017 New Revision: 309429 URL: http://llvm.org/viewvc/llvm-project?rev=309429&view=rev Log: [CMake] Add SharingPtr.h to the Framework header list lldb-forward.h which is a public header uses SharingPtr, so we need to include that header as well. Modified: lldb/trunk/source/API/CMakeLists.txt Modified: lldb/trunk/source/API/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=309429&r1=309428&r2=309429&view=diff == --- lldb/trunk/source/API/CMakeLists.txt (original) +++ lldb/trunk/source/API/CMakeLists.txt Fri Jul 28 13:27:38 2017 @@ -162,7 +162,7 @@ if(LLDB_BUILD_FRAMEWORK) file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h) list(REMOVE_ITEM root_public_headers ${root_private_headers}) - foreach(header ${public_headers} ${root_public_headers}) + foreach(header ${public_headers} ${root_public_headers} ${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h) get_filename_component(basename ${header} NAME) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename} DEPENDS ${header} ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r310936 - [CMake] Disable code sign entitlements when using lldb_codesign
Author: cbieneman Date: Tue Aug 15 10:42:20 2017 New Revision: 310936 URL: http://llvm.org/viewvc/llvm-project?rev=310936&view=rev Log: [CMake] Disable code sign entitlements when using lldb_codesign Turns out self-signed certificates and entitlements don't always play well together... 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=310936&r1=310935&r2=310936&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Aug 15 10:42:20 2017 @@ -184,7 +184,16 @@ 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_INDENTITY 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 (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL "")) + if(LLDB_USE_ENTITLEMENTS) +set(entitlements_flags --entitlements ${entitlements_xml}) + endif() execute_process( COMMAND xcrun -f codesign_allocate OUTPUT_STRIP_TRAILING_WHITESPACE @@ -194,7 +203,7 @@ if (NOT ("${LLDB_CODESIGN_IDENTITY}" STR POST_BUILD COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${LLDB_CODESIGN_IDENTITY} ---entitlements ${entitlements_xml} +${entitlements_flags} $ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) @@ -203,7 +212,7 @@ if (NOT ("${LLDB_CODESIGN_IDENTITY}" STR POST_BUILD COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${LLDB_CODESIGN_IDENTITY} - --entitlements ${entitlements_xml} + ${entitlements_flags} $ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r310955 - [CMake] Fixing an error in STREQUAL usage.
Author: cbieneman Date: Tue Aug 15 13:56:04 2017 New Revision: 310955 URL: http://llvm.org/viewvc/llvm-project?rev=310955&view=rev Log: [CMake] Fixing an error in STREQUAL usage. 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=310955&r1=310954&r2=310955&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Tue Aug 15 13:56:04 2017 @@ -185,7 +185,7 @@ 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_INDENTITY STREQUAL "lldb_codesign") +if("${LLDB_CODESIGN_INDENTITY}" 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}) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r312008 - [IPv6] Fix a bug in the IPv6 listen behavior
Author: cbieneman Date: Tue Aug 29 09:13:41 2017 New Revision: 312008 URL: http://llvm.org/viewvc/llvm-project?rev=312008&view=rev Log: [IPv6] Fix a bug in the IPv6 listen behavior The socket bind address should either be localhost or anyaddress. This bug in the listen behavior was preventing lldb-server from opening sockets for non-localhost connections. The added test verifies that opening an anyaddress socket works and has a non-zero port assignment. This should resolve PR34183. Modified: lldb/trunk/source/Host/common/TCPSocket.cpp lldb/trunk/unittests/Host/SocketTest.cpp Modified: lldb/trunk/source/Host/common/TCPSocket.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TCPSocket.cpp?rev=312008&r1=312007&r2=312008&view=diff == --- lldb/trunk/source/Host/common/TCPSocket.cpp (original) +++ lldb/trunk/source/Host/common/TCPSocket.cpp Tue Aug 29 09:13:41 2017 @@ -198,9 +198,14 @@ Status TCPSocket::Listen(llvm::StringRef ::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, option_value_p, sizeof(option_value)); -address.SetPort(port); +SocketAddress listen_address = address; +if(!listen_address.IsLocalhost()) + listen_address.SetToAnyAddress(address.GetFamily(), port); +else + listen_address.SetPort(port); -int err = ::bind(fd, &address.sockaddr(), address.GetLength()); +int err = +::bind(fd, &listen_address.sockaddr(), listen_address.GetLength()); if (-1 != err) err = ::listen(fd, backlog); Modified: lldb/trunk/unittests/Host/SocketTest.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SocketTest.cpp?rev=312008&r1=312007&r2=312008&view=diff == --- lldb/trunk/unittests/Host/SocketTest.cpp (original) +++ lldb/trunk/unittests/Host/SocketTest.cpp Tue Aug 29 09:13:41 2017 @@ -220,3 +220,14 @@ TEST_F(SocketTest, UDPConnect) { EXPECT_TRUE(error.Success()); EXPECT_TRUE(socket_up->IsValid()); } + +TEST_F(SocketTest, TCPListen0GetPort) { + Socket *server_socket; + Predicate port_predicate; + port_predicate.SetValue(0, eBroadcastNever); + Status err = + Socket::TcpListen("10.10.12.3:0", false, server_socket, &port_predicate); + std::unique_ptr socket_up((TCPSocket*)server_socket); + EXPECT_TRUE(socket_up->IsValid()); + EXPECT_NE(socket_up->GetLocalPortNumber(), 0); +} ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r312666 - [CMake] Need to set WITH_LOCKDOWN on debugserver target
Author: cbieneman Date: Wed Sep 6 13:15:43 2017 New Revision: 312666 URL: http://llvm.org/viewvc/llvm-project?rev=312666&view=rev Log: [CMake] Need to set WITH_LOCKDOWN on debugserver target Turns out WITH_LOCKDOWN define changes the struct layout and constructor implementation for RNBSocket which is used in debugserver.cpp, so we need to make sure this is consistent. In the future we should change WITH_LOCKDOWN to be configured in a generated header, but for now we can just set it correctly. Modified: lldb/trunk/tools/debugserver/source/CMakeLists.txt lldb/trunk/unittests/debugserver/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=312666&r1=312665&r2=312666&view=diff == --- lldb/trunk/tools/debugserver/source/CMakeLists.txt (original) +++ lldb/trunk/tools/debugserver/source/CMakeLists.txt Wed Sep 6 13:15:43 2017 @@ -149,6 +149,11 @@ if(NOT SKIP_DEBUGSERVER) WITH_FBS WITH_BKS ) +set_property(TARGET debugserver APPEND PROPERTY COMPILE_DEFINITIONS + WITH_LOCKDOWN + WITH_FBS + WITH_BKS + ) set_property(TARGET lldbDebugserverCommon APPEND PROPERTY COMPILE_FLAGS -F${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks ) Modified: lldb/trunk/unittests/debugserver/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/debugserver/CMakeLists.txt?rev=312666&r1=312665&r2=312666&view=diff == --- lldb/trunk/unittests/debugserver/CMakeLists.txt (original) +++ lldb/trunk/unittests/debugserver/CMakeLists.txt Wed Sep 6 13:15:43 2017 @@ -17,3 +17,22 @@ add_lldb_unittest(debugserverTests LINK_COMPONENTS Support ) + +if(IOS) + set_property(TARGET debugserverTests APPEND PROPERTY COMPILE_DEFINITIONS + WITH_LOCKDOWN + WITH_FBS + WITH_BKS + ) + + add_lldb_unittest(debugserverNonUITests +RNBSocketTest.cpp +debugserver_LogCallback.cpp + +LINK_LIBS + lldbDebugserverCommon_NonUI + lldbHost +LINK_COMPONENTS + Support +) +endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r315120 - [CMake] Add LLDB_INCLUDE_TESTS variable
Author: cbieneman Date: Fri Oct 6 15:21:36 2017 New Revision: 315120 URL: http://llvm.org/viewvc/llvm-project?rev=315120&view=rev Log: [CMake] Add LLDB_INCLUDE_TESTS variable This behaves like the other *_INCLUDE_TESTS variables in CMake and is tied to LLVM_INCLUDE_TESTS so that if you're building in-tree and not building the LLVM tests, you also won't build the LLDB tests. Modified: lldb/trunk/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=315120&r1=315119&r2=315120&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Fri Oct 6 15:21:36 2017 @@ -57,10 +57,15 @@ if (NOT LLDB_DISABLE_PYTHON) add_subdirectory(scripts) endif () add_subdirectory(source) -add_subdirectory(test) add_subdirectory(tools) -add_subdirectory(unittests) -add_subdirectory(lit) + +option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." + ${LLVM_INCLUDE_TESTS}) +if(LLDB_INCLUDE_TESTS) + add_subdirectory(test) + add_subdirectory(unittests) + add_subdirectory(lit) +endif() if (NOT LLDB_DISABLE_PYTHON) # Add a Post-Build Event to copy over Python files and create the symlink ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25486: Fix lookup path for lldb-mi
beanz created this revision. beanz added reviewers: tfiala, zturner. beanz added a subscriber: lldb-commits. The test suite calls realpath on the lldb executable then append "-mi" to it to find the path of the lldb-mi executable. This does not work when using CMake builds on *nix platforms. On *nix platforms when a version number is set on executables CMake generates the binary as ${name}-${version} with a symlink named ${name} pointing to it. This results in the lldb executable being named lldb-4.0.0, and since lldb-4.0.0-mi doesn't ever match the lldb-mi executable these tests are always disabled. This patch looks for lldb-mi in the same directory as lldb. https://reviews.llvm.org/D25486 Files: packages/Python/lldbsuite/test/dotest.py Index: packages/Python/lldbsuite/test/dotest.py === --- packages/Python/lldbsuite/test/dotest.py +++ packages/Python/lldbsuite/test/dotest.py @@ -673,16 +673,15 @@ # Assume lldb-mi is in same place as lldb # If not found, disable the lldb-mi tests -lldbMiExec = None -if lldbtest_config.lldbExec and is_exe(lldbtest_config.lldbExec + "-mi"): -lldbMiExec = lldbtest_config.lldbExec + "-mi" -if not lldbMiExec: +lldbDir = os.path.dirname(lldbtest_config.lldbExec) +lldbMiExec = os.path.join(lldbDir, "lldb-mi") +if is_exe(lldbMiExec): +os.environ["LLDBMI_EXEC"] = lldbMiExec +else: if not configuration.shouldSkipBecauseOfCategories(["lldb-mi"]): print( "The 'lldb-mi' executable cannot be located. The lldb-mi tests can not be run as a result.") configuration.skipCategories.append("lldb-mi") -else: -os.environ["LLDBMI_EXEC"] = lldbMiExec lldbPythonDir = None # The directory that contains 'lldb/__init__.py' if configuration.lldbFrameworkPath: Index: packages/Python/lldbsuite/test/dotest.py === --- packages/Python/lldbsuite/test/dotest.py +++ packages/Python/lldbsuite/test/dotest.py @@ -673,16 +673,15 @@ # Assume lldb-mi is in same place as lldb # If not found, disable the lldb-mi tests -lldbMiExec = None -if lldbtest_config.lldbExec and is_exe(lldbtest_config.lldbExec + "-mi"): -lldbMiExec = lldbtest_config.lldbExec + "-mi" -if not lldbMiExec: +lldbDir = os.path.dirname(lldbtest_config.lldbExec) +lldbMiExec = os.path.join(lldbDir, "lldb-mi") +if is_exe(lldbMiExec): +os.environ["LLDBMI_EXEC"] = lldbMiExec +else: if not configuration.shouldSkipBecauseOfCategories(["lldb-mi"]): print( "The 'lldb-mi' executable cannot be located. The lldb-mi tests can not be run as a result.") configuration.skipCategories.append("lldb-mi") -else: -os.environ["LLDBMI_EXEC"] = lldbMiExec lldbPythonDir = None # The directory that contains 'lldb/__init__.py' if configuration.lldbFrameworkPath: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25487: Fix building tests without system headers on Darwin
beanz created this revision. beanz added reviewers: tfiala, zturner. beanz added a subscriber: lldb-commits. Default installations of OS X do not have system headers installed at /usr/include. This patch allows the LLDB test executables to properly compile when built on a system without headers at /usr/include by specifying a default value for the apple-sdk flag as "macosx". https://reviews.llvm.org/D25487 Files: packages/Python/lldbsuite/test/dotest_args.py Index: packages/Python/lldbsuite/test/dotest_args.py === --- packages/Python/lldbsuite/test/dotest_args.py +++ packages/Python/lldbsuite/test/dotest_args.py @@ -75,7 +75,7 @@ group.add_argument('-C', '--compiler', metavar='compiler', dest='compilers', action='append', help=textwrap.dedent( '''Specify the compiler(s) used to build the inferior executables. The compiler path can be an executable basename or a full path to a compiler executable. This option can be specified multiple times.''')) if sys.platform == 'darwin': -group.add_argument('--apple-sdk', metavar='apple_sdk', dest='apple_sdk', help=textwrap.dedent( +group.add_argument('--apple-sdk', metavar='apple_sdk', dest='apple_sdk', default="macosx", help=textwrap.dedent( '''Specify the name of the Apple SDK (macosx, macosx.internal, iphoneos, iphoneos.internal, or path to SDK) and use the appropriate tools from that SDK's toolchain.''')) # FIXME? This won't work for different extra flags according to each arch. group.add_argument( Index: packages/Python/lldbsuite/test/dotest_args.py === --- packages/Python/lldbsuite/test/dotest_args.py +++ packages/Python/lldbsuite/test/dotest_args.py @@ -75,7 +75,7 @@ group.add_argument('-C', '--compiler', metavar='compiler', dest='compilers', action='append', help=textwrap.dedent( '''Specify the compiler(s) used to build the inferior executables. The compiler path can be an executable basename or a full path to a compiler executable. This option can be specified multiple times.''')) if sys.platform == 'darwin': -group.add_argument('--apple-sdk', metavar='apple_sdk', dest='apple_sdk', help=textwrap.dedent( +group.add_argument('--apple-sdk', metavar='apple_sdk', dest='apple_sdk', default="macosx", help=textwrap.dedent( '''Specify the name of the Apple SDK (macosx, macosx.internal, iphoneos, iphoneos.internal, or path to SDK) and use the appropriate tools from that SDK's toolchain.''')) # FIXME? This won't work for different extra flags according to each arch. group.add_argument( ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25488: Fix test suite lookup path for LLDB.h
beanz created this revision. beanz added reviewers: tfiala, zturner. beanz added a subscriber: lldb-commits. When running on Darwin, the test suite assumes a specific directory structure for the build directory. This works for the Xcode project builds, but fails for CMake builds regardless of whether or not you are generating the LLDB framework. This patch allows the Darwin code path to fall back to the more generic code path used by other platforms in the event that LLDB.h isn't where the test suite expects it. This allows API tests to run on Darwin when building with CMake with the framework build enabled or disabled. https://reviews.llvm.org/D25488 Files: packages/Python/lldbsuite/test/decorators.py Index: packages/Python/lldbsuite/test/decorators.py === --- packages/Python/lldbsuite/test/decorators.py +++ packages/Python/lldbsuite/test/decorators.py @@ -512,13 +512,15 @@ 'Current', 'Headers', 'LLDB.h') -else: -header = os.path.join( -os.environ["LLDB_SRC"], -"include", -"lldb", -"API", -"LLDB.h") +if os.path.exists(header): +return None + +header = os.path.join( +os.environ["LLDB_SRC"], +"include", +"lldb", +"API", +"LLDB.h") if not os.path.exists(header): return "skip because LLDB.h header not found" return None Index: packages/Python/lldbsuite/test/decorators.py === --- packages/Python/lldbsuite/test/decorators.py +++ packages/Python/lldbsuite/test/decorators.py @@ -512,13 +512,15 @@ 'Current', 'Headers', 'LLDB.h') -else: -header = os.path.join( -os.environ["LLDB_SRC"], -"include", -"lldb", -"API", -"LLDB.h") +if os.path.exists(header): +return None + +header = os.path.join( +os.environ["LLDB_SRC"], +"include", +"lldb", +"API", +"LLDB.h") if not os.path.exists(header): return "skip because LLDB.h header not found" return None ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25489: Use LLDB_SRC for relative paths
beanz created this revision. beanz added reviewers: tfiala, zturner. beanz added a subscriber: lldb-commits. Going from LLDB_SRC instead of the file path is safer when looking for compiler-rt. Also need to add support for looking inside the LLVM runtimes subdirectory. Eventually we should just get CMake to provide these paths during configuration. https://reviews.llvm.org/D25489 Files: packages/Python/lldbsuite/test/decorators.py Index: packages/Python/lldbsuite/test/decorators.py === --- packages/Python/lldbsuite/test/decorators.py +++ packages/Python/lldbsuite/test/decorators.py @@ -647,14 +647,22 @@ """Decorate the item to skip tests if testing remotely.""" def is_compiler_rt_missing(): compilerRtPath = os.path.join( -os.path.dirname(__file__), -"..", +os.environ["LLDB_SRC"], "..", "..", "..", "llvm", "projects", "compiler-rt") +if not os.path.exists(compilerRtPath): +compilerRtPath = os.path.join( +os.environ["LLDB_SRC"], +"..", +"..", +"..", +"llvm", +"runtimes", +"compiler-rt") return "compiler-rt not found" if not os.path.exists( compilerRtPath) else None return skipTestIfFn(is_compiler_rt_missing)(func) Index: packages/Python/lldbsuite/test/decorators.py === --- packages/Python/lldbsuite/test/decorators.py +++ packages/Python/lldbsuite/test/decorators.py @@ -647,14 +647,22 @@ """Decorate the item to skip tests if testing remotely.""" def is_compiler_rt_missing(): compilerRtPath = os.path.join( -os.path.dirname(__file__), -"..", +os.environ["LLDB_SRC"], "..", "..", "..", "llvm", "projects", "compiler-rt") +if not os.path.exists(compilerRtPath): +compilerRtPath = os.path.join( +os.environ["LLDB_SRC"], +"..", +"..", +"..", +"llvm", +"runtimes", +"compiler-rt") return "compiler-rt not found" if not os.path.exists( compilerRtPath) else None return skipTestIfFn(is_compiler_rt_missing)(func) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25490: [CMake] Cleanup check-lldb targets
beanz created this revision. beanz added reviewers: tfiala, zturner. beanz added a subscriber: lldb-commits. Herald added a subscriber: mgorny. This patch adds the following fixes to the check-lldb targets: - Adds missing dependencies on lldb tools so they get built before tests execute - Adds Ninja USES_TERMINAL to the target so that the output streams to stdout as it executes - Uses a generator expression to find the lldb executable, this is more robust than constructing the path manually https://reviews.llvm.org/D25490 Files: test/CMakeLists.txt Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -8,9 +8,25 @@ add_custom_target(${name} COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} COMMENT "${comment}" +DEPENDS ${LLDB_TEST_DEPS} +USES_TERMINAL ) endfunction() +set(LLDB_TEST_DEPS lldb) + +if(TARGET lldb-server) + list(APPEND LLDB_TEST_DEPS lldb-server) +endif() + +if(TARGET debugserver) + list(APPEND LLDB_TEST_DEPS debugserver) +endif() + +if(TARGET lldb-mi) + list(APPEND LLDB_TEST_DEPS lldb-mi) +endif() + if ("${LLDB_TEST_COMPILER}" STREQUAL "") string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}) endif() @@ -34,8 +50,7 @@ set(LLDB_TEST_COMMON_ARGS --arch=${LLDB_TEST_ARCH} - --executable - ${CMAKE_BINARY_DIR}/bin/lldb${CMAKE_EXECUTABLE_SUFFIX} + --executable $ -s ${CMAKE_BINARY_DIR}/lldb-test-traces -S nm Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -8,9 +8,25 @@ add_custom_target(${name} COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} COMMENT "${comment}" +DEPENDS ${LLDB_TEST_DEPS} +USES_TERMINAL ) endfunction() +set(LLDB_TEST_DEPS lldb) + +if(TARGET lldb-server) + list(APPEND LLDB_TEST_DEPS lldb-server) +endif() + +if(TARGET debugserver) + list(APPEND LLDB_TEST_DEPS debugserver) +endif() + +if(TARGET lldb-mi) + list(APPEND LLDB_TEST_DEPS lldb-mi) +endif() + if ("${LLDB_TEST_COMPILER}" STREQUAL "") string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}) endif() @@ -34,8 +50,7 @@ set(LLDB_TEST_COMMON_ARGS --arch=${LLDB_TEST_ARCH} - --executable - ${CMAKE_BINARY_DIR}/bin/lldb${CMAKE_EXECUTABLE_SUFFIX} + --executable $ -s ${CMAKE_BINARY_DIR}/lldb-test-traces -S nm ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284041 - Fix lookup path for lldb-mi
Author: cbieneman Date: Wed Oct 12 15:15:46 2016 New Revision: 284041 URL: http://llvm.org/viewvc/llvm-project?rev=284041&view=rev Log: Fix lookup path for lldb-mi Summary: The test suite calls realpath on the lldb executable then append "-mi" to it to find the path of the lldb-mi executable. This does not work when using CMake builds on *nix platforms. On *nix platforms when a version number is set on executables CMake generates the binary as ${name}-${version} with a symlink named ${name} pointing to it. This results in the lldb executable being named lldb-4.0.0, and since lldb-4.0.0-mi doesn't ever match the lldb-mi executable these tests are always disabled. This patch looks for lldb-mi in the same directory as lldb. Reviewers: zturner, tfiala Subscribers: ki.stfu, enlight, lldb-commits Differential Revision: https://reviews.llvm.org/D25486 Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=284041&r1=284040&r2=284041&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Oct 12 15:15:46 2016 @@ -673,16 +673,17 @@ def setupSysPath(): # Assume lldb-mi is in same place as lldb # If not found, disable the lldb-mi tests -lldbMiExec = None -if lldbtest_config.lldbExec and is_exe(lldbtest_config.lldbExec + "-mi"): -lldbMiExec = lldbtest_config.lldbExec + "-mi" -if not lldbMiExec: +# TODO: Append .exe on Windows +# - this will be in a separate commit in case the mi tests fail horribly +lldbDir = os.path.dirname(lldbtest_config.lldbExec) +lldbMiExec = os.path.join(lldbDir, "lldb-mi") +if is_exe(lldbMiExec): +os.environ["LLDBMI_EXEC"] = lldbMiExec +else: if not configuration.shouldSkipBecauseOfCategories(["lldb-mi"]): print( "The 'lldb-mi' executable cannot be located. The lldb-mi tests can not be run as a result.") configuration.skipCategories.append("lldb-mi") -else: -os.environ["LLDBMI_EXEC"] = lldbMiExec lldbPythonDir = None # The directory that contains 'lldb/__init__.py' if configuration.lldbFrameworkPath: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284042 - Fix building tests without system headers on Darwin
Author: cbieneman Date: Wed Oct 12 15:19:19 2016 New Revision: 284042 URL: http://llvm.org/viewvc/llvm-project?rev=284042&view=rev Log: Fix building tests without system headers on Darwin Summary: Default installations of OS X do not have system headers installed at /usr/include. This patch allows the LLDB test executables to properly compile when built on a system without headers at /usr/include by specifying a default value for the apple-sdk flag as "macosx". Reviewers: tfiala, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25487 Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=284042&r1=284041&r2=284042&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Wed Oct 12 15:19:19 2016 @@ -75,7 +75,7 @@ def create_parser(): group.add_argument('-C', '--compiler', metavar='compiler', dest='compilers', action='append', help=textwrap.dedent( '''Specify the compiler(s) used to build the inferior executables. The compiler path can be an executable basename or a full path to a compiler executable. This option can be specified multiple times.''')) if sys.platform == 'darwin': -group.add_argument('--apple-sdk', metavar='apple_sdk', dest='apple_sdk', help=textwrap.dedent( +group.add_argument('--apple-sdk', metavar='apple_sdk', dest='apple_sdk', default="macosx", help=textwrap.dedent( '''Specify the name of the Apple SDK (macosx, macosx.internal, iphoneos, iphoneos.internal, or path to SDK) and use the appropriate tools from that SDK's toolchain.''')) # FIXME? This won't work for different extra flags according to each arch. group.add_argument( ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284043 - Fix test suite lookup path for LLDB.h
Author: cbieneman Date: Wed Oct 12 15:22:02 2016 New Revision: 284043 URL: http://llvm.org/viewvc/llvm-project?rev=284043&view=rev Log: Fix test suite lookup path for LLDB.h Summary: When running on Darwin, the test suite assumes a specific directory structure for the build directory. This works for the Xcode project builds, but fails for CMake builds regardless of whether or not you are generating the LLDB framework. This patch allows the Darwin code path to fall back to the more generic code path used by other platforms in the event that LLDB.h isn't where the test suite expects it. This allows API tests to run on Darwin when building with CMake with the framework build enabled or disabled. Reviewers: tfiala, zturner Subscribers: labath, lldb-commits Differential Revision: https://reviews.llvm.org/D25488 Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=284043&r1=284042&r2=284043&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Oct 12 15:22:02 2016 @@ -512,13 +512,15 @@ def skipIfNoSBHeaders(func): 'Current', 'Headers', 'LLDB.h') -else: -header = os.path.join( -os.environ["LLDB_SRC"], -"include", -"lldb", -"API", -"LLDB.h") +if os.path.exists(header): +return None + +header = os.path.join( +os.environ["LLDB_SRC"], +"include", +"lldb", +"API", +"LLDB.h") if not os.path.exists(header): return "skip because LLDB.h header not found" return None ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25488: Fix test suite lookup path for LLDB.h
beanz added a comment. @labath I think having them running is useful. At the moment that is probably the only Darwin bot building LLDB using CMake. https://reviews.llvm.org/D25488 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284045 - Use LLDB_SRC for relative paths
Author: cbieneman Date: Wed Oct 12 15:24:42 2016 New Revision: 284045 URL: http://llvm.org/viewvc/llvm-project?rev=284045&view=rev Log: Use LLDB_SRC for relative paths Summary: Going from LLDB_SRC instead of the file path is safer when looking for compiler-rt. Also need to add support for looking inside the LLVM runtimes subdirectory. Eventually we should just get CMake to provide these paths during configuration. Reviewers: tfiala, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25489 Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=284045&r1=284044&r2=284045&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Wed Oct 12 15:24:42 2016 @@ -649,14 +649,22 @@ def skipUnlessCompilerRt(func): """Decorate the item to skip tests if testing remotely.""" def is_compiler_rt_missing(): compilerRtPath = os.path.join( -os.path.dirname(__file__), -"..", +os.environ["LLDB_SRC"], "..", "..", "..", "llvm", "projects", "compiler-rt") +if not os.path.exists(compilerRtPath): +compilerRtPath = os.path.join( +os.environ["LLDB_SRC"], +"..", +"..", +"..", +"llvm", +"runtimes", +"compiler-rt") return "compiler-rt not found" if not os.path.exists( compilerRtPath) else None return skipTestIfFn(is_compiler_rt_missing)(func) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284046 - [CMake] Cleanup check-lldb targets
Author: cbieneman Date: Wed Oct 12 15:26:13 2016 New Revision: 284046 URL: http://llvm.org/viewvc/llvm-project?rev=284046&view=rev Log: [CMake] Cleanup check-lldb targets Summary: This patch adds the following fixes to the check-lldb targets: * Adds missing dependencies on lldb tools so they get built before tests execute * Adds Ninja USES_TERMINAL to the target so that the output streams to stdout as it executes * Uses a generator expression to find the lldb executable, this is more robust than constructing the path manually Reviewers: tfiala, zturner Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D25490 Modified: lldb/trunk/test/CMakeLists.txt Modified: lldb/trunk/test/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=284046&r1=284045&r2=284046&view=diff == --- lldb/trunk/test/CMakeLists.txt (original) +++ lldb/trunk/test/CMakeLists.txt Wed Oct 12 15:26:13 2016 @@ -8,9 +8,25 @@ function(add_python_test_target name tes add_custom_target(${name} COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} COMMENT "${comment}" +DEPENDS ${LLDB_TEST_DEPS} +USES_TERMINAL ) endfunction() +set(LLDB_TEST_DEPS lldb) + +if(TARGET lldb-server) + list(APPEND LLDB_TEST_DEPS lldb-server) +endif() + +if(TARGET debugserver) + list(APPEND LLDB_TEST_DEPS debugserver) +endif() + +if(TARGET lldb-mi) + list(APPEND LLDB_TEST_DEPS lldb-mi) +endif() + if ("${LLDB_TEST_COMPILER}" STREQUAL "") string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}) endif() @@ -34,8 +50,7 @@ set(LLDB_TEST_USER_ARGS set(LLDB_TEST_COMMON_ARGS --arch=${LLDB_TEST_ARCH} - --executable - ${CMAKE_BINARY_DIR}/bin/lldb${CMAKE_EXECUTABLE_SUFFIX} + --executable $ -s ${CMAKE_BINARY_DIR}/lldb-test-traces -S nm ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25486: Fix lookup path for lldb-mi
beanz added inline comments. Comment at: packages/Python/lldbsuite/test/dotest.py:676-677 # If not found, disable the lldb-mi tests -lldbMiExec = None -if lldbtest_config.lldbExec and is_exe(lldbtest_config.lldbExec + "-mi"): -lldbMiExec = lldbtest_config.lldbExec + "-mi" -if not lldbMiExec: +lldbDir = os.path.dirname(lldbtest_config.lldbExec) +lldbMiExec = os.path.join(lldbDir, "lldb-mi") +if is_exe(lldbMiExec): ki.stfu wrote: > Maybe it would be better to replace "lldb" with "lldb-mi" in > lldbtest_config.lldbExec? So we will take into account their versions instead > of ignoring them. That is a good idea, assuming the patch as-is doesn't break the world, I'll revise it to that to fix the Windows issue as well. Repository: rL LLVM https://reviews.llvm.org/D25486 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25570: [CMake] Populate LLDB.framework's headers directory
beanz created this revision. beanz added reviewers: tfiala, zturner, spyffe. beanz added a subscriber: lldb-commits. Herald added a subscriber: mgorny. This patch adds support for installing public headers in LLDB.framework, and symlinking the headers into the build directory. While writing the patch I discovered a bug in CMake that prevents applying POST_BUILD steps to framework targets (https://gitlab.kitware.com/cmake/cmake/issues/16363). I've implemented the support using POST_BUILD steps wrapped under a CMake version check with a TODO so that we can track the fix. https://reviews.llvm.org/D25570 Files: source/API/CMakeLists.txt Index: source/API/CMakeLists.txt === --- source/API/CMakeLists.txt +++ source/API/CMakeLists.txt @@ -135,10 +135,26 @@ target_link_libraries(liblldb PRIVATE ${LLDB_SYSTEM_LIBS}) if(LLDB_BUILD_FRAMEWORK) + file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h) set_target_properties(liblldb PROPERTIES OUTPUT_NAME LLDB FRAMEWORK On FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION} -LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}) +LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR} +PUBLIC_HEADER "${public_headers}") + + # Due to a bug in CMake (https://gitlab.kitware.com/cmake/cmake/issues/16363) + # we can't actually put a POST_BUILD step on Framework targets. + # TODO: Once the bug linked above is fixed we can update the version check to + # a valid CMake version. + if(CMAKE_VERSION VERSION_GREATER 99.9) +add_custom_command(TARGET liblldb POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers) + else() +add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers) +add_custom_target(lldb_header_symlink + DEPENDS ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers) + endif() endif() Index: source/API/CMakeLists.txt === --- source/API/CMakeLists.txt +++ source/API/CMakeLists.txt @@ -135,10 +135,26 @@ target_link_libraries(liblldb PRIVATE ${LLDB_SYSTEM_LIBS}) if(LLDB_BUILD_FRAMEWORK) + file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h) set_target_properties(liblldb PROPERTIES OUTPUT_NAME LLDB FRAMEWORK On FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION} -LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}) +LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR} +PUBLIC_HEADER "${public_headers}") + + # Due to a bug in CMake (https://gitlab.kitware.com/cmake/cmake/issues/16363) + # we can't actually put a POST_BUILD step on Framework targets. + # TODO: Once the bug linked above is fixed we can update the version check to + # a valid CMake version. + if(CMAKE_VERSION VERSION_GREATER 99.9) +add_custom_command(TARGET liblldb POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers) + else() +add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers) +add_custom_target(lldb_header_symlink + DEPENDS ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers) + endif() endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25570: [CMake] Populate LLDB.framework's headers directory
beanz added a comment. Worth noting, the CMake bug now has a fix in a pull request: https://gitlab.kitware.com/cmake/cmake/merge_requests/172 https://reviews.llvm.org/D25570 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284250 - [CMake] Populate LLDB.framework's headers directory
Author: cbieneman Date: Fri Oct 14 12:09:55 2016 New Revision: 284250 URL: http://llvm.org/viewvc/llvm-project?rev=284250&view=rev Log: [CMake] Populate LLDB.framework's headers directory Summary: This patch adds support for installing public headers in LLDB.framework, and symlinking the headers into the build directory. While writing the patch I discovered a bug in CMake that prevents applying POST_BUILD steps to framework targets (https://gitlab.kitware.com/cmake/cmake/issues/16363). I've implemented the support using POST_BUILD steps wrapped under a CMake version check with a TODO so that we can track the fix. Reviewers: tfiala, zturner, spyffe Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D25570 Modified: lldb/trunk/source/API/CMakeLists.txt Modified: lldb/trunk/source/API/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=284250&r1=284249&r2=284250&view=diff == --- lldb/trunk/source/API/CMakeLists.txt (original) +++ lldb/trunk/source/API/CMakeLists.txt Fri Oct 14 12:09:55 2016 @@ -135,10 +135,26 @@ endif() target_link_libraries(liblldb PRIVATE ${LLDB_SYSTEM_LIBS}) if(LLDB_BUILD_FRAMEWORK) + file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h) set_target_properties(liblldb PROPERTIES OUTPUT_NAME LLDB FRAMEWORK On FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION} -LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}) +LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR} +PUBLIC_HEADER "${public_headers}") + + # This works around a CMake bug where POST_BUILD steps are not applied to + # framework targets. This fix is merged into the CMake release branch and + # should be available with CMake 3.7 rc2: + # https://gitlab.kitware.com/cmake/cmake/issues/16363 + if(CMAKE_VERSION VERSION_GREATER 3.6.99) +add_custom_command(TARGET liblldb POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers) + else() +add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers + COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_SOURCE_DIR}/include/lldb/API $/Headers) +add_custom_target(lldb_header_symlink + DEPENDS ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Headers) + endif() endif() ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25714: [Test Suite] Allow overriding codesign identity
beanz created this revision. beanz added reviewers: zturner, tfiala. beanz added a subscriber: lldb-commits. Herald added a subscriber: mgorny. Not everyone names their code sign identity "lldb_codesign", so it is nice to allow this to be overridden. https://reviews.llvm.org/D25714 Files: packages/Python/lldbsuite/test/dotest.py packages/Python/lldbsuite/test/dotest_args.py packages/Python/lldbsuite/test/lldbtest.py test/CMakeLists.txt Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -79,6 +79,10 @@ endif() endif() +if(LLDB_CODESIGN_IDENTITY) + list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${LLDB_CODESIGN_IDENTITY}") +endif() + add_python_test_target(check-lldb-single ${LLDB_SOURCE_DIR}/test/dotest.py "--no-multiprocess;${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}" Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1543,8 +1543,8 @@ def signBinary(self, binary_path): if sys.platform.startswith("darwin"): -codesign_cmd = "codesign --force --sign lldb_codesign %s" % ( -binary_path) +codesign_cmd = "codesign --force --sign \"%s\" %s" % ( +os.environ['LLDB_CODESIGN_IDENTITY'], binary_path) call(codesign_cmd, shell=True) def findBuiltClang(self): Index: packages/Python/lldbsuite/test/dotest_args.py === --- packages/Python/lldbsuite/test/dotest_args.py +++ packages/Python/lldbsuite/test/dotest_args.py @@ -151,6 +151,11 @@ dest='log_success', action='store_true', help="Leave logs/traces even for successful test runs (useful for creating reference log files during debugging.)") +group.add_argument( +'--codesign-identity', +metavar='Codesigning identity', +default='lldb_codesign', +help='The codesigning identity to use') # Configuration options group = parser.add_argument_group('Remote platform options') Index: packages/Python/lldbsuite/test/dotest.py === --- packages/Python/lldbsuite/test/dotest.py +++ packages/Python/lldbsuite/test/dotest.py @@ -481,6 +481,8 @@ # Shut off multiprocessing mode when test directories are specified. configuration.no_multiprocess_test_runner = True +os.environ['LLDB_CODESIGN_IDENTITY'] = args.codesign_identity + #print("testdirs:", testdirs) Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -79,6 +79,10 @@ endif() endif() +if(LLDB_CODESIGN_IDENTITY) + list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${LLDB_CODESIGN_IDENTITY}") +endif() + add_python_test_target(check-lldb-single ${LLDB_SOURCE_DIR}/test/dotest.py "--no-multiprocess;${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}" Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1543,8 +1543,8 @@ def signBinary(self, binary_path): if sys.platform.startswith("darwin"): -codesign_cmd = "codesign --force --sign lldb_codesign %s" % ( -binary_path) +codesign_cmd = "codesign --force --sign \"%s\" %s" % ( +os.environ['LLDB_CODESIGN_IDENTITY'], binary_path) call(codesign_cmd, shell=True) def findBuiltClang(self): Index: packages/Python/lldbsuite/test/dotest_args.py === --- packages/Python/lldbsuite/test/dotest_args.py +++ packages/Python/lldbsuite/test/dotest_args.py @@ -151,6 +151,11 @@ dest='log_success', action='store_true', help="Leave logs/traces even for successful test runs (useful for creating reference log files during debugging.)") +group.add_argument( +'--codesign-identity', +metavar='Codesigning identity', +default='lldb_codesign', +help='The codesigning identity to use') # Configuration options group = parser.add_argument_group('Remote platform options') Index: packages/Python/lldbsuite/test/dotest.py === --- packages/Python/lldbsuite/test/dotest.py +++ packages/Python/lldbsuite/test/dotest.py @@ -481,6 +481,8 @@ # Shut off multiprocessing mode when test directories are specified. configuration.no_multiprocess_test_runner = True +os.environ['LLDB_CODESIGN_IDENTITY'] = args.codesign_identity + #print("testdirs:", te
[Lldb-commits] [PATCH] D25668: [cmake] Respect LLVM_CMAKE_PATH in stand-alone builds for GetSVN.cmake
beanz added a comment. Maybe we should define `LLVM_CMAKE_PATH` in llvm's CMakeLists.txt so that we don't need a condition here or in clang where we do the same thing? https://reviews.llvm.org/D25668 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25680: [cmake] Make dependencies of lldb libraries private, take 2
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D25680 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25714: [Test Suite] Allow overriding codesign identity
beanz updated this revision to Diff 75057. beanz added a comment. Updating to use lldbtest_config. https://reviews.llvm.org/D25714 Files: packages/Python/lldbsuite/test/dotest.py packages/Python/lldbsuite/test/dotest_args.py packages/Python/lldbsuite/test/lldbtest.py test/CMakeLists.txt Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -79,6 +79,10 @@ endif() endif() +if(LLDB_CODESIGN_IDENTITY) + list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${LLDB_CODESIGN_IDENTITY}") +endif() + add_python_test_target(check-lldb-single ${LLDB_SOURCE_DIR}/test/dotest.py "--no-multiprocess;${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}" Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1543,8 +1543,8 @@ def signBinary(self, binary_path): if sys.platform.startswith("darwin"): -codesign_cmd = "codesign --force --sign lldb_codesign %s" % ( -binary_path) +codesign_cmd = "codesign --force --sign \"%s\" %s" % ( +lldbtest_config.codesign_identity, binary_path) call(codesign_cmd, shell=True) def findBuiltClang(self): Index: packages/Python/lldbsuite/test/dotest_args.py === --- packages/Python/lldbsuite/test/dotest_args.py +++ packages/Python/lldbsuite/test/dotest_args.py @@ -151,6 +151,11 @@ dest='log_success', action='store_true', help="Leave logs/traces even for successful test runs (useful for creating reference log files during debugging.)") +group.add_argument( +'--codesign-identity', +metavar='Codesigning identity', +default='lldb_codesign', +help='The codesigning identity to use') # Configuration options group = parser.add_argument_group('Remote platform options') Index: packages/Python/lldbsuite/test/dotest.py === --- packages/Python/lldbsuite/test/dotest.py +++ packages/Python/lldbsuite/test/dotest.py @@ -481,6 +481,8 @@ # Shut off multiprocessing mode when test directories are specified. configuration.no_multiprocess_test_runner = True +lldbtest_config.codesign_identity = args.codesign_identity + #print("testdirs:", testdirs) Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -79,6 +79,10 @@ endif() endif() +if(LLDB_CODESIGN_IDENTITY) + list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${LLDB_CODESIGN_IDENTITY}") +endif() + add_python_test_target(check-lldb-single ${LLDB_SOURCE_DIR}/test/dotest.py "--no-multiprocess;${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}" Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1543,8 +1543,8 @@ def signBinary(self, binary_path): if sys.platform.startswith("darwin"): -codesign_cmd = "codesign --force --sign lldb_codesign %s" % ( -binary_path) +codesign_cmd = "codesign --force --sign \"%s\" %s" % ( +lldbtest_config.codesign_identity, binary_path) call(codesign_cmd, shell=True) def findBuiltClang(self): Index: packages/Python/lldbsuite/test/dotest_args.py === --- packages/Python/lldbsuite/test/dotest_args.py +++ packages/Python/lldbsuite/test/dotest_args.py @@ -151,6 +151,11 @@ dest='log_success', action='store_true', help="Leave logs/traces even for successful test runs (useful for creating reference log files during debugging.)") +group.add_argument( +'--codesign-identity', +metavar='Codesigning identity', +default='lldb_codesign', +help='The codesigning identity to use') # Configuration options group = parser.add_argument_group('Remote platform options') Index: packages/Python/lldbsuite/test/dotest.py === --- packages/Python/lldbsuite/test/dotest.py +++ packages/Python/lldbsuite/test/dotest.py @@ -481,6 +481,8 @@ # Shut off multiprocessing mode when test directories are specified. configuration.no_multiprocess_test_runner = True +lldbtest_config.codesign_identity = args.codesign_identity + #print("testdirs:", testdirs) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb
[Lldb-commits] [PATCH] D25745: [CMake] Rename lldb-launcher to darwin-debug
beanz created this revision. beanz added reviewers: tfiala, zturner. beanz added a subscriber: lldb-commits. Herald added a subscriber: mgorny. This tool is only built on Darwin, and the name darwin-debug matches the Xcode project. We should have this in sync unless there is a good reason not to. https://reviews.llvm.org/D25745 Files: tools/darwin-debug/CMakeLists.txt Index: tools/darwin-debug/CMakeLists.txt === --- tools/darwin-debug/CMakeLists.txt +++ tools/darwin-debug/CMakeLists.txt @@ -1,6 +1,6 @@ -add_lldb_executable(lldb-launcher INCLUDE_IN_FRAMEWORK +add_lldb_executable(darwin-debug INCLUDE_IN_FRAMEWORK darwin-debug.cpp ) -install(TARGETS lldb-launcher +install(TARGETS darwin-debug RUNTIME DESTINATION bin) Index: tools/darwin-debug/CMakeLists.txt === --- tools/darwin-debug/CMakeLists.txt +++ tools/darwin-debug/CMakeLists.txt @@ -1,6 +1,6 @@ -add_lldb_executable(lldb-launcher INCLUDE_IN_FRAMEWORK +add_lldb_executable(darwin-debug INCLUDE_IN_FRAMEWORK darwin-debug.cpp ) -install(TARGETS lldb-launcher +install(TARGETS darwin-debug RUNTIME DESTINATION bin) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25750: When invoking Terminal, don't assume the default shell
beanz created this revision. beanz added a reviewer: tfiala. beanz added a subscriber: lldb-commits. If a user has their shell set to a non-POSIX conferment shell the TestTerminal.py tests fail because the shell blurb constructed here may not work in their shell. In my specific case fish-shell (The Friendly Interactive Shell - http://fishshell.com) does not support $?, it instead uses $status (because it is friendly). This patch removes the assumption of your default shell by running the constructed bash command via "/bin/bash -c ...". This should be safer for users mutating their shell environment. https://reviews.llvm.org/D25750 Files: source/Host/macosx/Host.mm Index: source/Host/macosx/Host.mm === --- source/Host/macosx/Host.mm +++ source/Host/macosx/Host.mm @@ -354,11 +354,11 @@ const char *applscript_in_new_tty = "tell application \"Terminal\"\n" " activate\n" -" do script \"%s\"\n" +" do script \"/bin/bash -c '%s';exit\"\n" "end tell\n"; const char *applscript_in_existing_tty = "\ -set the_shell_script to \"%s\"\n\ +set the_shell_script to \"/bin/bash -c '%s';exit\"\n\ tell application \"Terminal\"\n\ repeat with the_window in (get windows)\n\ repeat with the_tab in tabs of the_window\n\ Index: source/Host/macosx/Host.mm === --- source/Host/macosx/Host.mm +++ source/Host/macosx/Host.mm @@ -354,11 +354,11 @@ const char *applscript_in_new_tty = "tell application \"Terminal\"\n" " activate\n" -" do script \"%s\"\n" +" do script \"/bin/bash -c '%s';exit\"\n" "end tell\n"; const char *applscript_in_existing_tty = "\ -set the_shell_script to \"%s\"\n\ +set the_shell_script to \"/bin/bash -c '%s';exit\"\n\ tell application \"Terminal\"\n\ repeat with the_window in (get windows)\n\ repeat with the_tab in tabs of the_window\n\ ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25751: [CMake] Don't include LLDB_TEST_COMPILER in cached variable
beanz created this revision. beanz added reviewers: tfiala, zturner, labath. beanz added a subscriber: lldb-commits. Herald added a subscriber: mgorny. CMake has no builtin mechanism for cache invalidation. As a general convention you want to not expand user-specified variables in other cached variables because they will not get updated when the user changes their specified value. This patch moves the "-C" option for dotest.py into the LLDB_TEST_COMMON_ARGS and out of the CMake cache. In order to prevent issues with out-of-date cache files on builders I've added code to scrub "-C ${LLDB_TEST_COMPILER}" out of the CMake caches, by Force writing the variable. This code can be removed in a few days once the change has trickled through CI systems. https://reviews.llvm.org/D25751 Files: test/CMakeLists.txt Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -43,10 +43,15 @@ ${LLDB_DEFAULT_TEST_ARCH} CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") +# Scrub LLDB_TEST_COMPILER out of the CMake caches +# TODO: remove the replace lines and the FORCE parameter in a few days once the +# change has made its way through bots to clean up their CMake caches. +string(REPLACE "-C;${LLDB_TEST_COMPILER}" "" LLDB_TEST_USER_ARGS_New "${LLDB_TEST_USER_ARGS}") + # Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script set(LLDB_TEST_USER_ARGS - -C ${LLDB_TEST_COMPILER} - CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") + "${LLDB_TEST_USER_ARGS_New}" + CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'" FORCE) set(LLDB_TEST_COMMON_ARGS --arch=${LLDB_TEST_ARCH} @@ -56,6 +61,7 @@ -S nm -u CXXFLAGS -u CFLAGS + -C ${LLDB_TEST_COMPILER} ) if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -43,10 +43,15 @@ ${LLDB_DEFAULT_TEST_ARCH} CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") +# Scrub LLDB_TEST_COMPILER out of the CMake caches +# TODO: remove the replace lines and the FORCE parameter in a few days once the +# change has made its way through bots to clean up their CMake caches. +string(REPLACE "-C;${LLDB_TEST_COMPILER}" "" LLDB_TEST_USER_ARGS_New "${LLDB_TEST_USER_ARGS}") + # Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script set(LLDB_TEST_USER_ARGS - -C ${LLDB_TEST_COMPILER} - CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") + "${LLDB_TEST_USER_ARGS_New}" + CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'" FORCE) set(LLDB_TEST_COMMON_ARGS --arch=${LLDB_TEST_ARCH} @@ -56,6 +61,7 @@ -S nm -u CXXFLAGS -u CFLAGS + -C ${LLDB_TEST_COMPILER} ) if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25753: Use clang --driver-mode instead of guessing c++ compiler path
beanz created this revision. beanz added reviewers: tfiala, zturner, labath. beanz added a subscriber: lldb-commits. When building the LLDB test programs, if your CC is clang it actually isn't safe to make CXX a string replace of "clang -> clang++". This falls down on unix configurations if your compiler is clang-${version}. A safer approach is to use the "--driver-mode=g++" option to tell clang to act like clang++. https://reviews.llvm.org/D25753 Files: packages/Python/lldbsuite/test/make/Makefile.rules Index: packages/Python/lldbsuite/test/make/Makefile.rules === --- packages/Python/lldbsuite/test/make/Makefile.rules +++ packages/Python/lldbsuite/test/make/Makefile.rules @@ -242,27 +242,27 @@ endif # Function that returns the counterpart C++ compiler, given $(CC) as arg. -cxx_compiler_notdir = $(if $(findstring clang,$(1)), \ - $(subst clang,clang++,$(1)), \ - $(if $(findstring icc,$(1)), \ -$(subst icc,icpc,$(1)), \ -$(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ - $(subst gcc,g++,$(1)), \ - $(subst cc,c++,$(1)) +cxx_compiler_notdir = $(if $(findstring icc,$(1)), \ +$(subst icc,icpc,$(1)), \ +$(if $(findstring llvm-gcc,$(1)), \ + $(subst llvm-gcc,llvm-g++,$(1)), \ + $(if $(findstring gcc,$(1)), \ + $(subst gcc,g++,$(1)), \ + $(subst cc,c++,$(1) cxx_compiler = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_compiler_notdir,$(notdir $(1,$(call cxx_compiler_notdir,$(1))) +ifeq ($(findstring clang, $(cxx_compiler)), clang) +CXXFLAGS += --driver-mode=g++ +endif + # Function that returns the C++ linker, given $(CC) as arg. -cxx_linker_notdir = $(if $(findstring clang,$(1)), \ - $(subst clang,clang++,$(1)), \ - $(if $(findstring icc,$(1)), \ - $(subst icc,icpc,$(1)), \ - $(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ -$(subst gcc,g++,$(1)), \ -$(subst cc,c++,$(1)) +cxx_linker_notdir = $(if $(findstring icc,$(1)), \ + $(subst icc,icpc,$(1)), \ + $(if $(findstring llvm-gcc,$(1)), \ + $(subst llvm-gcc,llvm-g++,$(1)), \ + $(if $(findstring gcc,$(1)), \ +$(subst gcc,g++,$(1)), \ +$(subst cc,c++,$(1) cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1,$(call cxx_linker_notdir,$(1))) ifneq "$(OS)" "Darwin" @@ -354,6 +354,7 @@ DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) +LDFLAGS += --driver-mode=g++ endif #-- @@ -377,6 +378,7 @@ ifneq "$(strip $(CXX_SOURCES))" "" OBJECTS +=$(strip $(CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) + LDFLAGS += --driver-mode=g++ LD = $(call cxx_linker,$(CC)) endif @@ -395,6 +397,7 @@ OBJECTS +=$(strip $(OBJCXX_SOURCES:.mm=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) + LDFLAGS += --driver-mode=g++ ifeq "$(findstring lobjc,$(LDFLAGS))" "" LDFLAGS +=-lobjc endif Index: packages/Python/lldbsuite/test/make/Makefile.rules === --- packages/Python/lldbsuite/test/make/Makefile.rules +++ packages/Python/lldbsuite/test/make/Makefile.rules @@ -242,27 +242,27 @@ endif # Function that returns the counterpart C++ compiler, given $(CC) as arg. -cxx_compiler_notdir = $(if $(findstring clang,$(1)), \ - $(subst clang,clang++,$(1)), \ - $(if $(findstring icc,$(1)), \ -$(subst icc,icpc,$(1)), \ -$(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ - $(subst gcc,g++,$(1)), \ - $(su
[Lldb-commits] [lldb] r284550 - Use clang --driver-mode instead of guessing c++ compiler path
Author: cbieneman Date: Tue Oct 18 18:53:24 2016 New Revision: 284550 URL: http://llvm.org/viewvc/llvm-project?rev=284550&view=rev Log: Use clang --driver-mode instead of guessing c++ compiler path Summary: When building the LLDB test programs, if your CC is clang it actually isn't safe to make CXX a string replace of "clang -> clang++". This falls down on unix configurations if your compiler is clang-${version}. A safer approach is to use the "--driver-mode=g++" option to tell clang to act like clang++. Reviewers: tfiala, zturner, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25753 Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=284550&r1=284549&r2=284550&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original) +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Oct 18 18:53:24 2016 @@ -242,27 +242,27 @@ ifneq "$(DYLIB_NAME)" "" endif # Function that returns the counterpart C++ compiler, given $(CC) as arg. -cxx_compiler_notdir = $(if $(findstring clang,$(1)), \ - $(subst clang,clang++,$(1)), \ - $(if $(findstring icc,$(1)), \ -$(subst icc,icpc,$(1)), \ -$(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ - $(subst gcc,g++,$(1)), \ - $(subst cc,c++,$(1)) +cxx_compiler_notdir = $(if $(findstring icc,$(1)), \ +$(subst icc,icpc,$(1)), \ +$(if $(findstring llvm-gcc,$(1)), \ + $(subst llvm-gcc,llvm-g++,$(1)), \ + $(if $(findstring gcc,$(1)), \ + $(subst gcc,g++,$(1)), \ + $(subst cc,c++,$(1) cxx_compiler = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_compiler_notdir,$(notdir $(1,$(call cxx_compiler_notdir,$(1))) +ifeq ($(findstring clang, $(cxx_compiler)), clang) +CXXFLAGS += --driver-mode=g++ +endif + # Function that returns the C++ linker, given $(CC) as arg. -cxx_linker_notdir = $(if $(findstring clang,$(1)), \ - $(subst clang,clang++,$(1)), \ - $(if $(findstring icc,$(1)), \ - $(subst icc,icpc,$(1)), \ - $(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ -$(subst gcc,g++,$(1)), \ -$(subst cc,c++,$(1)) +cxx_linker_notdir = $(if $(findstring icc,$(1)), \ + $(subst icc,icpc,$(1)), \ + $(if $(findstring llvm-gcc,$(1)), \ + $(subst llvm-gcc,llvm-g++,$(1)), \ + $(if $(findstring gcc,$(1)), \ +$(subst gcc,g++,$(1)), \ +$(subst cc,c++,$(1) cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1,$(call cxx_linker_notdir,$(1))) ifneq "$(OS)" "Darwin" @@ -354,6 +354,7 @@ ifneq "$(strip $(DYLIB_CXX_SOURCES))" "" DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) +LDFLAGS += --driver-mode=g++ endif #-- @@ -377,6 +378,7 @@ endif ifneq "$(strip $(CXX_SOURCES))" "" OBJECTS +=$(strip $(CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) + LDFLAGS += --driver-mode=g++ LD = $(call cxx_linker,$(CC)) endif @@ -395,6 +397,7 @@ ifneq "$(strip $(OBJCXX_SOURCES))" "" OBJECTS +=$(strip $(OBJCXX_SOURCES:.mm=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) + LDFLAGS += --driver-mode=g++ ifeq "$(findstring lobjc,$(LDFLAGS))" "" LDFLAGS +=-lobjc endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284551 - [CMake] Don't include LLDB_TEST_COMPILER in cached variable
Author: cbieneman Date: Tue Oct 18 18:54:28 2016 New Revision: 284551 URL: http://llvm.org/viewvc/llvm-project?rev=284551&view=rev Log: [CMake] Don't include LLDB_TEST_COMPILER in cached variable Summary: CMake has no builtin mechanism for cache invalidation. As a general convention you want to not expand user-specified variables in other cached variables because they will not get updated when the user changes their specified value. This patch moves the "-C" option for dotest.py into the LLDB_TEST_COMMON_ARGS and out of the CMake cache. In order to prevent issues with out-of-date cache files on builders I've added code to scrub "-C ${LLDB_TEST_COMPILER}" out of the CMake caches, by Force writing the variable. This code can be removed in a few days once the change has trickled through CI systems. Reviewers: tfiala, labath, zturner Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D25751 Modified: lldb/trunk/test/CMakeLists.txt Modified: lldb/trunk/test/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=284551&r1=284550&r2=284551&view=diff == --- lldb/trunk/test/CMakeLists.txt (original) +++ lldb/trunk/test/CMakeLists.txt Tue Oct 18 18:54:28 2016 @@ -43,10 +43,15 @@ set(LLDB_TEST_ARCH ${LLDB_DEFAULT_TEST_ARCH} CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") +# Scrub LLDB_TEST_COMPILER out of the CMake caches +# TODO: remove the replace lines and the FORCE parameter in a few days once the +# change has made its way through bots to clean up their CMake caches. +string(REPLACE "-C;${LLDB_TEST_COMPILER}" "" LLDB_TEST_USER_ARGS_New "${LLDB_TEST_USER_ARGS}") + # Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script set(LLDB_TEST_USER_ARGS - -C ${LLDB_TEST_COMPILER} - CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") + "${LLDB_TEST_USER_ARGS_New}" + CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'" FORCE) set(LLDB_TEST_COMMON_ARGS --arch=${LLDB_TEST_ARCH} @@ -56,6 +61,7 @@ set(LLDB_TEST_COMMON_ARGS -S nm -u CXXFLAGS -u CFLAGS + -C ${LLDB_TEST_COMPILER} ) if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284552 - When invoking Terminal, don't assume the default shell
Author: cbieneman Date: Tue Oct 18 18:55:34 2016 New Revision: 284552 URL: http://llvm.org/viewvc/llvm-project?rev=284552&view=rev Log: When invoking Terminal, don't assume the default shell Summary: If a user has their shell set to a non-POSIX conferment shell the TestTerminal.py tests fail because the shell blurb constructed here may not work in their shell. In my specific case fish-shell (The Friendly Interactive Shell - http://fishshell.com) does not support $?, it instead uses $status (because it is friendly). This patch removes the assumption of your default shell by running the constructed bash command via "/bin/bash -c ...". This should be safer for users mutating their shell environment. Reviewers: tfiala Subscribers: joerg, lldb-commits Differential Revision: https://reviews.llvm.org/D25750 Modified: lldb/trunk/source/Host/macosx/Host.mm Modified: lldb/trunk/source/Host/macosx/Host.mm URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=284552&r1=284551&r2=284552&view=diff == --- lldb/trunk/source/Host/macosx/Host.mm (original) +++ lldb/trunk/source/Host/macosx/Host.mm Tue Oct 18 18:55:34 2016 @@ -354,11 +354,11 @@ static bool WaitForProcessToSIGSTOP(cons const char *applscript_in_new_tty = "tell application \"Terminal\"\n" " activate\n" -" do script \"%s\"\n" +" do script \"/bin/bash -c '%s';exit\"\n" "end tell\n"; const char *applscript_in_existing_tty = "\ -set the_shell_script to \"%s\"\n\ +set the_shell_script to \"/bin/bash -c '%s';exit\"\n\ tell application \"Terminal\"\n\ repeat with the_window in (get windows)\n\ repeat with the_tab in tabs of the_window\n\ ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25750: When invoking Terminal, don't assume the default shell
beanz added a comment. @joerg, it is OS X exclusive, and bash is the system default shell, so I think that makes sense. Repository: rL LLVM https://reviews.llvm.org/D25750 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284555 - Fixing the linux bots I broke in r284550
Author: cbieneman Date: Tue Oct 18 19:13:56 2016 New Revision: 284555 URL: http://llvm.org/viewvc/llvm-project?rev=284555&view=rev Log: Fixing the linux bots I broke in r284550 Need to gate cxx linker adding driver-mode flag based on the linker being clang. Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=284555&r1=284554&r2=284555&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original) +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Oct 18 19:13:56 2016 @@ -354,7 +354,9 @@ ifneq "$(strip $(DYLIB_CXX_SOURCES))" "" DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) -LDFLAGS += --driver-mode=g++ +ifeq ($(findstring clang, $(cxx_linker)), clang) + LDFLAGS += --driver-mode=g++ +endif endif #-- @@ -378,7 +380,9 @@ endif ifneq "$(strip $(CXX_SOURCES))" "" OBJECTS +=$(strip $(CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) - LDFLAGS += --driver-mode=g++ + ifeq ($(findstring clang, $(cxx_linker)), clang) +LDFLAGS += --driver-mode=g++ + endif LD = $(call cxx_linker,$(CC)) endif @@ -397,7 +401,9 @@ ifneq "$(strip $(OBJCXX_SOURCES))" "" OBJECTS +=$(strip $(OBJCXX_SOURCES:.mm=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) - LDFLAGS += --driver-mode=g++ + ifeq ($(findstring clang, $(cxx_linker)), clang) +LDFLAGS += --driver-mode=g++ + endif ifeq "$(findstring lobjc,$(LDFLAGS))" "" LDFLAGS +=-lobjc endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284564 - Trying to fix a few more missing LDFLAGS.
Author: cbieneman Date: Tue Oct 18 21:31:31 2016 New Revision: 284564 URL: http://llvm.org/viewvc/llvm-project?rev=284564&view=rev Log: Trying to fix a few more missing LDFLAGS. Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=284564&r1=284563&r2=284564&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original) +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Oct 18 21:31:31 2016 @@ -423,6 +423,9 @@ ifneq "$(strip $(ARCHIVE_CXX_SOURCES))" ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) + ifeq ($(findstring clang, $(cxx_linker)), clang) +LDFLAGS += --driver-mode=g++ + endif endif #-- @@ -440,6 +443,9 @@ ifneq "$(strip $(ARCHIVE_OBJCXX_SOURCES) ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_OBJCXX_SOURCES:.mm=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) + ifeq ($(findstring clang, $(cxx_linker)), clang) +LDFLAGS += --driver-mode=g++ + endif ifeq "$(findstring lobjc,$(LDFLAGS))" "" LDFLAGS +=-lobjc endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284565 - Revert back to the state before r284550
Author: cbieneman Date: Tue Oct 18 21:44:20 2016 New Revision: 284565 URL: http://llvm.org/viewvc/llvm-project?rev=284565&view=rev Log: Revert back to the state before r284550 This patch is causing a lot of issues on bots that I didn't see in local testing. I'm going to have to work on this. Reverting for now while I sort it out. Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=284565&r1=284564&r2=284565&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original) +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Oct 18 21:44:20 2016 @@ -242,27 +242,27 @@ ifneq "$(DYLIB_NAME)" "" endif # Function that returns the counterpart C++ compiler, given $(CC) as arg. -cxx_compiler_notdir = $(if $(findstring icc,$(1)), \ -$(subst icc,icpc,$(1)), \ -$(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ - $(subst gcc,g++,$(1)), \ - $(subst cc,c++,$(1) +cxx_compiler_notdir = $(if $(findstring clang,$(1)), \ + $(subst clang,clang++,$(1)), \ + $(if $(findstring icc,$(1)), \ +$(subst icc,icpc,$(1)), \ +$(if $(findstring llvm-gcc,$(1)), \ + $(subst llvm-gcc,llvm-g++,$(1)), \ + $(if $(findstring gcc,$(1)), \ + $(subst gcc,g++,$(1)), \ + $(subst cc,c++,$(1)) cxx_compiler = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_compiler_notdir,$(notdir $(1,$(call cxx_compiler_notdir,$(1))) -ifeq ($(findstring clang, $(cxx_compiler)), clang) -CXXFLAGS += --driver-mode=g++ -endif - # Function that returns the C++ linker, given $(CC) as arg. -cxx_linker_notdir = $(if $(findstring icc,$(1)), \ - $(subst icc,icpc,$(1)), \ - $(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ -$(subst gcc,g++,$(1)), \ -$(subst cc,c++,$(1) +cxx_linker_notdir = $(if $(findstring clang,$(1)), \ + $(subst clang,clang++,$(1)), \ + $(if $(findstring icc,$(1)), \ + $(subst icc,icpc,$(1)), \ + $(if $(findstring llvm-gcc,$(1)), \ + $(subst llvm-gcc,llvm-g++,$(1)), \ + $(if $(findstring gcc,$(1)), \ +$(subst gcc,g++,$(1)), \ +$(subst cc,c++,$(1)) cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1,$(call cxx_linker_notdir,$(1))) ifneq "$(OS)" "Darwin" @@ -354,9 +354,6 @@ ifneq "$(strip $(DYLIB_CXX_SOURCES))" "" DYLIB_OBJECTS +=$(strip $(DYLIB_CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) -ifeq ($(findstring clang, $(cxx_linker)), clang) - LDFLAGS += --driver-mode=g++ -endif endif #-- @@ -380,9 +377,6 @@ endif ifneq "$(strip $(CXX_SOURCES))" "" OBJECTS +=$(strip $(CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) - ifeq ($(findstring clang, $(cxx_linker)), clang) -LDFLAGS += --driver-mode=g++ - endif LD = $(call cxx_linker,$(CC)) endif @@ -401,9 +395,6 @@ ifneq "$(strip $(OBJCXX_SOURCES))" "" OBJECTS +=$(strip $(OBJCXX_SOURCES:.mm=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) - ifeq ($(findstring clang, $(cxx_linker)), clang) -LDFLAGS += --driver-mode=g++ - endif ifeq "$(findstring lobjc,$(LDFLAGS))" "" LDFLAGS +=-lobjc endif @@ -423,9 +414,6 @@ ifneq "$(strip $(ARCHIVE_CXX_SOURCES))" ARCHIVE_OBJECTS +=$(strip $(ARCHIVE_CXX_SOURCES:.cpp=.o)) CXX = $(call cxx_compiler,$(CC)) LD = $(call cxx_linker,$(CC)) - ifeq ($(findstring clang, $(cxx_linker)), clang) -LDFLAGS += --driver-mode=g++ - endif endif #-- @@ -443,9 +431,6 @@ ifneq "$(strip $(ARCHIVE_OBJCXX_SOURCES) ARCHIVE_OBJECTS +=$(strip $(
[Lldb-commits] [PATCH] D25830: Search for llvm-config in LLDB_PATH_TO_LLVM_BUILD first
beanz requested changes to this revision. beanz added a comment. This revision now requires changes to proceed. `LLDB_PATH_TO_LLVM_BUILD` is a swift-ism that doesn't match LLVM's CMake conventions. In LLVM we don't pass in the path to build directories, instead we pass in `LLVM_CONFIG` to standalone builds, and we derive the build directory from the output of `llvm-config`. Passing in `LLVM_CONFIG` is more flexible, robust, and consistent with how other LLVM subprojects work, and I see no reason to change that convention. Repository: rL LLVM https://reviews.llvm.org/D25830 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284756 - Re-landing a cleaned up implementation of r284550
Author: cbieneman Date: Thu Oct 20 13:01:19 2016 New Revision: 284756 URL: http://llvm.org/viewvc/llvm-project?rev=284756&view=rev Log: Re-landing a cleaned up implementation of r284550 This time it should actually work. The previous implementaiton was not getting the linker or compiler flag set correctly in all the right situations. By moving the check down and basing it of whether or not CXX is set I we can have the logic to add the flags exist only once for the linker and once for the compiler instead of duplicating it. Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=284756&r1=284755&r2=284756&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original) +++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Thu Oct 20 13:01:19 2016 @@ -242,27 +242,23 @@ ifneq "$(DYLIB_NAME)" "" endif # Function that returns the counterpart C++ compiler, given $(CC) as arg. -cxx_compiler_notdir = $(if $(findstring clang,$(1)), \ - $(subst clang,clang++,$(1)), \ - $(if $(findstring icc,$(1)), \ -$(subst icc,icpc,$(1)), \ -$(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ - $(subst gcc,g++,$(1)), \ - $(subst cc,c++,$(1)) +cxx_compiler_notdir = $(if $(findstring icc,$(1)), \ +$(subst icc,icpc,$(1)), \ +$(if $(findstring llvm-gcc,$(1)), \ + $(subst llvm-gcc,llvm-g++,$(1)), \ + $(if $(findstring gcc,$(1)), \ + $(subst gcc,g++,$(1)), \ + $(subst cc,c++,$(1) cxx_compiler = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_compiler_notdir,$(notdir $(1,$(call cxx_compiler_notdir,$(1))) # Function that returns the C++ linker, given $(CC) as arg. -cxx_linker_notdir = $(if $(findstring clang,$(1)), \ - $(subst clang,clang++,$(1)), \ - $(if $(findstring icc,$(1)), \ - $(subst icc,icpc,$(1)), \ - $(if $(findstring llvm-gcc,$(1)), \ - $(subst llvm-gcc,llvm-g++,$(1)), \ - $(if $(findstring gcc,$(1)), \ -$(subst gcc,g++,$(1)), \ -$(subst cc,c++,$(1)) +cxx_linker_notdir = $(if $(findstring icc,$(1)), \ + $(subst icc,icpc,$(1)), \ + $(if $(findstring llvm-gcc,$(1)), \ + $(subst llvm-gcc,llvm-g++,$(1)), \ + $(if $(findstring gcc,$(1)), \ +$(subst gcc,g++,$(1)), \ +$(subst cc,c++,$(1) cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1,$(call cxx_linker_notdir,$(1))) ifneq "$(OS)" "Darwin" @@ -450,6 +446,16 @@ ifneq "$(filter g++,$(CXX))" "" endif endif +ifeq ($(findstring clang, $(CXX)), clang) + CXXFLAGS += --driver-mode=g++ +endif + +ifneq "$(CXX)" "" + ifeq ($(findstring clang, $(LD)), clang) +LDFLAGS += --driver-mode=g++ + endif +endif + #-- # DYLIB_ONLY variable can be used to skip the building of a.out. # See the sections below regarding dSYM file as well as the building of ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284854 - [CMake] Fix standalone build
Author: cbieneman Date: Fri Oct 21 13:38:44 2016 New Revision: 284854 URL: http://llvm.org/viewvc/llvm-project?rev=284854&view=rev Log: [CMake] Fix standalone build not and FileCheck targets may not be defined in standalone builds. Modified: lldb/trunk/lit/CMakeLists.txt Modified: lldb/trunk/lit/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=284854&r1=284853&r2=284854&view=diff == --- lldb/trunk/lit/CMakeLists.txt (original) +++ lldb/trunk/lit/CMakeLists.txt Fri Oct 21 13:38:44 2016 @@ -24,11 +24,13 @@ configure_lit_site_cfg( ) set(LLDB_TEST_DEPS - FileCheck LLDBUnitTests lldb - not ) + +if(NOT LLDB_BUILT_STANDALONE) + list(APPEND LLDB_TEST_DEPS FileCheck not) +endif() # lldb-server is not built on every platform. if (TARGET lldb-server) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r284893 - [Test Suite] Allow overriding codesign identity
Author: cbieneman Date: Fri Oct 21 17:13:55 2016 New Revision: 284893 URL: http://llvm.org/viewvc/llvm-project?rev=284893&view=rev Log: [Test Suite] Allow overriding codesign identity Summary: Not everyone names their code sign identity "lldb_codesign", so it is nice to allow this to be overridden. Reviewers: zturner, tfiala Subscribers: labath, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D25714 Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py lldb/trunk/test/CMakeLists.txt Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=284893&r1=284892&r2=284893&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Fri Oct 21 17:13:55 2016 @@ -481,6 +481,8 @@ def parseOptionsAndInitTestdirs(): # Shut off multiprocessing mode when test directories are specified. configuration.no_multiprocess_test_runner = True +lldbtest_config.codesign_identity = args.codesign_identity + #print("testdirs:", testdirs) Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=284893&r1=284892&r2=284893&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Fri Oct 21 17:13:55 2016 @@ -151,6 +151,11 @@ def create_parser(): dest='log_success', action='store_true', help="Leave logs/traces even for successful test runs (useful for creating reference log files during debugging.)") +group.add_argument( +'--codesign-identity', +metavar='Codesigning identity', +default='lldb_codesign', +help='The codesigning identity to use') # Configuration options group = parser.add_argument_group('Remote platform options') Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=284893&r1=284892&r2=284893&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Fri Oct 21 17:13:55 2016 @@ -1543,8 +1543,8 @@ class Base(unittest2.TestCase): def signBinary(self, binary_path): if sys.platform.startswith("darwin"): -codesign_cmd = "codesign --force --sign lldb_codesign %s" % ( -binary_path) +codesign_cmd = "codesign --force --sign \"%s\" %s" % ( +lldbtest_config.codesign_identity, binary_path) call(codesign_cmd, shell=True) def findBuiltClang(self): Modified: lldb/trunk/test/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=284893&r1=284892&r2=284893&view=diff == --- lldb/trunk/test/CMakeLists.txt (original) +++ lldb/trunk/test/CMakeLists.txt Fri Oct 21 17:13:55 2016 @@ -85,6 +85,10 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Windows" endif() endif() +if(LLDB_CODESIGN_IDENTITY) + list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${LLDB_CODESIGN_IDENTITY}") +endif() + add_python_test_target(check-lldb-single ${LLDB_SOURCE_DIR}/test/dotest.py "--no-multiprocess;${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D25886: [Test Suite] Properly respect --framework option
beanz created this revision. beanz added a reviewer: tfiala. beanz added a subscriber: lldb-commits. Herald added a subscriber: mgorny. dotest.py has a framework option that is not respected. This patch makes the framework path properly configurable via the --framework option. This patch also adds a function to the lldbtest.Base class named "hasDarwinFramework" which allows us to not rely on the host platform to determine if a framework is present. If running on Darwin, and not building a framework, this will follow the *nix code paths which are appropriate for Darwin. https://reviews.llvm.org/D25886 Files: packages/Python/lldbsuite/test/dotest.py packages/Python/lldbsuite/test/lldbtest.py test/CMakeLists.txt Index: test/CMakeLists.txt === --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -89,6 +89,10 @@ list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${LLDB_CODESIGN_IDENTITY}") endif() +if(LLDB_BUILD_FRAMEWORK) + list(APPEND LLDB_TEST_COMMON_ARGS --framework $) +endif() + add_python_test_target(check-lldb-single ${LLDB_SOURCE_DIR}/test/dotest.py "--no-multiprocess;${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}" Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -829,6 +829,29 @@ # Initialize debug_info self.debug_info = None +lib_dir = os.environ["LLDB_LIB_DIR"] +self.dsym = None +self.framework_dir = None +self.darwinWithFramework = self.platformIsDarwin() +if sys.platform.startswith("darwin"): +# Handle the framework environment variable if it is set +if hasattr(lldbtest_config, 'lldbFrameworkPath'): +framework_path = lldbtest_config.lldbFrameworkPath +# Framework dir should be the directory containing the framework +self.framework_dir = framework_path[:framework_path.rfind('LLDB.framework')] +# If a framework dir was not specified assume the Xcode build +# directory layout where the framework is in LLDB_LIB_DIR. +else: +self.framework_dir = lib_dir +self.dsym = os.path.join(self.framework_dir, 'LLDB.framework', 'LLDB') +# If the framework binary doesn't exist, assume we didn't actually +# build a framework, and fallback to standard *nix behavior by +# setting framework_dir and dsym to None. +if not os.path.exists(self.dsym): +self.framework_dir = None +self.dsym = None +self.darwinWithFramework = False + def setAsync(self, value): """ Sets async mode to True/False and ensures it is reset after the testcase completes.""" old_async = self.dbg.GetAsync() @@ -1276,6 +1299,9 @@ """Returns true if the OS triple for the selected platform is any valid apple OS""" return lldbplatformutil.platformIsDarwin() +def hasDarwinFramework(self): +return self.darwinWithFramework + def getPlatform(self): """Returns the target platform the test suite is running on.""" return lldbplatformutil.getPlatform() @@ -1373,24 +1399,23 @@ stdlibflag = self.getstdlibFlag() lib_dir = os.environ["LLDB_LIB_DIR"] -if sys.platform.startswith("darwin"): -dsym = os.path.join(lib_dir, 'LLDB.framework', 'LLDB') +if self.hasDarwinFramework(): d = {'CXX_SOURCES': sources, 'EXE': exe_name, 'CFLAGS_EXTRAS': "%s %s" % (stdflag, stdlibflag), - 'FRAMEWORK_INCLUDES': "-F%s" % lib_dir, - 'LD_EXTRAS': "%s -Wl,-rpath,%s" % (dsym, lib_dir), + 'FRAMEWORK_INCLUDES': "-F%s" % self.framework_dir, + 'LD_EXTRAS': "%s -Wl,-rpath,%s" % (self.dsym, self.framework_dir), } -elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 'netbsd') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile': +elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 'netbsd', 'darwin') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile': d = { 'CXX_SOURCES': sources, 'EXE': exe_name, 'CFLAGS_EXTRAS': "%s %s -I%s" % (stdflag, stdlibflag, os.path.join( os.environ["LLDB_SRC"], "include")), -'LD_EXTRAS': "-L%s -llldb" % lib_dir} +'LD_EXTRAS': "-L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)} elif sys.platform.startswith('win'):
[Lldb-commits] [PATCH] D25887: [Test Suite] Pull generateSource into lldbtest
beanz created this revision. beanz added reviewers: tfiala, zturner. beanz added a subscriber: lldb-commits. Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework. This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py. https://reviews.llvm.org/D25887 Files: packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py packages/Python/lldbsuite/test/api/multithreaded/driver.cpp packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template packages/Python/lldbsuite/test/api/multithreaded/lldb-headers.h packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template packages/Python/lldbsuite/test/lldbtest.py Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1824,6 +1824,33 @@ folder = os.path.dirname(folder) continue +def generateSource(self, source): +template = source + '.template' +temp = os.path.join(os.getcwd(), template) +with open(temp, 'r') as f: +content = f.read() + +public_api_dir = os.path.join( +os.environ["LLDB_SRC"], "include", "lldb", "API") + +# Look under the include/lldb/API directory and add #include statements +# for all the SB API headers. +public_headers = os.listdir(public_api_dir) +# For different platforms, the include statement can vary. +if self.hasDarwinFramework(): +include_stmt = "'#include <%s>' % os.path.join('LLDB', header)" +else: +include_stmt = "'#include <%s>' % os.path.join(public_api_dir, header)" +list = [eval(include_stmt) for header in public_headers if ( +header.startswith("SB") and header.endswith(".h"))] +includes = '\n'.join(list) +new_content = content.replace('%include_SB_APIs%', includes) +src = os.path.join(os.getcwd(), source) +with open(src, 'w') as f: +f.write(new_content) + +self.addTearDownHook(lambda: os.remove(src)) + def setUp(self): #import traceback # traceback.print_stack() Index: packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template === --- packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template +++ packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template @@ -13,15 +13,7 @@ by typing plugin load foo.dylib at the LLDB command line */ -#if defined (__APPLE__) -#include -#include -#include -#else -#include -#include -#include -#endif +%include_SB_APIs% namespace lldb { bool Index: packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py === --- packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py +++ packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py @@ -18,6 +18,10 @@ mydir = TestBase.compute_mydir(__file__) +def setUp(self): +TestBase.setUp(self) +self.generateSource('plugin.cpp') + @skipIfNoSBHeaders # Requires a compatible arch and platform to link against the host's built # lldb lib. Index: packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template === --- packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template +++ packages/Python/lldbsuite/test/api/multithreaded/test_li
[Lldb-commits] [PATCH] D25745: [CMake] Rename lldb-launcher to darwin-debug
beanz updated this revision to Diff 75507. beanz added a comment. Cleaning up extra references to lldb-launcher https://reviews.llvm.org/D25745 Files: scripts/Python/finish-swig-Python-LLDB.sh scripts/Python/finishSwigPythonLLDB.py tools/darwin-debug/CMakeLists.txt Index: tools/darwin-debug/CMakeLists.txt === --- tools/darwin-debug/CMakeLists.txt +++ tools/darwin-debug/CMakeLists.txt @@ -1,6 +1,6 @@ -add_lldb_executable(lldb-launcher INCLUDE_IN_FRAMEWORK +add_lldb_executable(darwin-debug INCLUDE_IN_FRAMEWORK darwin-debug.cpp ) -install(TARGETS lldb-launcher +install(TARGETS darwin-debug RUNTIME DESTINATION bin) Index: scripts/Python/finishSwigPythonLLDB.py === --- scripts/Python/finishSwigPythonLLDB.py +++ scripts/Python/finishSwigPythonLLDB.py @@ -452,39 +452,6 @@ return (bOk, strErrMsg) #++--- -# Details: Make the symbolic link to the darwin-debug. -# Args: vDictArgs - (R) Program input parameters. -# vstrFrameworkPythonDir - (R) Python framework directory. -# vstrDarwinDebugFileName - (R) File name for darwin-debug. -# Returns: Bool - True = function success, False = failure. -# Str - Error description on task failure. -# Throws: None. -#-- - - -def make_symlink_darwin_debug( -vDictArgs, -vstrFrameworkPythonDir, -vstrDarwinDebugFileName): -dbg = utilsDebug.CDebugFnVerbose( -"Python script make_symlink_darwin_debug()") -bOk = True -strErrMsg = "" -strTarget = vstrDarwinDebugFileName -strSrc = "" - -bMakeFileCalled = "-m" in vDictArgs -if not bMakeFileCalled: -return (bOk, strErrMsg) -else: -strSrc = os.path.join("bin", "lldb-launcher") - -bOk, strErrMsg = make_symlink( -vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget) - -return (bOk, strErrMsg) - -#++--- # Details: Make the symbolic link to the lldb-argdumper. # Args: vDictArgs - (R) Program input parameters. # vstrFrameworkPythonDir - (R) Python framework directory. @@ -550,13 +517,6 @@ strLibLldbFileName, vstrLldbLibDir) -# Make symlink for darwin-debug on Darwin -strDarwinDebugFileName = "darwin-debug" -if bOk and eOSType == utilsOsType.EnumOsType.Darwin: -bOk, strErrMsg = make_symlink_darwin_debug(vDictArgs, - vstrFrameworkPythonDir, - strDarwinDebugFileName) - # Make symlink for lldb-argdumper strArgdumperFileName = "lldb-argdumper" if bOk: Index: scripts/Python/finish-swig-Python-LLDB.sh === --- scripts/Python/finish-swig-Python-LLDB.sh +++ scripts/Python/finish-swig-Python-LLDB.sh @@ -179,7 +179,6 @@ echo "Creating symlink for darwin-debug" fi cd "${framework_python_dir}" -ln -s "../../../../bin/lldb-launcher" darwin-debug else if [ $Debug -eq 1 ] then Index: tools/darwin-debug/CMakeLists.txt === --- tools/darwin-debug/CMakeLists.txt +++ tools/darwin-debug/CMakeLists.txt @@ -1,6 +1,6 @@ -add_lldb_executable(lldb-launcher INCLUDE_IN_FRAMEWORK +add_lldb_executable(darwin-debug INCLUDE_IN_FRAMEWORK darwin-debug.cpp ) -install(TARGETS lldb-launcher +install(TARGETS darwin-debug RUNTIME DESTINATION bin) Index: scripts/Python/finishSwigPythonLLDB.py === --- scripts/Python/finishSwigPythonLLDB.py +++ scripts/Python/finishSwigPythonLLDB.py @@ -452,39 +452,6 @@ return (bOk, strErrMsg) #++--- -# Details: Make the symbolic link to the darwin-debug. -# Args: vDictArgs - (R) Program input parameters. -# vstrFrameworkPythonDir - (R) Python framework directory. -# vstrDarwinDebugFileName - (R) File name for darwin-debug. -# Returns: Bool - True = function success, False = failure. -# Str - Error description on task failure. -# Throws: None. -#-- - - -def make_symlink_darwin_debug( -vDictArgs, -vstrFrameworkPythonDir, -vstrDarwinDebugFileName): -dbg = utilsDebug.CDebugFnVerbose( -"Python script make_symlink_darwin_debug()") -bOk = True -strErrMsg = "" -strTarget = vstrDarwinDebugFileName -strSrc = "" - -bMakeFileCalled = "-m" in vDictArgs -if not bMakeFileCalled: -return (bOk, strErrMsg) -else
[Lldb-commits] [lldb] r285356 - [CMake] Rename lldb-launcher to darwin-debug
Author: cbieneman Date: Thu Oct 27 17:51:41 2016 New Revision: 285356 URL: http://llvm.org/viewvc/llvm-project?rev=285356&view=rev Log: [CMake] Rename lldb-launcher to darwin-debug Summary: This tool is only built on Darwin, and the name darwin-debug matches the Xcode project. We should have this in sync unless there is a good reason not to. Reviewers: zturner, tfiala, labath Subscribers: labath, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D25745 Modified: lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh lldb/trunk/scripts/Python/finishSwigPythonLLDB.py lldb/trunk/tools/darwin-debug/CMakeLists.txt Modified: lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh?rev=285356&r1=285355&r2=285356&view=diff == --- lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh (original) +++ lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh Thu Oct 27 17:51:41 2016 @@ -179,7 +179,6 @@ then echo "Creating symlink for darwin-debug" fi cd "${framework_python_dir}" -ln -s "../../../../bin/lldb-launcher" darwin-debug else if [ $Debug -eq 1 ] then Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=285356&r1=285355&r2=285356&view=diff == --- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original) +++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Thu Oct 27 17:51:41 2016 @@ -452,39 +452,6 @@ def make_symlink_liblldb( return (bOk, strErrMsg) #++--- -# Details: Make the symbolic link to the darwin-debug. -# Args: vDictArgs - (R) Program input parameters. -# vstrFrameworkPythonDir - (R) Python framework directory. -# vstrDarwinDebugFileName - (R) File name for darwin-debug. -# Returns: Bool - True = function success, False = failure. -# Str - Error description on task failure. -# Throws: None. -#-- - - -def make_symlink_darwin_debug( -vDictArgs, -vstrFrameworkPythonDir, -vstrDarwinDebugFileName): -dbg = utilsDebug.CDebugFnVerbose( -"Python script make_symlink_darwin_debug()") -bOk = True -strErrMsg = "" -strTarget = vstrDarwinDebugFileName -strSrc = "" - -bMakeFileCalled = "-m" in vDictArgs -if not bMakeFileCalled: -return (bOk, strErrMsg) -else: -strSrc = os.path.join("bin", "lldb-launcher") - -bOk, strErrMsg = make_symlink( -vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget) - -return (bOk, strErrMsg) - -#++--- # Details: Make the symbolic link to the lldb-argdumper. # Args: vDictArgs - (R) Program input parameters. # vstrFrameworkPythonDir - (R) Python framework directory. @@ -550,13 +517,6 @@ def create_symlinks(vDictArgs, vstrFrame strLibLldbFileName, vstrLldbLibDir) -# Make symlink for darwin-debug on Darwin -strDarwinDebugFileName = "darwin-debug" -if bOk and eOSType == utilsOsType.EnumOsType.Darwin: -bOk, strErrMsg = make_symlink_darwin_debug(vDictArgs, - vstrFrameworkPythonDir, - strDarwinDebugFileName) - # Make symlink for lldb-argdumper strArgdumperFileName = "lldb-argdumper" if bOk: Modified: lldb/trunk/tools/darwin-debug/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/darwin-debug/CMakeLists.txt?rev=285356&r1=285355&r2=285356&view=diff == --- lldb/trunk/tools/darwin-debug/CMakeLists.txt (original) +++ lldb/trunk/tools/darwin-debug/CMakeLists.txt Thu Oct 27 17:51:41 2016 @@ -1,6 +1,6 @@ -add_lldb_executable(lldb-launcher INCLUDE_IN_FRAMEWORK +add_lldb_executable(darwin-debug INCLUDE_IN_FRAMEWORK darwin-debug.cpp ) -install(TARGETS lldb-launcher +install(TARGETS darwin-debug RUNTIME DESTINATION bin) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r285357 - [Test Suite] Pull generateSource into lldbtest
Author: cbieneman Date: Thu Oct 27 17:52:32 2016 New Revision: 285357 URL: http://llvm.org/viewvc/llvm-project?rev=285357&view=rev Log: [Test Suite] Pull generateSource into lldbtest Summary: Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework. This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py. Reviewers: tfiala, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25887 Added: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template - copied, changed from r285356, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template - copied, changed from r285356, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template - copied, changed from r285356, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template - copied, changed from r285356, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template - copied, changed from r285356, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template - copied, changed from r285356, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template - copied, changed from r285356, lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp Removed: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/lldb-headers.h lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Modified: lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=285357&r1=285356&r2=285357&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py Thu Oct 27 17:52:32 2016 @@ -19,9 +19,9 @@ class SBDirCheckerCase(TestBase): def setUp(self): TestBase.setUp(self) -self.template = 'main.cpp.template' self.source = 'main.cpp' self.exe_name = 'a.out' +self.generateSource(self.source) @skipIfNoSBHeaders def test_sb_api_directory(self): @@ -34,40 +34,9 @@ class SBDirCheckerCase(TestBase): self.skipTest( "LLDB is 64-bit and cannot be linked to 32-bit test program.") -# Generate main.cpp, build it, and execute. -self.generate_main_cpp() self.buildDriver(self.source, self.exe_name) self.sanity_check_executable(self.exe_name) -def generate_main_cpp(self): -"""Generate main.cpp from main.cpp.template.""" -temp = os.path.join(os.getcwd(), self.template) -with open(temp, 'r') as f: -content = f.read() - -public_api_dir = os.path.join( -os.environ["LLDB_SRC"], "include", "lldb", "API") - -# Look under the include/lldb/API directory and add #include statements -# for all the SB API headers. -public_headers = os.listdir(public_api_dir) -
[Lldb-commits] [lldb] r285361 - Revert "[Test Suite] Pull generateSource into lldbtest"
Author: cbieneman Date: Thu Oct 27 18:18:52 2016 New Revision: 285361 URL: http://llvm.org/viewvc/llvm-project?rev=285361&view=rev Log: Revert "[Test Suite] Pull generateSource into lldbtest" This reverts commit r285357. I committed this patch accidentally out of order. Will recommit when the change this depends on is landed. Added: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp - copied, changed from r285357, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp - copied, changed from r285357, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/lldb-headers.h lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp - copied, changed from r285357, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp - copied, changed from r285357, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp - copied, changed from r285357, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp - copied, changed from r285357, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp - copied, changed from r285357, lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template Removed: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template Modified: lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Modified: lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=285361&r1=285360&r2=285361&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py Thu Oct 27 18:18:52 2016 @@ -19,9 +19,9 @@ class SBDirCheckerCase(TestBase): def setUp(self): TestBase.setUp(self) +self.template = 'main.cpp.template' self.source = 'main.cpp' self.exe_name = 'a.out' -self.generateSource(self.source) @skipIfNoSBHeaders def test_sb_api_directory(self): @@ -34,9 +34,40 @@ class SBDirCheckerCase(TestBase): self.skipTest( "LLDB is 64-bit and cannot be linked to 32-bit test program.") +# Generate main.cpp, build it, and execute. +self.generate_main_cpp() self.buildDriver(self.source, self.exe_name) self.sanity_check_executable(self.exe_name) +def generate_main_cpp(self): +"""Generate main.cpp from main.cpp.template.""" +temp = os.path.join(os.getcwd(), self.template) +with open(temp, 'r') as f: +content = f.read() + +public_api_dir = os.path.join( +os.environ["LLDB_SRC"], "include", "lldb", "API") + +# Look under the include/lldb/API directory and add #include statements +# for all the SB API headers. +public_headers = os.listdir(public_api_dir) +# For different platforms, the include statement can vary. +if self.platformIsDarwin(): +include_stmt = "'#include <%s>' % os.pa
[Lldb-commits] [PATCH] D26093: Limit LLDB_EXPORT_ALL_SYMBOLS to additionally export only the lldb_private namespace symbols
beanz added a comment. This patch ends up hiding the problem, not fixing it. If it unblocks something it might be ok, but it doesn't actually fix the problem. The underlying problem is that liblldb and lldb-mi have their own copies of LLVM with their own copies of the GlobalParser static (llvm/lib/Support/CommandLine.cpp), and the corresponding static for the debug cl::opt (llvm/lib/Support/Debug.cpp). When the library exports the LLVM symbols, the dynamic loader loads lldb-mi and it makes the cl::opt constructor point at the same instance of the GlobalParser (following link-once ODR rules). When the library doesn't export the LLVM symbols, the cl::opt variables inside liblldb resolve to the GlobalParser inside liblldb (because it is local), and the cl::opt variables inside lldb-mi resolve inside lldb-mi because the loader cannot see the GlobalParser from liblldb because the symbol isn't exported. This makes two instances of the GlobalParser exist at the same time. This does work around the problem Todd was seeing. Unfortunately, it doesn't actually fix the problem, and if lldb-mi is using cl::opt across the library boundary it will cause subtle and difficult to diagnose bugs. https://reviews.llvm.org/D26093 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D26093: Limit LLDB_EXPORT_ALL_SYMBOLS to additionally export only the lldb_private namespace symbols
beanz added a comment. In https://reviews.llvm.org/D26093#582618, @tfiala wrote: > The current usage of CommandLine via global static constructors in Debug.cpp > seems like a poor choice, as it forces all users of llvm with NDEBUG not > defined to get some command line behavior that they may never use. Maybe > some aspect of that can be made lazy? It can't be made lazy without completely re-designing how cl::opt works. Which is something I've had lengthy discussions with Chandler about. Currently the biggest issue with fixing it relates to how the new pass manager works. Specifically in order to provide meaningful -help output we need a way to register command line options in passes, which we have today, but won't with the new pass manager. It is an open problem that we're trying to come up with a solution to. > Unless there is strong opposition, I'd like to put this in. No objection from me. https://reviews.llvm.org/D26093 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r285542 - [Test Suite] Pull generateSource into lldbtest
Author: cbieneman Date: Sun Oct 30 23:48:19 2016 New Revision: 285542 URL: http://llvm.org/viewvc/llvm-project?rev=285542&view=rev Log: [Test Suite] Pull generateSource into lldbtest Summary: Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework. This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py. Reviewers: tfiala, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25887 Added: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template - copied, changed from r285541, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template - copied, changed from r285541, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template - copied, changed from r285541, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template - copied, changed from r285541, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template - copied, changed from r285541, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template - copied, changed from r285541, lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template - copied, changed from r285541, lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp Removed: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/lldb-headers.h lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Modified: lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=285542&r1=285541&r2=285542&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py Sun Oct 30 23:48:19 2016 @@ -19,9 +19,9 @@ class SBDirCheckerCase(TestBase): def setUp(self): TestBase.setUp(self) -self.template = 'main.cpp.template' self.source = 'main.cpp' self.exe_name = 'a.out' +self.generateSource(self.source) @skipIfNoSBHeaders def test_sb_api_directory(self): @@ -34,40 +34,9 @@ class SBDirCheckerCase(TestBase): self.skipTest( "LLDB is 64-bit and cannot be linked to 32-bit test program.") -# Generate main.cpp, build it, and execute. -self.generate_main_cpp() self.buildDriver(self.source, self.exe_name) self.sanity_check_executable(self.exe_name) -def generate_main_cpp(self): -"""Generate main.cpp from main.cpp.template.""" -temp = os.path.join(os.getcwd(), self.template) -with open(temp, 'r') as f: -content = f.read() - -public_api_dir = os.path.join( -os.environ["LLDB_SRC"], "include", "lldb", "API") - -# Look under the include/lldb/API directory and add #include statements -# for all the SB API headers. -public_headers = os.listdir(public_api_dir) -