From 1c5ce2d74fa3ee15d1cb2e092cce0754c8ce19fa Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 13 Apr 2025 09:34:30 +0200 Subject: [PATCH] Reapply "[lldb] ProcessGdbRemote header gardning" This reverts commit 68ab45f0533f3bbfc1c96bddd53de7e769180219, reapplying 2fd860c1f559c0b0be66cc000e38270a04d0a1a3. The only change is keeping "lldb/Host/Config.h", which I believe was the cause of the failures. --- .../Process/gdb-remote/GDBRemoteClientBase.h | 7 ++++++- .../gdb-remote/GDBRemoteCommunication.cpp | 15 +++++---------- .../gdb-remote/GDBRemoteCommunication.h | 19 +++---------------- .../gdb-remote/GDBRemoteClientBaseTest.cpp | 14 +++++++++----- 4 files changed, 23 insertions(+), 32 deletions(-) diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h index b47fee76a2ab..af2abdf4da5c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h @@ -10,8 +10,13 @@ #define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECLIENTBASE_H #include "GDBRemoteCommunication.h" - +#include "lldb/Utility/Broadcaster.h" +#include "llvm/ADT/STLFunctionalExtras.h" +#include "llvm/ADT/StringRef.h" +#include #include +#include +#include namespace lldb_private { namespace process_gdb_remote { diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 77eadfc8c9f6..abdc3da047dc 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -7,14 +7,8 @@ //===----------------------------------------------------------------------===// #include "GDBRemoteCommunication.h" - -#include -#include -#include -#include - +#include "ProcessGDBRemoteLog.h" #include "lldb/Host/Config.h" -#include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" @@ -30,13 +24,14 @@ #include "lldb/Utility/Log.h" #include "lldb/Utility/RegularExpression.h" #include "lldb/Utility/StreamString.h" -#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_ZLIB #include "llvm/Support/ScopedPrinter.h" - -#include "ProcessGDBRemoteLog.h" +#include +#include +#include +#include #if defined(__APPLE__) #define DEBUGSERVER_BASENAME "debugserver" diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index 107c0896c4e6..3565a73f1958 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -10,28 +10,17 @@ #define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATION_H #include "GDBRemoteCommunicationHistory.h" - -#include -#include -#include -#include -#include -#include - #include "lldb/Core/Communication.h" #include "lldb/Host/Config.h" #include "lldb/Host/HostThread.h" #include "lldb/Host/Socket.h" #include "lldb/Utility/Args.h" -#include "lldb/Utility/Listener.h" -#include "lldb/Utility/Predicate.h" #include "lldb/Utility/StringExtractorGDBRemote.h" -#include "lldb/lldb-public.h" +#include +#include +#include namespace lldb_private { -namespace repro { -class PacketRecorder; -} namespace process_gdb_remote { enum GDBStoppointType { @@ -162,8 +151,6 @@ public: void DumpHistory(Stream &strm); - void SetPacketRecorder(repro::PacketRecorder *recorder); - static llvm::Error ConnectLocally(GDBRemoteCommunication &client, GDBRemoteCommunication &server); diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp index 99d1e12359e7..ed77e86ac370 100644 --- a/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp +++ b/lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp @@ -5,16 +5,20 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -#include -#include "GDBRemoteTestUtils.h" - -#include "Plugins/Process/Utility/LinuxSignals.h" #include "Plugins/Process/gdb-remote/GDBRemoteClientBase.h" +#include "GDBRemoteTestUtils.h" +#include "Plugins/Process/Utility/LinuxSignals.h" #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h" #include "lldb/Utility/GDBRemote.h" -#include "llvm/ADT/STLExtras.h" +#include "lldb/Utility/Listener.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Testing/Support/Error.h" +#include "gtest/gtest.h" +#include +#include +#include +#include using namespace lldb_private::process_gdb_remote; using namespace lldb_private;