bulbazord created this revision.
bulbazord added reviewers: LLDB, clayborg, jingham, teemperor, JDevlieghere.
Herald added subscribers: atanasyan, jrtc27, mgorny, sdardis, emaste.
bulbazord requested review of this revision.
Herald added a project: LLDB.

I have created this change as a way to solicit feedback and foster
discussion.  My goal is to sever lldbTarget's dependence on
lldbPluginProcessUtility as a part of my larger goal of more cleanly
setting boundaries between lldb's core libraries and lldb's plugin
libraries.

For the purposes of concretely demonstrating what severing the
dependence would look like, I made the easiest change possible (moving
files). I don't think this is the right kind of change because
lldbTarget should ideally be platform-independent. I considered turning
UnixSignals into a Plugin, but to me this felt like overkill. I think
the best change may be somewhere else (possibly creating a new non-plugin
library?) but I'm not sure what that should look like.

Feedback is appreciated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108335

Files:
  lldb/include/lldb/Target/FreeBSDSignals.h
  lldb/include/lldb/Target/GDBRemoteSignals.h
  lldb/include/lldb/Target/LinuxSignals.h
  lldb/include/lldb/Target/MipsLinuxSignals.h
  lldb/include/lldb/Target/NetBSDSignals.h
  lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  lldb/source/Plugins/Process/Utility/CMakeLists.txt
  lldb/source/Plugins/Process/Utility/FreeBSDSignals.cpp
  lldb/source/Plugins/Process/Utility/FreeBSDSignals.h
  lldb/source/Plugins/Process/Utility/GDBRemoteSignals.cpp
  lldb/source/Plugins/Process/Utility/GDBRemoteSignals.h
  lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
  lldb/source/Plugins/Process/Utility/LinuxSignals.h
  lldb/source/Plugins/Process/Utility/MipsLinuxSignals.cpp
  lldb/source/Plugins/Process/Utility/MipsLinuxSignals.h
  lldb/source/Plugins/Process/Utility/NetBSDSignals.cpp
  lldb/source/Plugins/Process/Utility/NetBSDSignals.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Target/CMakeLists.txt
  lldb/source/Target/FreeBSDSignals.cpp
  lldb/source/Target/GDBRemoteSignals.cpp
  lldb/source/Target/LinuxSignals.cpp
  lldb/source/Target/MipsLinuxSignals.cpp
  lldb/source/Target/NetBSDSignals.cpp
  lldb/source/Target/UnixSignals.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp

Index: lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
===================================================================
--- lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -9,9 +9,9 @@
 
 #include "GDBRemoteTestUtils.h"
 
-#include "Plugins/Process/Utility/LinuxSignals.h"
 #include "Plugins/Process/gdb-remote/GDBRemoteClientBase.h"
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h"
+#include "lldb/Target/LinuxSignals.h"
 #include "lldb/Utility/GDBRemote.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Testing/Support/Error.h"
Index: lldb/source/Target/UnixSignals.cpp
===================================================================
--- lldb/source/Target/UnixSignals.cpp
+++ lldb/source/Target/UnixSignals.cpp
@@ -7,12 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Target/UnixSignals.h"
-#include "Plugins/Process/Utility/FreeBSDSignals.h"
-#include "Plugins/Process/Utility/LinuxSignals.h"
-#include "Plugins/Process/Utility/MipsLinuxSignals.h"
-#include "Plugins/Process/Utility/NetBSDSignals.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/StringConvert.h"
+#include "lldb/Target/FreeBSDSignals.h"
+#include "lldb/Target/LinuxSignals.h"
+#include "lldb/Target/MipsLinuxSignals.h"
+#include "lldb/Target/NetBSDSignals.h"
 #include "lldb/Utility/ArchSpec.h"
 
 using namespace lldb_private;
Index: lldb/source/Target/NetBSDSignals.cpp
===================================================================
--- lldb/source/Target/NetBSDSignals.cpp
+++ lldb/source/Target/NetBSDSignals.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "NetBSDSignals.h"
+#include "lldb/Target/NetBSDSignals.h"
 
 using namespace lldb_private;
 
