Skip to content

[NFC][lldb-dap] Clean-up includes #113839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lldb/tools/lldb-dap/Breakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "Breakpoint.h"
#include "DAP.h"
#include "JSONUtils.h"
#include "lldb/API/SBBreakpointLocation.h"
#include "llvm/ADT/StringExtras.h"

using namespace lldb_dap;
Expand Down
1 change: 1 addition & 0 deletions lldb/tools/lldb-dap/Breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H

#include "BreakpointBase.h"
#include "lldb/API/SBBreakpoint.h"

namespace lldb_dap {

Expand Down
3 changes: 1 addition & 2 deletions lldb/tools/lldb-dap/BreakpointBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
//===----------------------------------------------------------------------===//

#include "BreakpointBase.h"
#include "DAP.h"
#include "llvm/ADT/StringExtras.h"
#include "JSONUtils.h"

using namespace lldb_dap;

Expand Down
2 changes: 0 additions & 2 deletions lldb/tools/lldb-dap/BreakpointBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
#ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
#define LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H

#include "lldb/API/SBBreakpoint.h"
#include "llvm/Support/JSON.h"
#include <string>
#include <vector>

namespace lldb_dap {

Expand Down
5 changes: 4 additions & 1 deletion lldb/tools/lldb-dap/DAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
#include <cstdarg>
#include <fstream>
#include <mutex>
#include <sstream>

#include "DAP.h"
#include "JSONUtils.h"
#include "LLDBUtils.h"
#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/API/SBLanguageRuntime.h"
#include "lldb/API/SBListener.h"
#include "lldb/API/SBStream.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/FormatVariadic.h"

Expand Down
19 changes: 0 additions & 19 deletions lldb/tools/lldb-dap/DAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,10 @@
#ifndef LLDB_TOOLS_LLDB_DAP_DAP_H
#define LLDB_TOOLS_LLDB_DAP_DAP_H

#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX

#include <atomic>
#include <condition_variable>
#include <cstdio>
#include <future>
#include <iosfwd>
#include <map>
#include <optional>
#include <set>
#include <thread>

#include "llvm/ADT/DenseMap.h"
Expand All @@ -30,24 +24,12 @@
#include "llvm/Support/raw_ostream.h"

#include "lldb/API/SBAttachInfo.h"
#include "lldb/API/SBBreakpoint.h"
#include "lldb/API/SBBreakpointLocation.h"
#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBCommunication.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBFormat.h"
#include "lldb/API/SBHostOS.h"
#include "lldb/API/SBInstruction.h"
#include "lldb/API/SBInstructionList.h"
#include "lldb/API/SBLanguageRuntime.h"
#include "lldb/API/SBLaunchInfo.h"
#include "lldb/API/SBLineEntry.h"
#include "lldb/API/SBListener.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBTarget.h"
#include "lldb/API/SBThread.h"

Expand All @@ -56,7 +38,6 @@
#include "IOStream.h"
#include "InstructionBreakpoint.h"
#include "ProgressEvent.h"
#include "RunInTerminal.h"
#include "SourceBreakpoint.h"

#define VARREF_LOCALS (int64_t)1
Expand Down
6 changes: 1 addition & 5 deletions lldb/tools/lldb-dap/FifoFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

#include "FifoFiles.h"
#include "JSONUtils.h"

#if !defined(_WIN32)
#include <sys/stat.h>
Expand All @@ -18,11 +19,6 @@
#include <fstream>
#include <future>
#include <optional>
#include <thread>

#include "llvm/Support/FileSystem.h"

#include "lldb/lldb-defines.h"

using namespace llvm;

Expand Down
4 changes: 1 addition & 3 deletions lldb/tools/lldb-dap/FifoFiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
#ifndef LLDB_TOOLS_LLDB_DAP_FIFOFILES_H
#define LLDB_TOOLS_LLDB_DAP_FIFOFILES_H

#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
#include "llvm/Support/Error.h"

#include "JSONUtils.h"
#include "llvm/Support/JSON.h"

#include <chrono>

Expand Down
1 change: 1 addition & 0 deletions lldb/tools/lldb-dap/FunctionBreakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "FunctionBreakpoint.h"
#include "DAP.h"
#include "JSONUtils.h"

namespace lldb_dap {

Expand Down
1 change: 0 additions & 1 deletion lldb/tools/lldb-dap/IOStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <fstream>
#include <string>
#include <vector>

using namespace lldb_dap;

Expand Down
2 changes: 0 additions & 2 deletions lldb/tools/lldb-dap/IOStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#ifndef LLDB_TOOLS_LLDB_DAP_IOSTREAM_H
#define LLDB_TOOLS_LLDB_DAP_IOSTREAM_H

#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX

#if defined(_WIN32)
// We need to #define NOMINMAX in order to skip `min()` and `max()` macro
// definitions that conflict with other system headers.
Expand Down
1 change: 1 addition & 0 deletions lldb/tools/lldb-dap/InstructionBreakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "InstructionBreakpoint.h"
#include "DAP.h"
#include "JSONUtils.h"

namespace lldb_dap {

Expand Down
1 change: 0 additions & 1 deletion lldb/tools/lldb-dap/InstructionBreakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#define LLDB_TOOLS_LLDB_DAP_INSTRUCTIONBREAKPOINT_H

#include "Breakpoint.h"
#include "llvm/ADT/StringRef.h"

namespace lldb_dap {

Expand Down
6 changes: 1 addition & 5 deletions lldb/tools/lldb-dap/JSONUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@
//
//===----------------------------------------------------------------------===//

#include <algorithm>
#include <iomanip>
#include <optional>
#include <sstream>
#include <string.h>

#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FormatAdapters.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ScopedPrinter.h"

#include "lldb/API/SBBreakpoint.h"
#include "lldb/API/SBBreakpointLocation.h"
#include "lldb/API/SBDeclaration.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBStructuredData.h"
#include "lldb/API/SBValue.h"
#include "lldb/Host/PosixApi.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this include breaks lldb windows build because it includes lldb/Host/windows/PosixApi.h on windows. That provides the definition for PATH_MAX, used later in this file. I fixed it on 19c0a74

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing! 🙂


#include "DAP.h"
#include "ExceptionBreakpoint.h"
Expand Down
2 changes: 2 additions & 0 deletions lldb/tools/lldb-dap/LLDBUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include "LLDBUtils.h"
#include "DAP.h"
#include "JSONUtils.h"
#include "lldb/API/SBStringList.h"

#include <mutex>

Expand Down
2 changes: 0 additions & 2 deletions lldb/tools/lldb-dap/OutputRedirector.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#ifndef LLDB_TOOLS_LLDB_DAP_OUTPUT_REDIRECTOR_H
#define LLDB_TOOLS_LLDB_DAP_OUTPUT_REDIRECTOR_H

#include <thread>

#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"

Expand Down
5 changes: 1 addition & 4 deletions lldb/tools/lldb-dap/RunInTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

#include "RunInTerminal.h"
#include "JSONUtils.h"

#if !defined(_WIN32)
#include <sys/stat.h>
Expand All @@ -15,14 +16,10 @@
#endif

#include <chrono>
#include <fstream>
#include <future>
#include <thread>

#include "llvm/Support/FileSystem.h"

#include "lldb/lldb-defines.h"

using namespace llvm;

namespace lldb_dap {
Expand Down
4 changes: 3 additions & 1 deletion lldb/tools/lldb-dap/RunInTerminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
#define LLDB_TOOLS_LLDB_DAP_RUNINTERMINAL_H

#include "FifoFiles.h"
#include "lldb/API/SBError.h"

#include <future>
#include <thread>
#include <memory>
#include <string>

namespace lldb_dap {

Expand Down
1 change: 1 addition & 0 deletions lldb/tools/lldb-dap/SourceBreakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "SourceBreakpoint.h"
#include "DAP.h"
#include "JSONUtils.h"

namespace lldb_dap {

Expand Down
10 changes: 5 additions & 5 deletions lldb/tools/lldb-dap/lldb-dap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
//===----------------------------------------------------------------------===//

#include "DAP.h"
#include "FifoFiles.h"
#include "RunInTerminal.h"
#include "Watchpoint.h"
#include "lldb/API/SBDeclaration.h"
#include "lldb/API/SBInstruction.h"
#include "lldb/API/SBListener.h"
#include "lldb/API/SBMemoryRegionInfo.h"
#include "lldb/API/SBStringList.h"
#include "llvm/Support/Base64.h"

#include <cassert>
Expand Down Expand Up @@ -43,17 +48,12 @@

#include <algorithm>
#include <array>
#include <chrono>
#include <fstream>
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include <sstream>
#include <thread>
#include <vector>

#include "lldb/API/SBEnvironment.h"
#include "lldb/API/SBStream.h"
#include "lldb/Host/Config.h"
#include "llvm/ADT/ArrayRef.h"
Expand Down
Loading