8
8
9
9
#include < chrono>
10
10
#include < cstdarg>
11
- #include < fstream>
12
11
#include < mutex>
13
12
14
13
#include " DAP.h"
@@ -35,8 +34,8 @@ using namespace lldb_dap;
35
34
36
35
namespace lldb_dap {
37
36
38
- DAP::DAP (llvm::StringRef path, std::shared_ptr< llvm::raw_ostream> log,
39
- ReplMode repl_mode, std::vector<std::string> pre_init_commands)
37
+ DAP::DAP (llvm::StringRef path, llvm::raw_ostream * log, ReplMode repl_mode ,
38
+ std::vector<std::string> pre_init_commands)
40
39
: debug_adaptor_path(path), broadcaster(" lldb-dap" ), log(log),
41
40
exception_breakpoints (), pre_init_commands(pre_init_commands),
42
41
focus_tid(LLDB_INVALID_THREAD_ID), stop_at_entry(false ), is_attach(false ),
@@ -220,19 +219,19 @@ std::string DAP::ReadJSON() {
220
219
std::string json_str;
221
220
int length;
222
221
223
- if (!input.read_expected (log. get () , " Content-Length: " ))
222
+ if (!input.read_expected (log, " Content-Length: " ))
224
223
return json_str;
225
224
226
- if (!input.read_line (log. get () , length_str))
225
+ if (!input.read_line (log, length_str))
227
226
return json_str;
228
227
229
228
if (!llvm::to_integer (length_str, length))
230
229
return json_str;
231
230
232
- if (!input.read_expected (log. get () , " \r\n " ))
231
+ if (!input.read_expected (log, " \r\n " ))
233
232
return json_str;
234
233
235
- if (!input.read_full (log. get () , length, json_str))
234
+ if (!input.read_full (log, length, json_str))
236
235
return json_str;
237
236
238
237
if (log) {
@@ -685,9 +684,8 @@ PacketStatus DAP::GetNextObject(llvm::json::Object &object) {
685
684
return PacketStatus::JSONMalformed;
686
685
}
687
686
688
- if (log) {
687
+ if (log)
689
688
*log << llvm::formatv (" {0:2}" , *json_value).str () << " \n " ;
690
- }
691
689
692
690
llvm::json::Object *object_ptr = json_value->getAsObject ();
693
691
if (!object_ptr) {
0 commit comments