Index: lldb/source/Target/MipsLinuxSignals.cpp
===================================================================
--- lldb/source/Target/MipsLinuxSignals.cpp
+++ lldb/source/Target/MipsLinuxSignals.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "MipsLinuxSignals.h"
+#include "lldb/Target/MipsLinuxSignals.h"
 
 using namespace lldb_private;
 
Index: lldb/source/Target/LinuxSignals.cpp
===================================================================
--- lldb/source/Target/LinuxSignals.cpp
+++ lldb/source/Target/LinuxSignals.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "LinuxSignals.h"
+#include "lldb/Target/LinuxSignals.h"
 
 using namespace lldb_private;
 
Index: lldb/source/Target/GDBRemoteSignals.cpp
===================================================================
--- lldb/source/Target/GDBRemoteSignals.cpp
+++ lldb/source/Target/GDBRemoteSignals.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "GDBRemoteSignals.h"
+#include "lldb/Target/GDBRemoteSignals.h"
 
 using namespace lldb_private;
 
Index: lldb/source/Target/FreeBSDSignals.cpp
===================================================================
--- lldb/source/Target/FreeBSDSignals.cpp
+++ lldb/source/Target/FreeBSDSignals.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "FreeBSDSignals.h"
+#include "lldb/Target/FreeBSDSignals.h"
 
 using namespace lldb_private;
 
Index: lldb/source/Target/CMakeLists.txt
===================================================================
--- lldb/source/Target/CMakeLists.txt
+++ lldb/source/Target/CMakeLists.txt
@@ -10,16 +10,21 @@
   ABI.cpp
   AssertFrameRecognizer.cpp
   ExecutionContext.cpp
+  FreeBSDSignals.cpp
+  GDBRemoteSignals.cpp
   InstrumentationRuntime.cpp
   InstrumentationRuntimeStopInfo.cpp
   JITLoader.cpp
   JITLoaderList.cpp
   Language.cpp
   LanguageRuntime.cpp
+  LinuxSignals.cpp
   Memory.cpp
   MemoryHistory.cpp
   MemoryRegionInfo.cpp
+  MipsLinuxSignals.cpp
   ModuleCache.cpp
+  NetBSDSignals.cpp
   OperatingSystem.cpp
   PathMappingList.cpp
   Platform.cpp
@@ -82,7 +87,6 @@
     lldbInterpreter
     lldbSymbol
     lldbUtility
-    lldbPluginProcessUtility
 
   LINK_COMPONENTS
     Support
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -60,6 +60,7 @@
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/ABI.h"
 #include "lldb/Target/DynamicLoader.h"
+#include "lldb/Target/GDBRemoteSignals.h"
 #include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Target/SystemRuntime.h"
 #include "lldb/Target/Target.h"
@@ -74,7 +75,6 @@
 
 #include "GDBRemoteRegisterContext.h"
 #include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
-#include "Plugins/Process/Utility/GDBRemoteSignals.h"
 #include "Plugins/Process/Utility/InferiorCallPOSIX.h"
 #include "Plugins/Process/Utility/StopInfoMachException.h"
 #include "ProcessGDBRemote.h"
