2014-08-16 07:50:36 +08:00
|
|
|
macro(add_host_subdirectory group)
|
|
|
|
list(APPEND HOST_SOURCES ${ARGN})
|
2014-08-19 00:47:33 +08:00
|
|
|
source_group(${group} FILES ${ARGN})
|
2014-08-16 07:50:36 +08:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
add_host_subdirectory(common
|
|
|
|
common/File.cpp
|
|
|
|
common/FileCache.cpp
|
2015-02-21 02:34:03 +08:00
|
|
|
common/FileSystem.cpp
|
2015-09-04 17:06:15 +08:00
|
|
|
common/GetOptInc.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
common/Host.cpp
|
2014-08-20 01:18:29 +08:00
|
|
|
common/HostInfoBase.cpp
|
2014-09-10 04:54:56 +08:00
|
|
|
common/HostNativeThreadBase.cpp
|
2014-09-12 06:22:16 +08:00
|
|
|
common/HostProcess.cpp
|
2014-09-10 04:54:56 +08:00
|
|
|
common/HostThread.cpp
|
2015-05-07 23:28:49 +08:00
|
|
|
common/LockFileBase.cpp
|
2017-04-27 07:17:20 +08:00
|
|
|
common/MainLoop.cpp
|
2014-10-15 05:55:08 +08:00
|
|
|
common/MonitoringProcessLauncher.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
common/NativeBreakpoint.cpp
|
|
|
|
common/NativeBreakpointList.cpp
|
2015-02-03 09:51:47 +08:00
|
|
|
common/NativeWatchpointList.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
common/NativeProcessProtocol.cpp
|
2015-02-03 09:51:38 +08:00
|
|
|
common/NativeRegisterContext.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
common/NativeThreadProtocol.cpp
|
|
|
|
common/OptionParser.cpp
|
2015-01-14 07:19:40 +08:00
|
|
|
common/PipeBase.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
common/ProcessRunLock.cpp
|
2017-02-17 03:38:21 +08:00
|
|
|
common/PseudoTerminal.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
common/Socket.cpp
|
|
|
|
common/SocketAddress.cpp
|
|
|
|
common/SoftwareBreakpoint.cpp
|
2015-01-16 04:08:35 +08:00
|
|
|
common/StringConvert.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
common/Symbols.cpp
|
2017-09-19 23:38:30 +08:00
|
|
|
common/TaskPool.cpp
|
2015-10-16 07:54:09 +08:00
|
|
|
common/TCPSocket.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
common/Terminal.cpp
|
2014-09-10 04:54:56 +08:00
|
|
|
common/ThreadLauncher.cpp
|
2015-05-27 02:00:51 +08:00
|
|
|
common/XML.cpp
|
2015-10-16 07:54:09 +08:00
|
|
|
common/UDPSocket.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
)
|
2013-09-25 18:37:32 +08:00
|
|
|
|
2015-10-13 04:12:27 +08:00
|
|
|
# Keep track of whether we want to provide a define for the
|
|
|
|
# Python's architecture-specific lib path (i.e. where a
|
|
|
|
# Python lldb module would go).
|
|
|
|
set (get_python_libdir 0)
|
|
|
|
|
2014-11-18 05:31:18 +08:00
|
|
|
if (NOT LLDB_DISABLE_LIBEDIT)
|
|
|
|
add_host_subdirectory(common
|
|
|
|
common/Editline.cpp
|
|
|
|
)
|
2014-11-08 09:41:49 +08:00
|
|
|
endif()
|
|
|
|
|
2014-10-07 05:22:36 +08:00
|
|
|
add_host_subdirectory(posix
|
|
|
|
posix/ConnectionFileDescriptorPosix.cpp
|
|
|
|
)
|
|
|
|
|
2017-02-01 04:43:05 +08:00
|
|
|
if(NOT LLDB_DISABLE_PYTHON)
|
|
|
|
list(APPEND LLDB_PLUGINS lldbPluginScriptInterpreterPython)
|
|
|
|
endif()
|
|
|
|
|
2014-08-16 06:04:21 +08:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
2014-08-16 07:50:36 +08:00
|
|
|
add_host_subdirectory(windows
|
2014-10-07 05:23:09 +08:00
|
|
|
windows/ConnectionGenericFileWindows.cpp
|
2014-09-10 04:54:56 +08:00
|
|
|
windows/EditLineWin.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
windows/FileSystem.cpp
|
|
|
|
windows/Host.cpp
|
2014-08-20 01:18:29 +08:00
|
|
|
windows/HostInfoWindows.cpp
|
2014-08-28 04:15:30 +08:00
|
|
|
windows/HostProcessWindows.cpp
|
2014-09-10 04:54:56 +08:00
|
|
|
windows/HostThreadWindows.cpp
|
2015-05-07 23:28:49 +08:00
|
|
|
windows/LockFileWindows.cpp
|
2014-10-09 04:38:41 +08:00
|
|
|
windows/PipeWindows.cpp
|
2014-10-15 05:55:08 +08:00
|
|
|
windows/ProcessLauncherWindows.cpp
|
2014-09-10 04:54:56 +08:00
|
|
|
windows/ProcessRunLock.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
windows/Windows.cpp
|
|
|
|
)
|
2014-08-16 06:04:21 +08:00
|
|
|
else()
|
2015-10-13 04:12:27 +08:00
|
|
|
if (NOT LLDB_DISABLE_PYTHON)
|
|
|
|
# We'll grab the arch-specific python libdir on POSIX systems.
|
|
|
|
set (get_python_libdir 1)
|
|
|
|
endif()
|
|
|
|
|
2014-08-16 07:50:36 +08:00
|
|
|
add_host_subdirectory(posix
|
2015-10-16 07:54:09 +08:00
|
|
|
posix/DomainSocket.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
posix/FileSystem.cpp
|
2014-08-20 01:18:29 +08:00
|
|
|
posix/HostInfoPosix.cpp
|
2014-08-28 04:15:30 +08:00
|
|
|
posix/HostProcessPosix.cpp
|
2014-09-10 04:54:56 +08:00
|
|
|
posix/HostThreadPosix.cpp
|
2015-05-07 23:28:49 +08:00
|
|
|
posix/LockFilePosix.cpp
|
2014-10-09 04:38:41 +08:00
|
|
|
posix/PipePosix.cpp
|
2017-02-01 22:30:40 +08:00
|
|
|
posix/ProcessLauncherPosixFork.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
|
|
include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
|
|
|
|
add_host_subdirectory(macosx
|
|
|
|
macosx/Host.mm
|
2014-09-03 05:10:23 +08:00
|
|
|
macosx/HostInfoMacOSX.mm
|
2014-09-10 04:54:56 +08:00
|
|
|
macosx/HostThreadMacOSX.mm
|
|
|
|
macosx/Symbols.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
macosx/cfcpp/CFCBundle.cpp
|
|
|
|
macosx/cfcpp/CFCData.cpp
|
|
|
|
macosx/cfcpp/CFCMutableArray.cpp
|
|
|
|
macosx/cfcpp/CFCMutableDictionary.cpp
|
|
|
|
macosx/cfcpp/CFCMutableSet.cpp
|
|
|
|
macosx/cfcpp/CFCString.cpp
|
|
|
|
)
|
2017-07-19 05:15:53 +08:00
|
|
|
if(IOS)
|
|
|
|
set_property(SOURCE macosx/Host.mm APPEND PROPERTY
|
|
|
|
COMPILE_DEFINITIONS "NO_XPC_SERVICES=1")
|
|
|
|
endif()
|
2014-08-16 07:50:36 +08:00
|
|
|
|
2017-02-01 04:43:05 +08:00
|
|
|
|
2017-01-17 19:55:00 +08:00
|
|
|
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
|
2016-07-21 22:54:03 +08:00
|
|
|
add_host_subdirectory(linux
|
|
|
|
linux/AbstractSocket.cpp
|
|
|
|
linux/Host.cpp
|
|
|
|
linux/HostInfoLinux.cpp
|
|
|
|
linux/LibcGlue.cpp
|
2017-03-15 23:08:49 +08:00
|
|
|
linux/Support.cpp
|
2016-07-21 22:54:03 +08:00
|
|
|
)
|
2017-01-17 19:55:00 +08:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Android")
|
|
|
|
add_host_subdirectory(android
|
|
|
|
android/HostInfoAndroid.cpp
|
|
|
|
android/LibcGlue.cpp
|
|
|
|
)
|
|
|
|
endif()
|
2014-08-16 07:50:36 +08:00
|
|
|
elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
|
|
add_host_subdirectory(freebsd
|
|
|
|
freebsd/Host.cpp
|
2014-08-20 01:18:29 +08:00
|
|
|
freebsd/HostInfoFreeBSD.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
)
|
2015-10-24 08:27:04 +08:00
|
|
|
|
|
|
|
elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
|
|
|
add_host_subdirectory(netbsd
|
|
|
|
netbsd/Host.cpp
|
|
|
|
netbsd/HostInfoNetBSD.cpp
|
|
|
|
)
|
[LLDB] OpenBSD support
Summary:
Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.
Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well. The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header. This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header.
Reviewers: joerg, labath, krytarowski
Reviewed By: krytarowski
Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31131
llvm-svn: 298810
2017-03-26 23:34:57 +08:00
|
|
|
|
|
|
|
elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|
|
|
add_host_subdirectory(openbsd
|
|
|
|
openbsd/Host.cpp
|
|
|
|
openbsd/HostInfoOpenBSD.cpp
|
|
|
|
)
|
2014-08-16 06:04:21 +08:00
|
|
|
endif()
|
2013-09-25 18:37:32 +08:00
|
|
|
endif()
|
2014-08-16 07:50:36 +08:00
|
|
|
|
2015-10-13 04:12:27 +08:00
|
|
|
if (${get_python_libdir})
|
|
|
|
# Call a python script to gather the arch-specific libdir for
|
|
|
|
# modules like the lldb module.
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/get_relative_lib_dir.py
|
|
|
|
RESULT_VARIABLE get_libdir_status
|
|
|
|
OUTPUT_VARIABLE relative_libdir
|
|
|
|
)
|
|
|
|
if (get_libdir_status EQUAL 0)
|
|
|
|
add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${relative_libdir}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2017-08-22 01:41:33 +08:00
|
|
|
set(EXTRA_LIBS)
|
2017-02-01 04:52:41 +08:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
2017-08-22 01:41:33 +08:00
|
|
|
list(APPEND EXTRA_LIBS kvm)
|
2017-02-01 04:52:41 +08:00
|
|
|
endif ()
|
2017-08-22 01:41:33 +08:00
|
|
|
if (APPLE)
|
|
|
|
list(APPEND EXTRA_LIBS xml2)
|
|
|
|
else ()
|
|
|
|
if (LIBXML2_FOUND)
|
|
|
|
list(APPEND EXTRA_LIBS ${LIBXML2_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endif ()
|
|
|
|
if (HAVE_LIBDL)
|
|
|
|
list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS})
|
|
|
|
endif()
|
|
|
|
if (NOT LLDB_DISABLE_LIBEDIT)
|
|
|
|
list(APPEND EXTRA_LIBS edit)
|
|
|
|
endif()
|
2017-02-01 04:52:41 +08:00
|
|
|
|
2017-02-01 04:43:05 +08:00
|
|
|
add_lldb_library(lldbHost
|
|
|
|
${HOST_SOURCES}
|
|
|
|
|
|
|
|
LINK_LIBS
|
|
|
|
lldbCore
|
|
|
|
lldbInterpreter
|
|
|
|
lldbSymbol
|
|
|
|
lldbTarget
|
|
|
|
lldbUtility
|
|
|
|
${LLDB_PLUGINS}
|
2017-02-01 04:52:41 +08:00
|
|
|
${EXTRA_LIBS}
|
2017-02-01 04:43:05 +08:00
|
|
|
|
|
|
|
LINK_COMPONENTS
|
|
|
|
Support
|
|
|
|
)
|