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
|
|
|
|
common/FileSpec.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
|
2014-08-16 07:50:36 +08:00
|
|
|
common/IOObject.cpp
|
2015-05-07 23:28:49 +08:00
|
|
|
common/LockFileBase.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
|
|
|
|
common/NativeRegisterContextRegisterInfo.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
|
|
|
|
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
|
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/ThisThread.cpp
|
|
|
|
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
|
|
|
|
windows/ThisThread.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
|
Introduce a MainLoop class and switch llgs to use it
Summary:
This is the first part of our effort to make llgs single threaded. Currently, llgs consists of
about three threads and the synchronisation between them is a major source of latency when
debugging linux and android applications.
In order to be able to go single threaded, we must have the ability to listen for events from
multiple sources (primarily, client commands coming over the network and debug events from the
inferior) and perform necessary actions. For this reason I introduce the concept of a MainLoop.
A main loop has the ability to register callback's which will be invoked upon receipt of certain
events. MainLoopPosix has the ability to listen for file descriptors and signals.
For the moment, I have merely made the GDBRemoteCommunicationServerLLGS class use MainLoop
instead of waiting on the network socket directly, but the other threads still remain. In the
followup patches I indend to migrate NativeProcessLinux to this class and remove the remaining
threads.
Reviewers: ovyalov, clayborg, amccarth, zturner, emaste
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D11066
llvm-svn: 242018
2015-07-13 18:44:55 +08:00
|
|
|
posix/MainLoopPosix.cpp
|
2014-10-09 04:38:41 +08:00
|
|
|
posix/PipePosix.cpp
|
2014-08-16 07:50:36 +08:00
|
|
|
)
|
|
|
|
|
2017-01-17 19:55:00 +08:00
|
|
|
if (NOT (CMAKE_SYSTEM_NAME MATCHES "Android"))
|
2015-02-13 02:13:44 +08:00
|
|
|
add_host_subdirectory(posix
|
|
|
|
posix/ProcessLauncherPosix.cpp
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
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
|
|
|
|
macosx/ThisThread.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-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/HostThreadLinux.cpp
|
|
|
|
linux/LibcGlue.cpp
|
|
|
|
linux/ProcessLauncherLinux.cpp
|
|
|
|
linux/ThisThread.cpp
|
|
|
|
)
|
2017-02-01 04:43:05 +08:00
|
|
|
list(APPEND LLDB_PLUGINS lldbPluginProcessLinux)
|
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-09-10 04:54:56 +08:00
|
|
|
freebsd/HostThreadFreeBSD.cpp
|
|
|
|
freebsd/ThisThread.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
|
|
|
|
netbsd/HostThreadNetBSD.cpp
|
|
|
|
netbsd/ThisThread.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-02-01 04:52:41 +08:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
|
|
|
set(EXTRA_LIBS kvm)
|
|
|
|
endif ()
|
|
|
|
|
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
|
|
|
|
)
|