[Lldb-commits] [PATCH] D58654: Move Config.h from Host to Utility

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 25 16:33:29 PST 2019


zturner created this revision.
zturner added reviewers: labath, jgorbe, JDevlieghere, davide.
Herald added subscribers: mgorny, emaste.

`Host/Config.h` is where we have platform specific preprocessor defines that are configured at CMake time.  Then, we can include this file `lldb/Host/Config.h` and read the value of defines.  This is basically identical to what llvm does with `llvm/Support/llvm-config.h`, the only fundamental differences being: a) LLDB configures it into `lldb/Host` where as the spiritual equivalent to `llvm/Support` is `lldb/Utility`, and b) LLDB calls it `Config.h` and LLVM calls it `llvm-config.h`.

This patch brings LLDB in line with LLVM here by configuring into `lldb/Utility/lldb-config.h`, in part for consistency and in part for more practical reasons.

The practical reasons are that I want to use `Socket.h` from a new tool / library without having to link all of LLDB such as Clang, Python, etc, and that's not currently possible with the current layering, as linking to Host will link to everything.

So this is a necessary first step.  `llvm/Support`'s model for handling platform specific differences is quite convenient both from a usability as well as a maintenance perspective, and I'd like to gradually move towards that whenever an opportunity / need arises.  So the immediate plan is to move `config.h` to Utility, and then start by moving pieces -- as necessary -- from Host to Utility until I can get `Socket` just by linking to `lldbUtility`.


https://reviews.llvm.org/D58654

Files:
  lldb/cmake/XcodeHeaderGenerator/CMakeLists.txt
  lldb/cmake/modules/LLDBGenerateConfig.cmake
  lldb/include/lldb/Host/Config.h
  lldb/include/lldb/Host/Config.h.cmake
  lldb/include/lldb/Host/MainLoop.h
  lldb/include/lldb/Host/Terminal.h
  lldb/include/lldb/Host/linux/Uio.h
  lldb/include/lldb/Target/Process.h
  lldb/include/lldb/Utility/lldb-config.h
  lldb/include/lldb/Utility/lldb-config.h.cmake
  lldb/source/Host/common/File.cpp
  lldb/source/Host/common/HostInfoBase.cpp
  lldb/source/Host/common/ProcessLaunchInfo.cpp
  lldb/source/Host/common/PseudoTerminal.cpp
  lldb/source/Host/common/Socket.cpp
  lldb/source/Host/common/TCPSocket.cpp
  lldb/source/Host/common/Terminal.cpp
  lldb/source/Host/common/UDPSocket.cpp
  lldb/source/Host/linux/HostInfoLinux.cpp
  lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
  lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
  lldb/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp
  lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
  lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
  lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
  lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/unittests/Host/SocketTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58654.188273.patch
Type: text/x-patch
Size: 18745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190226/05600d1d/attachment-0001.bin>


More information about the lldb-commits mailing list