Index: lldb/source/Plugins/Process/Utility/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -1,20 +1,15 @@
 add_lldb_library(lldbPluginProcessUtility
   AuxVector.cpp
   DynamicRegisterInfo.cpp
-  FreeBSDSignals.cpp
-  GDBRemoteSignals.cpp
   HistoryThread.cpp
   HistoryUnwind.cpp
   InferiorCallPOSIX.cpp
   LinuxProcMaps.cpp
-  LinuxSignals.cpp
   MemoryTagManagerAArch64MTE.cpp
-  MipsLinuxSignals.cpp
   NativeProcessSoftwareSingleStep.cpp
   NativeRegisterContextDBReg_arm64.cpp
   NativeRegisterContextDBReg_x86.cpp
   NativeRegisterContextRegisterInfo.cpp
-  NetBSDSignals.cpp
   RegisterContext_x86.cpp
   RegisterContextDarwin_arm.cpp
   RegisterContextDarwin_arm64.cpp
Index: lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
===================================================================
--- lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
+++ lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
@@ -12,9 +12,9 @@
 
 #include <string>
 
-#include "Plugins/Process/Utility/GDBRemoteSignals.h"
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h"
 #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.h"
+#include "lldb/Target/GDBRemoteSignals.h"
 #include "lldb/Target/Platform.h"
 
 namespace lldb_private {
Index: lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
===================================================================
--- lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -20,6 +20,7 @@
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/PosixApi.h"
+#include "lldb/Target/GDBRemoteSignals.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/FileSpec.h"
@@ -29,7 +30,6 @@
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/UriParser.h"
 
-#include "Plugins/Process/Utility/GDBRemoteSignals.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemote.h"
 
 using namespace lldb;
Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
+++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
@@ -20,6 +20,7 @@
     lldbPluginExpressionParserClang
     lldbPluginCPPRuntime
     lldbPluginTypeSystemClang
+    lldbPluginProcessUtility
   CLANG_LIBS
     clangAST
   LINK_COMPONENTS
Index: lldb/source/Plugins/Process/Utility/NetBSDSignals.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/Process/Utility/NetBSDSignals.h
@@ -1,27 +0,0 @@
-//===-- NetBSDSignals.h ----------------------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NETBSDSIGNALS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NETBSDSIGNALS_H
-
-#include "lldb/Target/UnixSignals.h"
-
-namespace lldb_private {
-
-/// NetBSD specific set of Unix signals.
-class NetBSDSignals : public UnixSignals {
-public:
-  NetBSDSignals();
-
-private:
-  void Reset() override;
-};
-
-} // namespace lldb_private
-
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NETBSDSIGNALS_H
Index: lldb/source/Plugins/Process/Utility/MipsLinuxSignals.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/Process/Utility/MipsLinuxSignals.h
@@ -1,28 +0,0 @@
-//===-- MipsLinuxSignals.h ------------------------------------------*- C++
-//-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_MIPSLINUXSIGNALS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_MIPSLINUXSIGNALS_H
-
-#include "lldb/Target/UnixSignals.h"
-
-namespace lldb_private {
-
-/// Linux specific set of Unix signals.
-class MipsLinuxSignals : public UnixSignals {
-public:
-  MipsLinuxSignals();
-
-private:
-  void Reset() override;
-};
-
-} // namespace lldb_private
-
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_MIPSLINUXSIGNALS_H
Index: lldb/source/Plugins/Process/Utility/LinuxSignals.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/Process/Utility/LinuxSignals.h
@@ -1,27 +0,0 @@
-//===-- LinuxSignals.h ------------------------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LINUXSIGNALS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LINUXSIGNALS_H
-
-#include "lldb/Target/UnixSignals.h"
-
-namespace lldb_private {
-
-/// Linux specific set of Unix signals.
-class LinuxSignals : public UnixSignals {
-public:
-  LinuxSignals();
-
-private:
-  void Reset() override;
-};
-
-} // namespace lldb_private
-
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LINUXSIGNALS_H
Index: lldb/source/Plugins/Process/Utility/GDBRemoteSignals.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/Process/Utility/GDBRemoteSignals.h
@@ -1,29 +0,0 @@
-//===-- GDBRemoteSignals.h --------------------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_GDBREMOTESIGNALS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_GDBREMOTESIGNALS_H
-
-#include "lldb/Target/UnixSignals.h"
-
-namespace lldb_private {
-
-/// Empty set of Unix signals to be filled by PlatformRemoteGDBServer
-class GDBRemoteSignals : public UnixSignals {
-public:
-  GDBRemoteSignals();
-
-  GDBRemoteSignals(const lldb::UnixSignalsSP &rhs);
-
-private:
-  void Reset() override;
-};
-
-} // namespace lldb_private
-
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_GDBREMOTESIGNALS_H
Index: lldb/source/Plugins/Process/Utility/FreeBSDSignals.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/Process/Utility/FreeBSDSignals.h
@@ -1,27 +0,0 @@
-//===-- FreeBSDSignals.h ----------------------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_FREEBSDSIGNALS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_FREEBSDSIGNALS_H
-
-#include "lldb/Target/UnixSignals.h"
-
-namespace lldb_private {
-
-/// FreeBSD specific set of Unix signals.
-class FreeBSDSignals : public UnixSignals {
-public:
-  FreeBSDSignals();
-
-private:
-  void Reset() override;
-};
-
-} // namespace lldb_private
-
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_FREEBSDSIGNALS_H
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] D108... Alex Langford via Phabricator via lldb-commits

Reply via email to