|
9 | 9 | #ifndef LLDB_TOOLS_LLDB_DAP_DAP_H |
10 | 10 | #define LLDB_TOOLS_LLDB_DAP_DAP_H |
11 | 11 |
|
12 | | -#include <cstdio> |
13 | | -#include <iosfwd> |
14 | | -#include <map> |
15 | | -#include <optional> |
16 | | -#include <thread> |
17 | | - |
18 | | -#include "llvm/ADT/DenseMap.h" |
19 | | -#include "llvm/ADT/DenseSet.h" |
20 | | -#include "llvm/ADT/StringMap.h" |
21 | | -#include "llvm/ADT/StringRef.h" |
22 | | -#include "llvm/Support/JSON.h" |
23 | | -#include "llvm/Support/Threading.h" |
24 | | -#include "llvm/Support/raw_ostream.h" |
25 | | - |
| 12 | +#include "ExceptionBreakpoint.h" |
| 13 | +#include "FunctionBreakpoint.h" |
| 14 | +#include "IOStream.h" |
| 15 | +#include "InstructionBreakpoint.h" |
| 16 | +#include "ProgressEvent.h" |
| 17 | +#include "SourceBreakpoint.h" |
26 | 18 | #include "lldb/API/SBAttachInfo.h" |
27 | 19 | #include "lldb/API/SBCommandInterpreter.h" |
28 | 20 | #include "lldb/API/SBCommandReturnObject.h" |
29 | 21 | #include "lldb/API/SBDebugger.h" |
30 | 22 | #include "lldb/API/SBEvent.h" |
| 23 | +#include "lldb/API/SBFile.h" |
31 | 24 | #include "lldb/API/SBFormat.h" |
32 | 25 | #include "lldb/API/SBLaunchInfo.h" |
33 | 26 | #include "lldb/API/SBTarget.h" |
34 | 27 | #include "lldb/API/SBThread.h" |
35 | | - |
36 | | -#include "ExceptionBreakpoint.h" |
37 | | -#include "FunctionBreakpoint.h" |
38 | | -#include "IOStream.h" |
39 | | -#include "InstructionBreakpoint.h" |
40 | | -#include "ProgressEvent.h" |
41 | | -#include "SourceBreakpoint.h" |
| 28 | +#include "llvm/ADT/DenseMap.h" |
| 29 | +#include "llvm/ADT/DenseSet.h" |
| 30 | +#include "llvm/ADT/StringMap.h" |
| 31 | +#include "llvm/ADT/StringRef.h" |
| 32 | +#include "llvm/Support/JSON.h" |
| 33 | +#include "llvm/Support/Threading.h" |
| 34 | +#include "llvm/Support/raw_ostream.h" |
| 35 | +#include <iosfwd> |
| 36 | +#include <map> |
| 37 | +#include <optional> |
| 38 | +#include <thread> |
42 | 39 |
|
43 | 40 | #define VARREF_LOCALS (int64_t)1 |
44 | 41 | #define VARREF_GLOBALS (int64_t)2 |
@@ -140,13 +137,16 @@ struct DAP { |
140 | 137 | llvm::StringRef debug_adaptor_path; |
141 | 138 | InputStream input; |
142 | 139 | OutputStream output; |
| 140 | + lldb::SBFile in; |
| 141 | + lldb::SBFile out; |
| 142 | + lldb::SBFile err; |
143 | 143 | lldb::SBDebugger debugger; |
144 | 144 | lldb::SBTarget target; |
145 | 145 | Variables variables; |
146 | 146 | lldb::SBBroadcaster broadcaster; |
147 | 147 | std::thread event_thread; |
148 | 148 | std::thread progress_event_thread; |
149 | | - std::unique_ptr<std::ofstream> log; |
| 149 | + std::shared_ptr<std::ofstream> log; |
150 | 150 | llvm::StringMap<SourceBreakpointMap> source_breakpoints; |
151 | 151 | FunctionBreakpointMap function_breakpoints; |
152 | 152 | InstructionBreakpointMap instruction_breakpoints; |
@@ -198,10 +198,14 @@ struct DAP { |
198 | 198 | // will contain that expression. |
199 | 199 | std::string last_nonempty_var_expression; |
200 | 200 |
|
201 | | - DAP(llvm::StringRef path, ReplMode repl_mode); |
| 201 | + DAP(llvm::StringRef path, std::shared_ptr<std::ofstream> log, |
| 202 | + ReplMode repl_mode, std::vector<std::string> pre_init_commands); |
202 | 203 | ~DAP(); |
| 204 | + |
| 205 | + DAP() = delete; |
203 | 206 | DAP(const DAP &rhs) = delete; |
204 | 207 | void operator=(const DAP &rhs) = delete; |
| 208 | + |
205 | 209 | ExceptionBreakpoint *GetExceptionBreakpoint(const std::string &filter); |
206 | 210 | ExceptionBreakpoint *GetExceptionBreakpoint(const lldb::break_id_t bp_id); |
207 | 211 |
|
|
0 commit comments