Skip to content

Commit 2b22371

Browse files
committed
Moving debug_adapter_path and repl_mode to DAP constructor.
1 parent 78433d4 commit 2b22371

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,18 @@ using namespace lldb_dap;
3232

3333
namespace lldb_dap {
3434

35-
DAP::DAP()
36-
: broadcaster("lldb-dap"), exception_breakpoints(),
37-
focus_tid(LLDB_INVALID_THREAD_ID), stop_at_entry(false), is_attach(false),
35+
DAP::DAP(llvm::StringRef path, ReplMode repl_mode)
36+
: debug_adaptor_path(path), broadcaster("lldb-dap"),
37+
exception_breakpoints(), focus_tid(LLDB_INVALID_THREAD_ID),
38+
stop_at_entry(false), is_attach(false),
3839
enable_auto_variable_summaries(false),
3940
enable_synthetic_child_debugging(false),
4041
display_extended_backtrace(false),
4142
restarting_process_id(LLDB_INVALID_PROCESS_ID),
4243
configuration_done_sent(false), waiting_for_run_in_terminal(false),
4344
progress_event_reporter(
4445
[&](const ProgressEvent &event) { SendJSON(event.ToJSON()); }),
45-
reverse_request_seq(0), repl_mode(ReplMode::Auto) {
46+
reverse_request_seq(0), repl_mode(repl_mode) {
4647
const char *log_file_path = getenv("LLDBDAP_LOG");
4748
#if defined(_WIN32)
4849
// Windows opens stdout and stdin in text mode which converts \n to 13,10

lldb/tools/lldb-dap/DAP.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct SendEventRequestHandler : public lldb::SBCommandPluginInterface {
137137
};
138138

139139
struct DAP {
140-
std::string debug_adaptor_path;
140+
llvm::StringRef debug_adaptor_path;
141141
InputStream input;
142142
OutputStream output;
143143
lldb::SBDebugger debugger;
@@ -198,7 +198,7 @@ struct DAP {
198198
// will contain that expression.
199199
std::string last_nonempty_var_expression;
200200

201-
DAP();
201+
DAP(llvm::StringRef path, ReplMode repl_mode);
202202
~DAP();
203203
DAP(const DAP &rhs) = delete;
204204
void operator=(const DAP &rhs) = delete;

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5034,9 +5034,7 @@ int main(int argc, char *argv[]) {
50345034
auto terminate_debugger =
50355035
llvm::make_scope_exit([] { lldb::SBDebugger::Terminate(); });
50365036

5037-
DAP dap;
5038-
dap.debug_adaptor_path = program_path.str().str();
5039-
dap.repl_mode = defaultReplMode;
5037+
DAP dap = DAP(program_path.str(), defaultReplMode);
50405038

50415039
RegisterRequestCallbacks(dap);
50425040

0 commit comments

Comments
 (0)